dbTalk Databases Forums  

List of Unix return codes for bcp ver 10.0 ?

comp.databases.sybase comp.databases.sybase


Discuss List of Unix return codes for bcp ver 10.0 ? in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Brehony
 
Posts: n/a

Default List of Unix return codes for bcp ver 10.0 ? - 01-06-2004 , 09:43 AM






I am using bcp 10.0 on an IBM AIX Unix box. Yes it's an old system.
bcp/10.0.4/P/rs6000/AIX 3.2.5/4.1/1/Tue Aug 20 16:03:48 PDT 1996

I am looking for a list of the codes bcp returns to Unix. I have
checked on the various Sybase web sites and cannot find a reference to
these anywhere.

I'm assuming 0 for successful completion, and non-zero for specific
errors.

What about an operation that completes with a warning, would that give
a 0 return code?

Any pointers / advice would be appreciated, thanks!

Tom.

Reply With Quote
  #2  
Old   
Neal
 
Posts: n/a

Default Re: List of Unix return codes for bcp ver 10.0 ? - 01-06-2004 , 03:57 PM






Hello,

Sybase never created a list of return codes.

In general:
a) STDEXIT (0) successful execution of command.
/* Return code = 0 */
b) ERREXIT (-1) failure of execution of command (incorrect syntax,
etc.).
/* Return code = 255 */
c) Exit with a sybstatus, which is typically the return code from the
O/S. For example, if a file doesn't exist it will return a 2, which
is defined in the system header file /usr/include/sys/errno.h as:
Unable to open input file 't3.txt'.
return code: 2
#define ENOENT 2 /* No such file or directory */

or when trying to connect to an ASE that is down:

ct_connect(): network packet layer: internal net library error:
Net-Lib protocol driver call to connect two endpoints failed
Establishing connection failed.
return code: 146
#define ECONNREFUSED 146 /* Connection refused */

The exception is that there have been a few bugs:
224214 - bcp exit with 0 when attempting to insert duplicate rows into
table
with unique index.

212350 - bcp 11.x exits with a code of 255 instead of 0, upon server
errors.
The fix for 212350 had changed bcp to exit with 255 instead of 0 when
there are duplicate rows inserted to a table with unique index. This
was made to conform to 10.x behavior. However, this caused
regression for existing 11.x customers.

Version of OC/S with the problem:
---------------------------------
The problem is generic and occurs for 11.x OC/S EBF 9032-9293.

Engineering Solution:
---------------------
To allow both behavior to be supported, a new property CS_BEHAVIOR
has been introduced from Dec 2000 EBF onwards to allow customers to
revert to 10.x behavior. In this EBF, the bug fix for 212350 will
be removed so that 11.x behavior will be retained i.e. bcp will exit
with 255 when there are duplicate rows inserted to a table with unique
index.

To revert to 10.x behaviour, the new property should be set in the
ocs.cfg file as follows:

[DEFAULT]

[bcp]
CS_BEHAVIOR = CS_BEHAVIOR_100

Reply With Quote
  #3  
Old   
Brian Ceccarelli
 
Posts: n/a

Default Re: List of Unix return codes for bcp ver 10.0 ? - 01-06-2004 , 10:28 PM



DBPowerSuite has a program called "psBCP" which does return meaningful exit
codes. 0 = success. Everything else is an error. Interanlly, this
program is an Open Client program using the bulk copy API directly.

http://www.dbpowersuite.com






"Tom Brehony" <tomb (AT) lk (DOT) blackbird.ie> wrote

Quote:
I am using bcp 10.0 on an IBM AIX Unix box. Yes it's an old system.
bcp/10.0.4/P/rs6000/AIX 3.2.5/4.1/1/Tue Aug 20 16:03:48 PDT 1996

I am looking for a list of the codes bcp returns to Unix. I have
checked on the various Sybase web sites and cannot find a reference to
these anywhere.

I'm assuming 0 for successful completion, and non-zero for specific
errors.

What about an operation that completes with a warning, would that give
a 0 return code?

Any pointers / advice would be appreciated, thanks!

Tom.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.