Dbload error trapping
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
This is a multi-part message in MIME format. ------=_NextPart_000_0105_01BEFA1B.9AE82A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi , In one of my ESQLC programs, I'm making use of DBLOAD to load a file = into a table.=20 After the DBLOAD, the program continues on. This is the case even if = there is an error in DBLOAD.=20 By error I mean any case like: load file not found, command file not found, long transaction aborted, error in load file line 5, etc Is there any way I can trap the failure of DBLOAD and stop the program = then and there, instead of allowing it to continue? thanks, George ------=_NextPart_000_0105_01BEFA1B.9AE82A40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi ,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>In one of my ESQLC programs, I'm making = use of=20 DBLOAD to load a file into a table. </FONT></DIV> <DIV><FONT face=3DArial size=3D2>After the DBLOAD, the program continues = on. This is=20 the case even if there is an error in DBLOAD. </FONT></DIV> <DIV><FONT face=3DArial size=3D2>By error I mean any case = like:</FONT></DIV> <DIV><FONT face=3DArial size=3D2>load file not found,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>command file not found,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>long transaction aborted,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>error in load file line 5,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>etc</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Is there any way I can trap the failure = of DBLOAD=20 and stop the program then and there, instead of allowing it to=20 continue?</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>George</FONT></DIV> <DIV> </DIV> <DIV> </DIV></BODY></HTML> ------=_NextPart_000_0105_01BEFA1B.9AE82A40--
george wrote: > In one of my ESQLC programs, I'm making use of DBLOAD to load a file > into a table. After the DBLOAD, the program continues on. > This is the case even if there is an error in DBLOAD. That's because you didn't make your program stop. Things like shells have to continue even if there are errors, of course. So do many programs, so that's the default. > By error I mean any case like: > load file not found, > command file not found, > long transaction aborted, > error in load file line 5, > etc > > Is there any way I can trap the failure of DBLOAD and stop the > program then and there, instead of allowing it to continue? You have to monitor the exit status of the program (DBLOAD) and then decide whether to continue. How you do that depends on how you run the program. Chances are you're using system() and the correct method is to look at the return value of the function. And don't post HTML! -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Related threads
- Conversion to differeent characters sets
- Problem in changing locale via dbexport/dbimport
- RE: openlink error "Unable to load locale categories"