| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> column name order & insert into tab select
Folks,
Here is a good one right;
I am building a string that contains like str := 'insert into tab select col1,col2,...,2,'tiger',coln from tab where id = 23';
I obtain the column list for that table from all_tab_columns.
SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = tab AND OWNER = 'scott';
Up to now the order (given by the select to all_tab_columns) in which I
was putting columns into the string
was what oracle expected when I submit str;
However for some reason it does not anymore.
My question is how I can guarantie that the order in which I put columns and value in str will always be OK; Or where can I fetch the column list from a table and be sure that the order I am given will be fine for a insert into select type of transaction.
Cheers
JC
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Mar 03 2000 - 00:00:00 CST
![]() |
![]() |