I'm new to PL/SQL and I'm trying to print the contents of a specific table row using a PL/SQL procedure. The tricky part is that I want to make the procedure generic enough so that it can print the contents of ANY table. There shouldn't be any hard coding of column types.
Here is some pseudo code (NOT WORKING!!!) of what it is that I'm trying to do:
CREATE OR REPLACE PROCEDURE print_row(table_name IN VARCHAR2(50), table_id IN number) IS
FOR i < columnCount LOOP
SELECT columnName INTO currdata FROM table_name WHERE table_id = table_id;
Unfortunately you cannot SELECT INTO a SYS.AnyData variable, which I though was the purpose of AnyData - that it can take ANY data of ANY data type. The print_any (data IN SYS.AnyData) procedure already exists and works. But I really need help with the print_row procedure. It seems such a simple task so there must be something I'm missing...