Re: ESQL/C and EXECUTE PROCEDURE
Posted in 1998
On Mon, 5 Jan 1998, Thomas J. Girsch wrote: } Yup, it's plenty possible. Just add to the end of your example: } } $EXECUTE p_exe INTO desc USING $var, $var ... } } where $var's are your variables that go in place of the question marks. Sorry to rain on the parade, but... The question asked about 'input and output parameters'. Thomas' answer is absolutely correct for input parameters; it does not take into account the output parameters. AFAIK, if there are output parameters (return values would be a more precise term; Informix does not have output parameters in the way that Oracle does), then you have to use a cursor. You use the USING clause on the OPEN to supply the input parameters; you use the INTO clause on the FETCH to collect the returned values. If you know that the SP only returns a single row of data, you don't have to repeat the FETCH operation, of course. There might, conceivably, be some stunts you can pull with EXECUTE IMMEDIATE if you have a recent enough version of the servers and your stored procedure returns a single value, or a single set of values in a single return (no RETURN ... WITH RESUME). Wishing you a Happy New Year... Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h> } Petr Pomykacek wrote in message <01bd09a6$1915c480$c86855c1@pomyk>... } >Is posible in ESQL/C execute procedure dynamic with } >input and output parameters without using cursor. } > } >My example: } > } >$include sqlca; } >$include sqlda; } >main() } >{ } >struct sqlda *desc; } >$ char xx[1024]; } >$ database stores5; } >sprintf(xx,"EXECUTE PROCEDURE xx (?)"); } > } >/* What send value for input parametr ??*/ } > } >$ prepare p_exe from $xx; } > } >$ describe p_exe INTO desc; } >/*desc is output descriptor*/