write a query that returns first characters of each word in
Oracel/Sql pl sql

Answers were Sorted based on User's Feedback



write a query that returns first characters of each word in Oracel/Sql pl sql..

Answer / priya

select substr(ename,1,1) from emp;

Is This Answer Correct ?    18 Yes 2 No

write a query that returns first characters of each word in Oracel/Sql pl sql..

Answer / murali

Answers given above are correct except one

For PL-SQL:-

DECLARE
CURSOR ECUR IS SELECT SUBSTR(ENAME,1,1) as sub_name FROM EMP;
BEGIN
FOR V_ECUR IN ECUR LOOP
DBMS_OUTPUT.PUT_LINE(V_ECUR.sub_name);
END LOOP;
END;

Note: column alias name must be given.

Is This Answer Correct ?    6 Yes 1 No

write a query that returns first characters of each word in Oracel/Sql pl sql..

Answer / rajesh venati

For SQL:-

SELECT SUBSTR(ENAME,1,1) FROM EMP;
--------------------------------------------------------------
For PL-SQL:-

DECLARE
CURSOR ECUR IS SELECT SUBSTR(ENAME,1,1) FROM EMP;
BEGIN
FOR V_ECUR IN ECUR LOOP
DBMS_OUTPUT.PUT_LINE(V_ECUR.ENAME);
END LOOP;
END;

Is This Answer Correct ?    5 Yes 3 No

write a query that returns first characters of each word in Oracel/Sql pl sql..

Answer / hari k

set serveroutput on;
declare
cursor c1 is select substr(name1,1,1) from tab1;
v_string tab1.name1%type;
begin
open c1;
loop
fetch c1 into v_string ;
exit when c1%notfound;
dbms_output.put_line(v_string);
end loop;
end;

Is This Answer Correct ?    0 Yes 0 No

write a query that returns first characters of each word in Oracel/Sql pl sql..

Answer / muhammad faisal

/*
using PL SQL code*/

declare
CURSOR emp_sub IS SELECT substr(last_name,1,1)
from employees;
name employees.last_name%type;
begin
open emp_sub;
loop
fetch emp_sub into name;
/*select last_name into name from employees;*/
dbms_output.put_line(name);
exit when emp_sub%notfound;
end loop;
close emp_sub;
end;
/

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is sqlservr exe?

0 Answers  


how to fetch alternate records from a table? : Sql dba

0 Answers  


what is dbms? : Sql dba

0 Answers  


Why do we need cursor in pl sql?

0 Answers  


What is the sql case statement?

0 Answers  






how to connect oracle in unix prompt?

4 Answers   Polaris,


Explain 3 basic parts of a trigger.

0 Answers  


How packaged procedures and functions are called from the following?

2 Answers  


Is sql a scripting language?

0 Answers  


What is cold data?

0 Answers  


Use The Implicit cursor to Query The Department table information Where Deptno is 30.check,if no record was found then print "Record Was Not Found".Else Print Deptname And Ename.Dept table Have Dname Varchar2(20),Deptno Number,EnameVarchar2(20).Please Answer In 2 mins,with in Maximum 15 lines.

5 Answers   Wipro,


What is scope and visibility in PL/SQL?

0 Answers  


Categories