×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Pete,

Wouldn't the use of the SYSCOLUMNS view work for you? IIRC. it should
have all the info you need...

HTH,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries



On Thu, Dec 17, 2009 at 11:14 AM, Pete Helgren <Pete@xxxxxxxxxx> wrote:
I am looking for an example of using an SQLDA with a DESCRIBE TABLE
function in an RPG program.  I found a few general examples of using an
SQLDA in RPG but nothing specific that would help me unpack the
complexities of the SQLDA.  The goal is to eventually package this into
a stored procedure that will mimic the RENAME COLUMN function that is
missing in DB2 for i.

Basically, I want to retrieve the column attribute information about a
specific column in a table and create a duplicate of that column with a
new name and then drop the old column name.  I can handle the column
drop and copy of the data but the creation of an exact duplicate of the
column is the difficult part.  The suggestion from Midrange-L was to use
an SQL DESCRIBE TABLE function and retrieve the info into an SQLDA.
Having never done that, I need an example to help me along.

I would love to do this only with SQL and without a stored procedure and
I came up with a hack to make it work but there are some potential
issues with the approach I have taken and so a stored procedure is
probably the best route to go.

Anyone have an example or a code snippet that would illuminate the basic
steps?

Thanks

Pete

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.