Hi All,
I was write a query to get all the ePerformance records' row count using only PSRECDEFN table.Here's my query and is ging me error as 'table or view doesnot exist'.
DECLARE
CURSOR c2 IS SELECT recname FROM psrecdefn WHERE objectownerid = 'HEP' AND RECTYPE NOT IN (1,2,3,4,5);
v_c1 c2%rowtype;
row_cnt NUMBER;
BEGIN
OPEN c2;
LOOP
FETCH c2
INTO v_c1;
EXIT
WHEN c2 % NOTFOUND;
EXECUTE IMMEDIATE 'SELECT COUNT(*) from PS_' ||v_c1.RECNAME|| 'INTO'|| row_cnt;
DBMS_OUTPUT.PUT_LINE('rows in table PS_' || v_c1.RECNAME || '=' || row_cnt);
--DBMS_OUTPUT.PUT_LINE('rows in table PS_' || v_c1.RECNAME);
END LOOP;
CLOSE c2;
END;
Please help me up to solve the query.Help appreciated if any one provide me the correct query
| Title | Under | Posted on |
|---|---|---|
| MD5 - SHA checksum of a file. | PeopleSoft Technical | 02/07/2012 - 5:29am |
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
Can you try the surson having table as PSRECDEFN in upper cas as well as column names in upper case
I'm not very famaliar with this code but could it be you need a space in the concatenation see second line of each line of code below.
EXECUTE IMMEDIATE 'SELECT COUNT(*) from PS_' ||v_c1.RECNAME|| 'INTO'|| row_cnt;
EXECUTE IMMEDIATE 'SELECT COUNT(*) from PS_' ||v_c1.RECNAME|| ' INTO '|| row_cnt;
DBMS_OUTPUT.PUT_LINE('rows in table PS_' || v_c1.RECNAME || '=' || row_cnt);
DBMS_OUTPUT.PUT_LINE('rows in table PS_' || v_c1.RECNAME || ' = ' || row_cnt);
Post new comment