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



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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.