Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
create or replace FUNCTION Proc(schema_name in VARCHAR) RETURN NUMBER IS SQL_TXT VARCHAR(700); BEGIN SQL_TXT:= 'UPDATE '||schema_name||'.my_table x set ( line ) = ( select y.val from (select emp_no, line, row_number() over (partition by emp_no order by line ) as val from '||schema_name||'.my_table ) y where x.emp_no = y.emp_no and x.line = y.line) EXECUTE IMMEDIATE SQL_TXT; RETURN SQL%ROWCOUNT; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM); RETURN -1; END;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL question - help with insert for missing info||5||24|
|Oracle perfomance issue.||4||48|
|using an update statement with 3 tables but need to get minimum receipt date need help finishings||4||59|
|Question about Common Table Expressions||3||42|
Join the community of 500,000 technology professionals and ask your questions.