Re: Informix knowledge needed
Posted in 1997
Sood_Niraj/SO@instru.fi wrote:
> Hi everybody,
>1. is it possible to do dynamic queries in stored procedures? I mean
>that you could have you could make select clause so that field or table
>name is an variable? =
>
> Example =
>
> DEFINE FIELD1 CHAR;
> LET FIELD1 = parameter;
> select * from FIELD1...;
> execute procedure test(customer)>
> In my experience this not supported, but are there any workarounds ?
Only ugly worarounds - like a loooong IF statement, hoping you have
covered all possible values. While sometimes necessary, this is lousy
programming technique and best avoided.
>2. Is it possible to execute LOAD-clause in stored procedure. The
>manuals don't tell about it. I tried to compile sp with LOAD-clause but
>I get syntax-errors.
The LOAD and UNLOAD commands are not true SQL; they are utility command
in dbaccess but are not known when you are down & dirty in SQL. Thus,
in an ESQL program, the LOAD command gets you a pie in the face. In any
language, if you try tp PREPARE a LOAD statement, you get more of the
same. Similarly, the LOAD statement in SPL is useless. In all cases,
the reason is the same: LOAD is not an SQL command.
>3. One customer is asking following: Is it possible to do query with
>boolean like this:
> select 1 + (x=3) from my_table_containing_x_as_int
Nope. As far as I know, Informix does not support a boolean type. I
don't know if anyone does or if there is a SQL-standard boolean type.
But this is based on a 7.1x version I am working with. Perhaps 7.2x does
allow it. Maybe there is a way to create it Universal Server. I still
don't know how the syntax could work to get past the basic parser.
>4. Has anybody created stored procedures in NT which are executing
>system commands. I tried to do without success. Informix compiles the
>sp but during execution it fails. I'm running sp as Informix-user.
I can't comment on the use of NT, since I don't have it in my shop.
However, in general I get antsy when folks run an application as user
informix. Even the DBA should not run apps, since it may violate
business rule separation of functions.
--
-- Jake (In pursuit of undomesticated semi-aquatic avians)
+---------------------------------------------------------------+
|Insofar as manifestations of functional deficiencies are agreed|
|by any and all concerned parties to be imperceivable, and are |
|so stipulated, it is incumbent upon said heretofore mentioned |
|parties to exercise the deferment of otherwise pertinent |
|maintenance procedures. |
+--------------------------------------- (www.hardyharhar.com) -+