Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
INSERT |
Tue, Feb 26 2008 7:54 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | If I want to insert values into the first 2 columns of a table, but I don't know the column names is it possible WHEN the table has more than two columns? If so how?
Roy Lambert |
Wed, Feb 27 2008 6:26 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< If I want to insert values into the first 2 columns of a table, but I don't know the column names is it possible WHEN the table has more than two columns? If so how? >> In an SQL statement or in a script with SQL/PSM ? If the former, then it's possible, but you'll most likely have to build the SQL dynamically in code, using the Information schema to find out what the first two columns are and then building the INSERT statement accordingly with only the first two column names specified: http://www.elevatesoft.com/scripts/manual.dll?action=mantopic&id=edb1sql&category=11&topic=172 -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Feb 27 2008 6:59 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
Thanks - pretty much the conclusion I'd come to. I'm doing it in code for now cos I don't know how to set a column to force data entry to upper case. Roy Lambert |
Wed, Feb 27 2008 7:15 AM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< In an SQL statement or in a script with SQL/PSM ? If the former, then it's possible, but you'll most likely have to build the SQL dynamically in code, using the Information schema to find out what the first two columns are and then building the INSERT statement accordingly with only the first two column names specified: >> It would be nice to have an ORDINAL_POSITION column in the "TableColumns" system table, holding the 1-based index of the columns within the table definition. Example query: select name from information.tablecolumns where upper(tablename) = 'MYTABLE' and ordinal_position between 1 and 2 Ole Willy Tuv |
Thu, Feb 28 2008 7:05 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< It would be nice to have an ORDINAL_POSITION column in the "TableColumns" system table, holding the 1-based index of the columns within the table definition. >> I've bounced around the idea a few times. For now, the ordinal position is the row position, so if you use this: select name from information.tablecolumns where upper(tablename) = 'MYTABLE' then the first two rows are guaranteed to be the first two rows in the table, in ordinal order. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 07:30 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |