Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL: declaration of cursor is incomplete or malformed
Hi,
I am new to PL/SQL and my first simple program returns the following errors:
3/10 PLS-00341: declaration of cursor 'C1' is incomplete or malformed
4/6 PL/SQL: SQL Statement ignored 4/41 PLS-00201: identifier 'TABLE_NAME' must be declared 8/7 PL/SQL: Item ignored 19/7 PL/SQL: SQL Statement ignored 19/21 PLS-00320: the declaration of the type of this expression is incomplete or malformed 21/7 PL/SQL: Statement ignored 21/27 PLS-00320: the declaration of the type of this expression is incomplete or malformed
I am using Oracle 8.1.7 and PL/SQL function listing is:
CREATE OR REPLACE FUNCTION get_pkey_list(table_name IN VARCHAR, query IN VARCHAR2) RETURN VARCHAR2 IS CURSOR c1 IS
SELECT /*+FIRST_ROWS */ pkey FROM table_name WHERE contains(search_text, query, 10) > 0 order BY score(10) desc, pkey desc;
r1 c1%ROWTYPE;
pkey_rec VARCHAR2(8);
res_str VARCHAR2(230);
i NUMBER := 1;
BEGIN
OPEN c1;
i := 1;
res_str := '';
WHILE i <= 25
LOOP
FETCH c1 INTO r1; pkey_rec := TO_CHAR(r1.pkey); res_str := CONCAT(res_str, pkey_rec); IF i < 25 THEN res_str := CONCAT(res_str, ','); END IF; i := i + 1;
RETURN res_str;
EXCEPTION
WHEN OTHERS THEN
RETURN -1;
END get_pkey_list;
J Received on Fri Mar 14 2003 - 12:51:57 CST
![]() |
![]() |