question n the system command in a procedure
Posted in 2016
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting
HP BL870c Integrity server running HPUX 11.31 and IDS 12.1 FC5 One of our developers came to me with a problem he is having with running a system command in a spl procedure. It seems since upgrading from IDS 11.7 to 12.1 the system command doesn't always seem to be working. As I understand it the procedure kicks off a script using the system command. This script then updates data in the database. The updates don't always happen. The code before and after the system statement can be verified as being done, the system statement however cannot be verified if even called. I know nothing about the system command, so I was unable to help him troubleshoot this problem. Does the system command return error codes? Or is there a way to trace the system command? Does anyone have any suggestion on how to troubleshoot? John David Adamski, Sr. Network Specialist Graceland University, 1 University Place, Lamoni, IA 50140 adamski@graceland.edu 641.784.5267
It returns error codes if the script/command raise any error code. But this error reporting is rather limmited. If the system is invoking a script, you chould include tracing in the script.... a "touch /tmp/runthis" is just an example. I don't think the Informix version should matter in this case. Regards On Fri, Jan 15, 2016 at 12:24 PM, John Adamski (Work Account) < adamski@graceland.edu> wrote: > HP BL870c Integrity server running HPUX 11.31 and IDS 12.1 FC5 > > One of our developers came to me with a problem he is having with running a > system command in a spl procedure. > > It seems since upgrading from IDS 11.7 to 12.1 the system command doesn't > always seem to be working. As I understand it the procedure kicks off a > script > using the system command. This script then updates data in the database. > The > updates don't always happen. The code before and after the system statement > can be verified as being done, the system statement however cannot be > verified > if even called. > > I know nothing about the system command, so I was unable to help him > troubleshoot this problem. > > Does the system command return error codes? Or is there a way to trace the > system command? Does anyone have any suggestion on how to troubleshoot? > > John David Adamski, Sr. Network Specialist > Graceland University, 1 University Place, Lamoni, IA 50140 > adamski@graceland.edu > 641.784.5267 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --001a11c3b8f252379105295ea540
John: From the Guide to SQL Syntax Manual: The command that SYSTEM specifies cannot run in the background. The database server waits for the operating system to complete execution of the command before it continues to the next statement in the SPL routine. The SPL routine cannot use any returned values from the command. If the operating-system command fails (that is, returns a nonzero status for the command), an exception is raised that contains the returned operating-system status as the ISAM error code and an appropriate SQL error code. The only way that I know of to debug a SYSTEM command involves a) tracing the procedure (see SET DEBUG FILE TO & TRACE ON) so you can tell whether the SYSTEM command was actually executed by the engine, and b) place trace output in the script that SYSTEM is executing so you can tell whether the script was actually executed by the SYSTEM command. Art Art S. Kagel, President and Principal Consultant ASK Database Management www.askdbmgt.com Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jan 15, 2016 at 7:24 AM, John Adamski (Work Account) < adamski@graceland.edu> wrote: > HP BL870c Integrity server running HPUX 11.31 and IDS 12.1 FC5 > > One of our developers came to me with a problem he is having with running a > system command in a spl procedure. > > It seems since upgrading from IDS 11.7 to 12.1 the system command doesn't > always seem to be working. As I understand it the procedure kicks off a > script > using the system command. This script then updates data in the database. > The > updates don't always happen. The code before and after the system statement > can be verified as being done, the system statement however cannot be > verified > if even called. > > I know nothing about the system command, so I was unable to help him > troubleshoot this problem. > > Does the system command return error codes? Or is there a way to trace the > system command? Does anyone have any suggestion on how to troubleshoot? > > John David Adamski, Sr. Network Specialist > Graceland University, 1 University Place, Lamoni, IA 50140 > adamski@graceland.edu > 641.784.5267 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a1141c1e07af9b705295eabe7
I had problems years ago with the SYSTEM command and pretty much gave up on it. It had to do with permissions. As I remember, the permissions to the script had to be 777 and also to the directory for the script to run. I went to a C UDR instead. Thank you, Jim Goldrick (573) 979-9079 jgoldrick@judsonu.edu Reminder: Judson University IT will never ask for your password or other personal information over email. Judson University | Elgin, IL 60123 | JudsonU.edu Committed to the Student, Spiritual Development and Excellence -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of John Adamski (Work Account) Sent: Friday, January 15, 2016 6:24 AM To: ids@iiug.org Subject: question n the system command in a procedure [36403] HP BL870c Integrity server running HPUX 11.31 and IDS 12.1 FC5 One of our developers came to me with a problem he is having with running a system command in a spl procedure. It seems since upgrading from IDS 11.7 to 12.1 the system command doesn't always seem to be working. As I understand it the procedure kicks off a script using the system command. This script then updates data in the database. The updates don't always happen. The code before and after the system statement can be verified as being done, the system statement however cannot be verified if even called. I know nothing about the system command, so I was unable to help him troubleshoot this problem. Does the system command return error codes? Or is there a way to trace the system command? Does anyone have any suggestion on how to troubleshoot? John David Adamski, Sr. Network Specialist Graceland University, 1 University Place, Lamoni, IA 50140 adamski@graceland.edu 641.784.5267 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.