Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Is sql a backend language?

0 Answers  


What is the use of index in sql?

0 Answers  


how mysql optimizes distinct? : Sql dba

0 Answers  


what is csv? : Sql dba

0 Answers  


can we delete the trigger in a view? if yes why if not why?

5 Answers   Tech Mahindra,


What is exception? What are the types of exceptions?

0 Answers  


What is dynamic sql in pl sql?

0 Answers  


What are the usage of SAVEPOINTS?

5 Answers  


Explain clause in sql?

0 Answers  


what is oltp (online transaction processing)? : Sql dba

0 Answers  


Explain the uses of a database trigger?

0 Answers  


when normalization is required

3 Answers   HCL,


Categories