Spilliting row [message #408645] |
Wed, 17 June 2009 03:48 |
someswar1
Messages: 53 Registered: January 2008
|
Member |
|
|
Hi,
I need to pass multiple table names('emp,dept') as parameters to a PL/SQL program and check each table count.If any table count=0 then it sould return unsuccessfull otherwise its return successfull .
Eg. If two table is emp and dept.
sp pass the value as 'emp,dept' and check both emp dept tables count.
Please Help.
Regards
Someswar
|
|
|
|
|
|
|
|
Re: Spilliting row [message #408662 is a reply to message #408657] |
Wed, 17 June 2009 04:44 |
someswar1
Messages: 53 Registered: January 2008
|
Member |
|
|
Ya I just want to know if there is at least ONE record r exist in the table.But after spliting I am not able to check the count of at least one row.
Please help.
|
|
|
|
|
|
Re: Spilliting row [message #408673 is a reply to message #408667] |
Wed, 17 June 2009 05:12 |
someswar1
Messages: 53 Registered: January 2008
|
Member |
|
|
I have wriiten the code that way. But the code gives the error
create or replace FUNCTION check_records( p_table_list IN VARCHAR2)
return varchar2
IS
v_return varchar2(20);
v_dummy varchar2(300);
type rc is ref cursor;
c rc;
begin
FOR table_rec IN ( <split sql like in my link> )
LOOP
OPEN c FOR 'SELECT rownum FROM '||table_rec.table_name;
FETCH c INTO v_dummy;
IF v_refcur%NOTFOUND;
v_return := 'Unsuccessful'
END IF;
CLOSE c;
EXIT WHEN v_return = 'Unsuccessful';
END LOOP;
RETURN v_return;
END;
|
|
|
|
Re: Spilliting row [message #408682 is a reply to message #408677] |
Wed, 17 June 2009 05:28 |
someswar1
Messages: 53 Registered: January 2008
|
Member |
|
|
I have got this error..
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( * @ % & = - + < / > at in is mod remainder not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like LIK
|
|
|
|
Re: Spilliting row [message #408693 is a reply to message #408673] |
Wed, 17 June 2009 05:59 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).
Regards
Michel
|
|
|