This content has been marked as final. Show 5 replies
I selected the query, I played the query (F9 in sql-developer), but it doesn't work.Add some clarity to the above statement. Instead of simply saying it doesn't work, explain why it is not working like either you are getting an error or you are not getting the expected output..
Based on your code you will getting an error something like this.
In this case you need to read the pl/sql reference manual.
SQL> declare 2 l_empno constant number := 7899; 3 begin 4 select * from emp where empno = l_empno; 5 end; 6 / select * from emp where empno = l_empno; * ERROR at line 4: ORA-06550: line 4, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
Hope that helps.
Where is INTO clause
Can you make me an example? is the first time I use this Constant in oracle...
Note the '&' before 'prova'!
SELECT * FROM WN_T_CON_PREST PREST2 WHERE PREST2.D_CON_DATA_FINE>=TO_DATE('&prova','YYYYMMDD');
Executed in SQL*Plus, you will be asked for the value of prova. Don´t know about SQL Developer though.
Try this one...
prova CONSTANT VARCHAR(8) := '20080601';
CURSOR C_WN_T_CON_PREST(p_prova IN WN_T_CON_PREST.prova%TYPE) IS
WHERE D_CON_DATA_FINE >= TO_DATE(p_prova,'YYYYMMDD');
FETCH C_WN_T_CON_PREST INTO v_prova;
EXIT WHEN C_WN_T_CON_PREST%NOTFOUND;