Hi,
On "DB2 v8.1 fp2 for Windows 2000" I would like to execute SQL statements from DB2 Command Window with parameter 'my_table_name'?
Sample
script_name my_table_name
Old fashion way
Now I have to open SQL file, change 'my_table_name' to table name and then execute it at DB2 Command Window. To do all this tasks over and over is very time consuming. Is it any way to do this from Command Window? It can be with batch or without batch file. Just giving me some idea would be very usefull to me.
I have folowing SQL:
SELECT
SUBSTR(A.TBCREATOR,1,20) AS TABSCHEMA,
SUBSTR(A.TBNAME,1,20) AS TABNAME,
SUBSTR(A.COLNAME,1,20) AS COLNAME,
SUBSTR(A.CONSTNAME,1,18) AS CONSTNAME
FROM
SYSIBM.SYSKEYCOLUSE A,
SYSIBM.SYSTABCONST B
WHERE
A.CONSTNAME = B.NAME
AND B.CONSTRAINTYP='P'
AND A.TBCREATOR = 'my_table_name'
Thanks,
Grofaty