Home:ALL Converter>generic stored procedures in oracle

generic stored procedures in oracle

Ask Time:2009-12-16T18:34:35         Author:user223541

Json Formatter

i want to write a generic stored procedure in oracle .For example i want to take table name as input and then do maipulations on it. I want to learn some sample generic codes and the basica of writing generic stored procedures in oracle. Can any one provie code snippets/ links to websites or other material for this?

Author:user223541,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/1913759/generic-stored-procedures-in-oracle
David Aldridge :

Generic = dynamic SQL, either \"Native Dynamic SQL\" (Execute Immediate) or the DBMS_SQL package. http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_dynamic_sql.htm#i1006546\n\nOrdinarily SQL statements are parsed when the procedure is compiled, however this is not possible if the table name is not known -- the table may of course not even exist at compile time.\n\nHere are links to documentation on the topic, with examples.\n\nhttp://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/dynamic.htm#LNPLS011\n\nhttp://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_dynamic_sql.htm#ADFNS008\n\nA word of caution -- do not use dynamic SQL if you can use static SQL. The flexibility comes at a price.",
2009-12-16T11:14:12
cletus :

Well you'll need the EXECUTE IMMEDIATE statement for sure.",
2009-12-16T10:37:48
yy