Stored Procs on NT IDS 7.31.TC5
Posted in 2000
Topics: Stored Procedures & SPL, Security, Permissions & Auditing, Triggers, Constraints & Referential Integrity, Versions, Editions & End-of-Life
IDS 7.31.TC5 NT 4.0 SP5
I'm having problems in getting a stored procedure and trigger to execute
properly within the NT environment. Can anyone help ???
I've followed all the Advanced User settings within the User profiles and
ensured that user etdevsmk is the owner of the database, stored proc and
trigger and table as well (just in case)
TIA
Sean.
Here's the stored Proc & trigger
==============================
CREATE PROCEDURE p_alarm_log()
SYSTEM "NET SEND etdevsmk This is a test";END PROCEDURE;
CREATE TRIGGER t_alarm_log
INSERT ON alarm_log
FOR EACH ROW(EXECUTE PROCEDURE p_alarm_log);
==============================
I'm getting this error when I run the "INSERT INTO alarm_file" script:-
668: System command can not be executed
1: Not owner
and in the message log file I'm getting:-
18:17:09 System() command "NET SEND etdevsmk This is a test"in stored procedure cannot be executed because user "etdevsmk" did not
connect
with a password.
Sean Kelsey (chilliinc@hotmail.com) wrote: : Here's the stored Proc & trigger : ============================== : CREATE PROCEDURE p_alarm_log() : SYSTEM "NET SEND etdevsmk This is a test"; : END PROCEDURE; No system calls allowed on NT. : CREATE TRIGGER t_alarm_log : INSERT ON alarm_log : FOR EACH ROW(EXECUTE PROCEDURE p_alarm_log); : ============================== : I'm getting this error when I run the "INSERT INTO alarm_file" script:- : 668: System command can not be executed : 1: Not owner This is a known problem with SYSTEM command in SPL (on NT). I have not heard of a fix for this, if one exists, please post it (or versions needed...). -- Rob Wilson rwilson@ntsource.com
Sorted....
It would appear that we have to do a number of things:-
System Commands In Stored Procedures
------------------------------------
To execute system commands in stored procedures, logon to the
database server with your password.
This basically means that you have to connect to the database server using
an ODBC conection which you have to explicitly provide a password. IDS won't
be able to execute the SYSTEM command if you run it locally and simply
connect to the database through usual channels (i.e.
dbaccess/Database/Select)
If you have not explicitly
connected to the database server with a valid username and password,
the error returned is -668. This error occurs for both DB-Access and
ESQL/C applications.
The "informix" user must have the following Advanced User Rights:
* Act as part of the operating system
* Increase quotas
* Replace a process level token
System commands should contain the absolute path of the script
or the executable that needs to be executed; for example:
system "c:\\temp\\test.exe"
If you wish to redirect the output of the command to files, the
command
line should include the command shell; for example:
system "cmd.exe /C c:\\temp\\test.exe > c:\\temp\\stdout.out
c:\\temp\\stderr.out"
When you include cmd.exe in the system command, you must specify the
/C option. Without this option, the command shell will not exit,
which causes the database server to wait indefinitely.
The database server will wait for the outcome of the execution of a
system command. Pay close attention to system commands defined in
stored
procedures. The client application will hang if the system command
never
completes or never returns.
Hope this helps all those out there who have experienced the same
problems...
Sean
Rob Wilson <rwilson@ntsource.com> wrote in message
news:ubHj4.55$8J3.209@newsfeed.slurp.net...
> Sean Kelsey (chilliinc@hotmail.com) wrote:
>
> : Here's the stored Proc & trigger
>
> : ==============================
>
> : CREATE PROCEDURE p_alarm_log()
> : SYSTEM "NET SEND etdevsmk This is a test";
> : END PROCEDURE;
>
> No system calls allowed on NT.
>
> : CREATE TRIGGER t_alarm_log
> : INSERT ON alarm_log
> : FOR EACH ROW(EXECUTE PROCEDURE p_alarm_log);
>
> : ==============================
>
> : I'm getting this error when I run the "INSERT INTO alarm_file" script:-
>
>
> : 668: System command can not be executed
> : 1: Not owner
>
>
> This is a known problem with SYSTEM command in SPL (on NT). I have not
heard
> of a fix for this, if one exists, please post it (or versions
> needed...).
>
> --
> Rob Wilson
> rwilson@ntsource.com
>
Rob Wilson wrote: > No system calls allowed on NT. Wrong. Read Release Notes. > : 668: System command can not be executed > : 1: Not owne If you have not explicitly connected to the database server with a valid username and password, the error returned is -668. > This is a known problem with SYSTEM command in SPL (on NT). Wrong. No problem. > I have not heard > of a fix for this, if one exists, please post it (or versions > needed...). 7.3x for instance. > Rob Wilson > rwilson@ntsource.com Leonid Vorontsov Leonids.Voroncovs@dati.lv