home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
IMPEXP.ZIP
/
TBLIMPO.CMD
< prev
Wrap
OS/2 REXX Batch file
|
1991-06-19
|
3KB
|
77 lines
/* ********************************************************************** */
/* TBLIMPO version 1.0 - Import TABLES - 6/19/91 */
/* ********************************************************************** */
/* ********************************************************************** */
Trace 'o'
rcx = Rxfuncquery('SQLDBS')
If rcx <> 0 then
rcy = Rxfuncadd('SQLDBS','SQLAR','SQLDBS')
rcx = Rxfuncquery('SQLEXEC')
If rcx <> 0 then
rcy = Rxfuncadd('SQLEXEC','SQLAR','SQLEXEC')
Say "TBLIMPO.CMD - version 1.0 - 6/19/91"
sample_rc = 0
call SQLDBS 'START DATABASE MANAGER'
if result<>0 then signal ERROR
if (SQLCA.SQLCODE <> -1026 & SQLCA.SQLCODE <> 0)
then signal ERROR
FLTMOD = "FORCEIN"
Do forever
Say ""
Say "Please enter the database name to receive the tables or"
Say "Press Enter to exit."
Pull db1
if db1="" then leave
else do forever
Say "Enter name of IXF file that contains the exported table or"
Say "Press Enter to select another database."
Pull ixfname
If ixfname = '' then leave
Say "Enter table name or"
Say "Press Enter to select another database."
Pull tblname
If tblname = '' then leave
Else do
say "Importing from" ixfname " to table " tblname "....."
crea=1
call SQLDBS 'IMPORT TO' db1 'FROM' ixfname 'OF IXF MODIFIED BY :FLTMOD CREATE INTO ' tblname ' MESSAGES TBLIMPO.LOG'
if SQLCA.SQLCODE=-3305 Then Do
call SQLDBS 'IMPORT TO' db1 'FROM' ixfname 'OF IXF MODIFIED BY :FLTMOD INSERT INTO ' TBLNAME ' MESSAGES TBLIMPO.LOG'
crea=0
end
if SQLCA.SQLCODE=3107 Then Do
say "Import errors are logged in 'TBLIMPO.LOG'"
say "Do you want to see them now? Y or N"
Pull ans
If ans='Y' then 'TYPE TBLIMPO.LOG'
end
else if SQLCA.SQLCODE <> 0 then signal ERROR
if crea=1 then do
say "**************************************"
say "TABLE " TBLNAME " has been created."
say "**************************************"
say ""
end
end
end
end
result=0
signal FINISH
ERROR: result = SQLCA.SQLCODE
say "return code:" result
say SQLMSG
exit result
FINISH: say 'TBLIMPO finished and result =' result
exit result
rcy = Rxfuncdrop('SQLDBS')
If rcy <> 0 Then
Say "RXfuncdrop SQLDBS rc =" rcy
rcy = Rxfuncdrop('SQLEXEC')
If rcy <> 0 Then
Say "RXfuncdrop SQLEXEC rc =" rcy