How to return an error code to the shell from isql

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to return an error code to the shell from isql

Coughlin, Errick R

How can I get ISQL connecting to SQL Server to return a non 0 error code to the shell?

Thanks,

 

Errick




This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Nick Gorham-2
On 07/10/13 19:07, Coughlin, Errick R wrote:

How can I get ISQL connecting to SQL Server to return a non 0 error code to the shell?

Thanks,

 

Errick




This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Him

I would alter the code to exit on error. At the moment it just reports a error to the ouput and continues. Though you may be better looking at something like perl if you want to dome mor ethan simple testing with isql.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Coughlin, Errick R

How do you exit with an error code?  The only way I’ve been able exit out of isql is with “quit” Quit 1 doesn’t return 1 to the shell.

 

Errick Coughlin

Developer – ETL Group

Kroger IS&S Technology Enablement

BTC Grooms ES-283

Office: (513) 387-7576

Mobile: (513) 582-2973

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nick Gorham
Sent: Monday, October 07, 2013 2:38 PM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] How to return an error code to the shell from isql

 

On 07/10/13 19:07, Coughlin, Errick R wrote:

How can I get ISQL connecting to SQL Server to return a non 0 error code to the shell?

Thanks,

 

Errick

 



This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.



_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support

Him

I would alter the code to exit on error. At the moment it just reports a error to the ouput and continues. Though you may be better looking at something like perl if you want to dome mor ethan simple testing with isql.

--
Nick




This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Nick Gorham-2
On 07/10/13 19:55, Coughlin, Errick R wrote:

How do you exit with an error code?  The only way I’ve been able exit out of isql is with “quit” Quit 1 doesn’t return 1 to the shell.


I mean modify the source and make it do what you want.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Coughlin, Errick R

That seems a bit extreme…

 

Errick

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nick Gorham
Sent: Monday, October 07, 2013 3:16 PM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] How to return an error code to the shell from isql

 

On 07/10/13 19:55, Coughlin, Errick R wrote:

How do you exit with an error code?  The only way I’ve been able exit out of isql is with “quit” Quit 1 doesn’t return 1 to the shell.


I mean modify the source and make it do what you want.

--
Nick




This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Nick Gorham-2
On 07/10/13 20:39, Coughlin, Errick R wrote:

That seems a bit extreme…


Why? That is one of the points of open source.

Either you alter the source, or I do, its just likely to happen sooner if you do it.

Remember isql is just a simple test app, not originally intended for production use.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Coughlin, Errick R
In reply to this post by Nick Gorham-2

Something strange I’ve noticed about the isql command, the output when errors occur don’t seem to go to standard error or standard out, is isql using a custom file descripter when errors occur? I would like to redirect [ISQL]ERROR: Could not SQLExecute to a file when I execute isql.

Thanks,

 

Errick Coughlin

Developer – ETL Group

Kroger IS&S Technology Enablement

BTC Grooms ES-283

Office: (513) 387-7576

Mobile: (513) 582-2973

 

From: Coughlin, Errick R
Sent: Monday, October 07, 2013 3:39 PM
To: Support for the unixODBC project
Subject: RE: [unixODBC-support] How to return an error code to the shell from isql

 

That seems a bit extreme…

 

Errick

From: [hidden email] [[hidden email]] On Behalf Of Nick Gorham
Sent: Monday, October 07, 2013 3:16 PM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] How to return an error code to the shell from isql

 

On 07/10/13 19:55, Coughlin, Errick R wrote:

How do you exit with an error code?  The only way I’ve been able exit out of isql is with “quit” Quit 1 doesn’t return 1 to the shell.


I mean modify the source and make it do what you want.

--
Nick




This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to return an error code to the shell from isql

Nick Gorham-2
On 14/11/13 22:28, Coughlin, Errick R wrote:

Something strange I’ve noticed about the isql command, the output when errors occur don’t seem to go to standard error or standard out, is isql using a custom file descripter when errors occur? I would like to redirect [ISQL]ERROR: Could not SQLExecute to a file when I execute isql.

Thanks,


Checking the source it just uses stderr.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Loading...