Re: What's wrong with this program?
Posted in 1996
> informix@asl3.asl-labs.bc.ca (Informix Sysadmin) writes:
>
> As the subject says....
>
> {upstats.4gl}
> main
> database dirdb
> update statistics high for table>
> database snsdb
> update statistics high for table>
.. snip of further databases...
> end main
> From this, and the flow diagram on pg 1-503, I read that the above
> statements are completely legit, however, the compiler refuses to compile
> this program :(
>
> Is this not allowed in 4gl? MUST it be esqlc? Help!
If it won't compile the following should:
main
define p_statement char(100)
let p_statement = "update statistics high for table"
database dirdb
prepare s_updsdirdb from p_statement
execute s_updsdirdb
database snsdb
prepare s_updssnsdb from p_statement
execute s_updssnsdb
... and so on for the other databases ...
end main
Sql statements that the 4GL compiler doesn't understand as inline code can
usually be prepared and executed instead. (If it's a select or something else
that returns data you need to use open and fetch or a foreach loop instead of
execute.)
Nils.Myklebust@ccmail.telemax.no
NM Data AS, Postbox 9090, Gronland, N-0133 Oslo, Norway
My opinions are those of my company