Re: trigger/procedure with single quote in string
Posted in 1996
You need a command which allows you to detect blanks in arguments;
the command I use as standard is al (code follows). The following
SP demonstrates that it works -- and that you can get spaces into
the arguments of a command. You'll need to fix the path name to
the al command.
CREATE PROCEDURE test()SYSTEM '/work/johnl/bin/al ''blank separated'' >/dev/console';
SYSTEM "/work/johnl/bin/al 'blank separated' >/dev/console";
END PROCEDURE;
EXECUTE PROCEDURE test();
/* al.c -- list arguments one per line */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
while (*++argv)
puts(*argv);
return(EXIT_SUCCESS);
}
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
>From: hrubin@nyx10.cs.du.edu (Howard Rubin)
>Date: 24 Sep 1996 14:47:11 -0600
>X-Informix-List-Id: <news.28419>
>
>I am writing a procedure that must write command line arguments
>to a C program via a 'system' call. A space in the string has the result
>of making the argv list have another member. putting single quotes around
>the string could fix this problem, however, Informix SQL doesn't support
>adding a single quote to a string as far as I can tell. Is there a way to
>get a single quote in a string ?
>tia.
>
>please reply to joc@disc.com