|
Luis Rodriguez wrote:
Yes, I had looked at that and maybe I dismissed it too quickly. The trick would be to grab the correct information so that I can determine, correctly, all the attributes of the column I want to duplicate. This syntax looks close:
Wouldn't the use of the SYSCOLUMNS view work for you? IIRC. it should have all the info you need...
SELECT
DATA_TYPE, LENGTH, NUMERIC_SCALE, IS_NULLABLE , HAS_DEFAULT
FROM syscolumns
WHERE table_name = #{table_name}
and column_name = #{column_name}
I'd have to evaluate the data_type to figure out which of the remaining variables would apply. Identity columns are particularly a challenge. Once that was done, I'd still have to construct the alter table statement to add the column. Tricky, but not impossible.
<<SNIP>>
If I could create a stored procedure that was only in SQL, that would be more portable since I could ship a CREATE PROCEDURE statement that would generate the procedure without needing to also restore RPG source and compile or need a save file with the RPG object in it. So SQL would be cleaner. I just can't figure out how to do everything in SQL so I may just have to bite the bullet and write it all in RPG.
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.