×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Nils,
Perhaps this may help?
In STRSQL you can run:
CALL QSYS2.GENERATE_SQL('oldFile', 'oldLibrary', 'TABLE', REPLACE_OPTION => '0')
Then look in QTEMP/Q_GENSQL at member Q_GENSQL ...
Change "CREATE TABLE ..." to "CREATE OR REPLACE TABLE ..."
See also the QSQGNDDL API:
https://www.ibm.com/docs/en/i/7.1?topic=ssw_ibm_i_71/apis/qsqgnddl.htm
and:
https://www.rpgpgm.com/2015/05/api-to-convert-files-to-sql.html
also:
https://www.mcpressonline.com/programming-other/cl/rtvsqlsrc
and:
https://www.itjungle.com/2002/06/05/mgo060502-story01/
This approach allows you to create SQL TABLEs with the same record format names and column names as the original DDS-defined physical file, so the HLL applications just continue to use the same fieldnames, etc.
Just saying ... 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.
As an Amazon Associate we earn from qualifying purchases.