Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Igor asked how to pass a file name chosen at run time to the ESQL/C example $create procedure from "file_name", since argv[1] was not accepted. Christian Brauer suggested a variable (untested, I4GL style). Jonathan Leffler gave an ESQL/C version: declare a host variable char *filename = argv[1] and use $create procedure from $filename. Christian admitted his syntax mixed languages.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Igor — — source: Informix-list mailing list archive (1991-1998)
Hi All
I got some program fromInformix Guide to SQL
#include <stdio.h>
#include <string.h>
$include sqlca;
$include sqlda;
$include datetime;
main()
{
$database cl_default;
$create procedure from "file_name" ;
}
Is it possible to change "file_name" .I tried to put argv[1] with
some other file name but it doesn't accept it.may be there is some
way to do it.
Thank you
Regards
Igor
↪ replying to Igor
Christian Brauer — — source: Informix-list mailing list archive (1991-1998)
What about that (not tested, but said in the manual)
define filename char(128)
$database cl_default;
let filename = arg_val[1]
$create procedure from filename;
Hth,
Chris
↪ replying to Christian Brauer
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
Christian Brauer wrote:
>
> What about that (not tested, but said in the manual)
>
> define filename char(128)
>
> $database cl_default;
> let filename = arg_val[1]
> $create procedure from filename;
An interesting hybrid of I4GL and ESQL/C.
int main(int argc, char **argv)
{
$ char *filename = argv[1];
if (argc != 2)
{
fprintf(stderr, "Usage: %s filename\\n", argv[0]);
return(1);
}
$ whenever error stop;
$ database c1_default;
$ create procedure from $filename;
return(0);
}
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
↪ replying to Jonathan Leffler
Christian Brauer — — source: Informix-list mailing list archive (1991-1998)
> An interesting hybrid of I4GL and ESQL/C.
Puhh, I think I forgot to use Java and Assembler
in that little proggy... gosh that week was far to busy
for mee.
Never mind, new tries this week
Chris, the clown
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.