I am trying to generate an insert statement from a row in a table?
if the row is [1 , “myfirstname”, “mylastname”] is there a way of getting a query like:
“insert into table sometable (uid, FirstName, LastName) values (1 , “myfirstname”,
“mylastname”)
…without using dynamic sql?
Thanks
EDIT:
admittedly, i am lazy about this and was trying not to use dynamic sql / all_tab_columns.
I was hoping for some magical function call that returns a DML statement for a row just as there is a way to get a DDL expression for an object:
select dbms_metadata.get_ddl(‘TABLE’,’TABLENAME’) from dual … but DML for a row … it’s too much to ask i think.
You want to turn “raw” data into a SQL insert statement.
There is no way to do this with SQL, but usually GUI clients have this kind of functionality