home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv7.zip
/
vac22os2
/
ibmcobol
/
macros
/
iwzasql.bnd
(
.txt
)
< prev
next >
Wrap
DB2 Bind
|
1998-02-18
|
15KB
|
239 lines
BIND V02
IWZASQL DAPvTSCODA 0
DA
INCLUDE SQLCA
INCLUDE SQLDA
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE S1 FROM :buf
DECLARE C1 CURSOR FOR S1
OPEN C1 USING :parm_var, :parm_var2, :parm_var3
FETCH C1 INTO :table_name, :creator_name, :type_name
WHENEVER SQLERROR CONTINUE
CLOSE C1
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE RS1 FROM :rbuf
DECLARE RC1 CURSOR FOR RS1
OPEN RC1
OPEN RC1 USING :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
OPEN RC1 USING :rparm_table
OPEN RC1 USING :rparm_table, :rparm_table2, :rparm_table3, :rparm_table4, :rparm_table5, :rparm_table6, :rparm_table7, :rparm_table8, :rparm_table9, :rparm_table10
OPEN RC1 USING :rparm_table, :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
OPEN RC1 USING :rparm_table, :rparm_table2, :rparm_table3, :rparm_table4, :rparm_table5, :rparm_table6, :rparm_table7, :rparm_table8, :rparm_table9, :rparm_table10, :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10, :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10, :rparm_table
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10, :rparm_table, :rparm_table2, :rparm_table3, :rparm_table4, :rparm_table5, :rparm_table6, :rparm_table7, :rparm_table8, :rparm_table9, :rparm_table10
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10, :rparm_table, :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
OPEN RC1 USING :rparm_creator, :rparm_creator2, :rparm_creator3, :rparm_creator4, :rparm_creator5, :rparm_creator6, :rparm_creator7, :rparm_creator8, :rparm_creator9, :rparm_creator10, :rparm_table, :rparm_table2, :rparm_table3, :rparm_table4, :rparm_table5, :rparm_table6, :rparm_table7, :rparm_table8, :rparm_table9, :rparm_table10, :rparm_tsname, :rparm_tsname2, :rparm_tsname3, :rparm_tsname4, :rparm_tsname5, :rparm_tsname6, :rparm_tsname7, :rparm_tsname8, :rparm_tsname9, :rparm_tsname10
FETCH RC1 INTO :rtable_name, :rcreator_name, :rtsname_name, :rtype_name
WHENEVER SQLERROR CONTINUE
CLOSE RC1
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE VS1 FROM :vbuf
DECLARE VC1 CURSOR FOR VS1
OPEN VC1 USING :vparm_var, :vparm_var2
FETCH VC1 INTO :view_name, :vcreator_name
WHENEVER SQLERROR CONTINUE
CLOSE VC1
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE RVS1 FROM :rvbuf
DECLARE RVC1 CURSOR FOR RVS1
OPEN RC1 USING :rvparm_var
FETCH RC1 INTO :rview_name, :rvcreator_name
WHENEVER SQLERROR CONTINUE
CLOSE RVC1
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE STAB FROM :fkbuf
DECLARE FKCUR CURSOR FOR STAB
OPEN FKCUR USING :tabparm
FETCH FKCUR INTO :rel_name, :ref_tbName, :col_count, :fk_colName, :pk_colName
WHENEVER SQLERROR CONTINUE
CLOSE FKCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE RSTAB FROM :rfkbuf
DECLARE RFKCUR CURSOR FOR RSTAB
OPEN RFKCUR USING :rtabparm, :rtabparm, :rdbparm, :rdbparm
FETCH RFKCUR INTO :rrel_name, :rref_tbName, :rcol_count, :rfk_colName
WHENEVER SQLERROR CONTINUE
CLOSE RFKCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE PSTAB FROM :pkbuf
DECLARE PKCUR CURSOR FOR PSTAB
OPEN PKCUR USING :ptabparm
FETCH PKCUR INTO :ppk_colName
WHENEVER SQLERROR CONTINUE
CLOSE PKCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE RPSTAB FROM :rpkbuf
DECLARE RPKCUR CURSOR FOR RPSTAB
OPEN RPKCUR USING :rpdbparm, :rptabparm
FETCH RPKCUR INTO :rppk_colName
WHENEVER SQLERROR CONTINUE
CLOSE RPKCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE SCOL FROM :colbuf
DECLARE SCUR CURSOR FOR SCOL
OPEN SCUR USING :colparm
FETCH SCUR INTO :sName, :sType, :sNull, :sLen, :sScale, :sSeq:sSeq_ind
WHENEVER SQLERROR CONTINUE
CLOSE SCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE RSCOL FROM :rcolbuf
DECLARE RSCUR CURSOR FOR RSCOL
OPEN RSCUR USING :rtable, :rtable, :rtsname, :rcreator
FETCH RSCUR INTO :rsName, :rsType, :rsNull, :rsLen, :rsScale, :rsSeq:rsSeq_ind
WHENEVER SQLERROR CONTINUE
CLOSE RSCUR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER SQLERROR GO TO ext
EXECUTE IMMEDIATE :hostvar
WHENEVER SQLERROR CONTINUE
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER SQLERROR GO TO ext
PREPARE STMT1_NAME FROM :stmt1_str
DECLARE DYN_CURSOR CURSOR FOR STMT1_NAME
DESCRIBE STMT1_NAME INTO :minsqlda
DESCRIBE STMT1_NAME INTO :fulsqlda
OPEN DYN_CURSOR
FETCH DYN_CURSOR USING DESCRIPTOR :fulsqlda
CLOSE DYN_CURSOR
WHENEVER SQLERROR CONTINUE
CLOSE DYN_CURSOR
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO ext
WHENEVER SQLERROR GO TO error
PREPARE STMT2_NAME FROM :stmt2_str
DECLARE DYN_CURSOR2 CURSOR FOR STMT2_NAME
DESCRIBE STMT2_NAME INTO :minsqlda
DESCRIBE STMT2_NAME INTO :fulsqlda
OPEN DYN_CURSOR2
FETCH DYN_CURSOR2 USING DESCRIPTOR :fulsqlda
WHENEVER SQLERROR CONTINUE
CLOSE DYN_CURSOR2
table_name
creator_name
type_name
parm_var
parm_var2
parm_var3
rtable_name
rcreator_name
rtsname_name
rtype_name
rparm_creator
rparm_creator2
rparm_creator3
rparm_creator4
rparm_creator5
rparm_creator6
rparm_creator7
rparm_creator8
rparm_creator9
rparm_creator10
rparm_table
rparm_table2
rparm_table3
rparm_table4
rparm_table5
rparm_table6
rparm_table7
rparm_table8
rparm_table9
rparm_table10
rparm_tsname
rparm_tsname2
rparm_tsname3
rparm_tsname4
rparm_tsname5
rparm_tsname6
rparm_tsname7
rparm_tsname8
rparm_tsname9
rparm_tsname10
view_name
vcreator_name
vparm_var
vparm_var2
rview_name
rvcreator_name
rvbuf
rvparm_var
rel_name
ref_tbName
fk_colName
pk_colName
col_count
fkbuf
tabparm
rrel_name
rref_tbName
rfk_colName
rpk_colName
rcol_count
rfkbuf
rtabparm
rdbparm
ppk_colName
pkbuf
ptabparm
rppk_colName
rpkbuf
rptabparm
rpdbparm
sName
sType
sNull
sScale
sSeq_ind
colbuf
colparm
rsName
rsType
rsNull
rsLen
rsScale
rsSeq
rsSeq_ind
rcolbuf
rcolparm
rdbname
rcreator
rtable
rtsname
hostvar
stmt1_str
stmt2_str