Re: New to Informix, asking for help on running the 'system' command on windows
Posted in 2008
\
Christian Knappke wrote:
> >From the keyboard of gerrit.schutte@gmail.com:
>
>
>> All -
>>
>> I have installed Informix 11.50 DB on my Windows XP box. When
>> running the 'system' via the 'dbaccess' command such as in:
>>
>>
>> create procedure test_procedure()>> define command varchar(255);
>> let command = 'dir > c:\\tmp\\text.txt';
>> system command;
>> end procedure;
>> grant execute on procedure test_procedure() to 'public'; execute>> procedure test_procedure();
>>
>> I receive the following error message:
>>
>> 668: The system command cannot be executed or it exited with a>> non- zero status
>> 2: No such file or directory
>>
>> What is it that I do wrong? Any help very appreciated.
>>
>
> Errno 2 tells you that the system did not find the program 'dir'.
> It is an internal command of the command processor cmd.exe. Change
> your procedure in the following way:
>
> let command = 'cmd.exe /c dir > c:\\tmp\\text.txt';
>
>
Whoops. How embarrassing. :os
--
Cheers,
Obnoxio the Clown
http://obotheclown.blogspot.com