× 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.



DESCRIBE may do the trick, I think you need the SQLDA for that, but is
according to me required in some aspects, as you want ageneric solution..

With regards,
Carel Teijgeler

*********** REPLY SEPARATOR ***********

On 16-12-2009 at 14:34 Pete Helgren wrote:

I have a Java application that uses JDBC to the DB2 for i database on my
i. It is using a RENAME COLUMN function that isn't yet supported by DB2
(someday....). In any case, since I can't change the application I'd
like to build a stored procedure to handle the function. I propose to
do something like:

"ALTER TABLE #{table_name} ADD COLUMN #{new_column_name}"
"Update #{table_name} set #{new_column_name} = #{column_name}"
"Alter table #{table_name} drop column #{column_name}"

The kicker is, in order for this to be generic and work, I have to
retrieve the attributes of the column I want to rename and copy and I
don't know how to do that. Does anybody have an SQL method for
retrieving attributes of a column so that they can be used to create a
column with the same attributes?

Thanks

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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-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.