I am working on ORACLE STORED PROCEDURES and I have a doubt. I have a query which fetches more than 1 row and I want to store all those 3 row\'s values in 1 Variable. Can anybod
Hi all and Thank you for your time. I have resolved the question and all thanks to Ederson.
Here is the solution :
SELECT WM_CONCAT(STUDENT_NAME)
FROM STUDENT.STUDENT_DETAILS WHERE CLASS_ID= 'C';
Now if you are using this in a stored procedure or PLSQL you just have to create a variable and use SELECT INTO
with it and print the variable.
Here is the code
DECLARE
C_NAMES VARCHAR2(100);
BEGIN
SELECT WM_CONCAT(STUDENT_NAME) INTO C_NAMES
FROM STUDENT.STUDENT_DETAILS WHERE CLASS_ID= 'C';
dbms_output.put_line(sname);
END;
Thanks again for your help people.