Generic function to display a specific row from any table
671581Nov 20 2008 — edited Nov 21 2008Hi all,
I need some help to write a function in PL/SQL or Dynamic SQL (or both), to write a function that would take in parameters only the unique ID of the row to display and the name of the table to display (that could be any table with any format).
Actually we don't know in advance which table will be accessed, so we don't know the columns and their types until the function is called.
Once I get the row, I want to return a small table with a size of only one line containing the details of the row I looked for.
So the signature of the function would be something like: CREATE function displayDetailedRowFromAnyTable(uniqId in varchar2(25), tableName in varchar2(25)).
Hope the description is clear. I found in some forums some details about this kind of problems; however, the structure of the tables (ie. the columns name and their types) is always known in advance. In my case, I don't know those details until run time.
Any help would be greatly appreciated.