Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> column name order & insert into tab select

column name order & insert into tab select

From: <jeanch_at_my-deja.com>
Date: 2000/03/03
Message-ID: <89osh9$o13$1@nnrp1.deja.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US