PL/SQL problem [message #680254] |
Fri, 01 May 2020 03:04 |
|
nedislav
Messages: 3 Registered: May 2020
|
Junior Member |
|
|
DECLARE
v_HIREDATE DATE := '2000-SEP-28';
v_empid EMPLOYEES.EMPLOYEE_ID%TYPE;
v_empfirstname EMPLOYEES.FIRST_NAME%TYPE;
v_emplastname EMPLOYEES.LAST_NAME%TYPE;
v_emphiredate EMPLOYEES.HIRE_DATE%TYPE;
CURSOR C_DATE_CUR(v_HIREDATE DATE) IS
SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, HIRE_DATE FROM EMPLOYEES;
BEGIN
OPEN C_DATE_CUR();
FETCH C_DATE_CUR INTO v_empid, v_empfirstname, v_emplastname, v_emphiredate;
WHILE C_DATE_CUR%FOUND LOOP
IF v_emphiredate>v_HIREDATE THEN
dbms_output.put_line(v_empid||','||v_empfirstname||','||v_emplastname||','||v_emphiredate);
END IF;
FETCH C_DATE_CUR INTO v_empid, v_empfirstname, v_emplastname, v_emphiredate;
END LOOP;
CLOSE C_DATE_CUR;
END;
That is my code and it has error on line 11
this is the error:
Error report -
ORA-06550: line 11, column 9:
PLS-00306: wrong number or types of arguments in call to 'C_DATE_CUR'
ORA-06550: line 11, column 4:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
[Updated on: Fri, 01 May 2020 03:14] by Moderator Report message to a moderator
|
|
|
Re: PL/SQL problem [message #680255 is a reply to message #680254] |
Fri, 01 May 2020 03:38 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You've declared a parameter for that cursor.
So you need to pass a parameter to it when you open ii - in the brackets after the cursor name.
|
|
|
|
|
|
Re: PL/SQL problem [message #680259 is a reply to message #680258] |
Fri, 01 May 2020 04:34 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Help you do what exactly?
Did you copy the code from that 10 year old thread?
If so - why? It states in the thread it doesn't work.
In the post after the one you copied from Barbara goes into some detail as to what is wrong with it. Did you read and understand that post?
|
|
|
|
|
Re: PL/SQL problem [message #680262 is a reply to message #680259] |
Fri, 01 May 2020 05:40 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
As I said earlier:
cookiemonster wrote on Fri, 01 May 2020 10:34
In the post after the one you copied from Barbara goes into some detail as to what is wrong with it. Did you read and understand that post?
|
|
|
|
|
|