|
Niels,
I think you are asking about the SQL-generated "short column name" aka.
"System name", vs. the long column name?
In DDS, we could use ALIAS to define a long fieldname as an "alias" for
the short names.
In Db2i SQL, you can do the same thing like this:
CREATE TABLE tablename (
longColumnName FOR ShortName ...;
...
);
Hope that helps?
All the best,
Mark S. Waterbury
On Wednesday, August 4, 2021, 08:52:55 AM EDT, Niels Liisberg <nli@xxxxxxxxxxxxxxxxx> wrote:
I am in a situation where the DDS database is now converted into a SQL
database so each table is now created like this:
CREATE OR REPLACE TABLE mytable (
id FOR COLUMN TFROWID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY
PRIMARY KEY,
Active_Job_Name FOR MYACTJOB char(26)
) RCDFMT mytableR;
However all the access to the new tables need to know the original column
name so the code will not have to be rewritten.
The question is - how do I get the "FOR" system name ( here MYACTJOB) ?
The "SQLDescribeCol" gives the new SQL name, so instead I was trying to use
the "SQLColAttribute" function but I don't find the option among the
features listed:
SQL_DESC_AUTO_INCREMENT INTEGER
SQL_DESC_BASE_COLUMN
SQL_DESC_BASE_SCHEMA
SQL_DESC_BASE_TABLE
SQL_DESC_COLUMN_CCSID
SQL_DESC_COUNT
SQL_DESC_DISPLAY_SIZE
SQL_DESC_LABEL
SQL_DESC_LENGTH
SQL_DESC_NAME
SQL_DESC_NULLABLE
SQL_DESC_PRECISION
SQL_DESC_SCALE
Perhaps I am using the wrong function?
Any help will be appreciated. Thank you.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.