|
Looking at the documentation, it looks like DESCRIBE is used
for retrieving information about stored procedures, not
tables or columns.
At least all the examples seem to be using stored procedures.
Carel Teijgeler wrote:
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..
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?
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.