Informix knowledge needed
Posted in 1997
--openmail-part-003d798f-00000002 Content-Type: text/plain; charset=ISO-8859-1; name="Informix" Content-Transfer-Encoding: quoted-printable 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 = =2E.. DEFINE FIELD1 CHAR; LET FIELD1 =3D parameter; select * from FIELD1...; execute procedure test(customer) In my experience this not supported, but are there any workarounds ? 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. 3. One customer is asking following: Is it possible to do query with boolean like this: select 1 + (x=3D1) from my_table_containing_x_as_int.= 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. Are there some tricks? Thanks for your help in advance! Niraj niraj.sood@instru.fi --openmail-part-003d798f-00000002 Content-Type: application/rtf; name="Informix" Content-Transfer-Encoding: base64 {\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\froman Tms Rmn;}{\\f1\\froman Courier New;}}{\\colortbl\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue127;\\red0\\green127\\blue127;\\red0\\green127\\blue0;\\red127\\green0\\blue127;\\red127\\green0\\blue0;\\red127\\green127\\blue0;\\red127\\green127\\blue127;\\red192\\green192\\blue192}{\\info{\\creatim\\yr1997\\mo9\\dy29\\hr10\\min51\\sec8}{\\version1}{\\vern197985}}\\paperw11908\\paperh16833\\margl720\\margr2505\\margt1440\\margb1440\\deftab720\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 Hi everybody,}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 1. is it possible to do dynamic queries in stored procedures? I mean }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 that you could have you could make select clause so that field or table }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 name is an variable? }{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 Example }{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 ...}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 DEFINE FIELD1 CHAR;}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 LET FIELD1 = parameter;}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 select * from FIELD1...;}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 execute procedure test(customer)}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 In my experience this not supported, but are there any workarounds ?}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 2. Is it possible to execute LOAD-clause in stored procedure. The }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 manuals don't tell about it. I tried to compile sp with LOAD-clause but }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 I get syntax-errors.}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 3. One customer is asking following: Is it possible to do query with }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 boolean like this: select 1 + (x=1) from my_table_containing_x_as_int.}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 4. Has anybody created stored procedures in NT which are executing }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 system commands. I tried to do without success. Informix compiles the sp }\\ql{\\f1\\fs20\\cf0\\up0\\dn0 but during execution it fails. I'm running sp as Informix-user.}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 Are there some tricks?}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 Thanks for your help in advance!}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 Niraj}{\\par}\\pard\\ql\\li0\\fi0\\ri28{\\f1\\fs20\\cf0\\up0\\dn0 niraj.sood@instru.fi}{\\par}\\pard\\ql\\li0\\fi0\\ri28} --openmail-part-003d798f-00000002--