Re: HELP! Dynamic SQL statements in SPL???
Posted in 1998
Gareth Edwards wrote: > I'm using IUS 9.14 with the web datablade in a web application that > requires a mail to be sent. The contents of the mail are dependant > on user selection, and the body is stored in a LVARCHAR. > So, on submitting the form, the data is instered into the DB, and > an external PERL script mails the recipient. > Here's the problem, the PERL script uses DBI, which doesn't support > LVARCHARs. I'm working on that at the moment -- in fact, I think I have LVARCHAR working OK, and that should be the key to most of the other arcane IUS (OK, let's be PC and call it IDS/UDO) types, not to mention user- defined types. > As I have a few scripts that need ot extract LVARCHAR I > figured I'd write a SPL procedure which can be passed a column name, > table name, and a 'where' clause. which will be used to build the > SQL statement. > This doen't work. So true -- it's a FAQ: no, you cannot do dynamic SQL in SPL. Period. > I can get the 'synamic' SQL statement built in a > variable, but I can't find any way to execute it. > > Can anyone help me here? How urgent is your need. You could have my un-QA'd version of DBD::Informix with LVARCHAR support in it tomorrow -- fix the bugs you find for yourself and tell me what you did, why you did it, and send a test which shows the problem and that the fix fixes it. Or you can wait for a few weeks (2-3 weeks) for an official version. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>