On Mon, Feb 04, 2002 at 11:57:06PM -0800, Jonathan Leffler wrote:
> Tim Bunce wrote:
>
> > On Mon, Feb 04, 2002 at 04:00:35PM -0000, [EMAIL PROTECTED] wrote:
> > > It just looked to me like we were see-sawing.
> >
> > FYI the mediumterm plan is for the DBI's new preparse code to be
> > used by all the drivers to provide this kind of functionality
> > (via a perl code and/or a pointer to a C function).
>
> DBD::Informix did use it once (back in the very old days).
This is a completely new and fully parameterized version.
> Neither colon-prefixed pseudo-placeholder notation can be used safely in
> Informix.
That's fine. DBD::Informix simply won't set the flag to say it can accept it.
> Add variant comment conventions into the mix (and things like optimizer
> hints that aren't comments
> but look like comments), and you get real hell to play with. Especially
> since Informix now has some things that superficially look like comments
> but which, by virtue of the context they are in, are not comments after
> all:
>
> INSERT INTO somedb:{comment}table
> VALUES{}({comment}SET{{comment}1{},{}2{}}OF{}INT{}){};
>
> Given that braces enclose comments (but, for example, C-style comments
> are just a syntax error), it is immediately obvious that SET (and
> MULTISET and LIST) followed by braces does not mark a comment after all,
> but a constructor for a SET of INT. Of course, you can use the SQL
> standard --to-end-of-line comment style between the SET and the opening
> brace of the constructor. Ugh! You really do not want to mess with
> this -- I sure as hell don't either, but I'm stuck with it. I have to
> damn well pre-parse the SQL since I can't get a decent count of the
> input parameters back from Informix.
I'd appreciate it if, at some point, you could look at the evolving
preparse() code in DBI.xs and see how it can be extended to cover
your needs. Don't rush though as preparse() is currently a fairly
slowly moving target and has a way to go yet before it's ready for
drivers to use.
> Just a heads up; you may find that some other database drivers will have
> an equally hard time using any standard version of preparse() -- though
> I doubt if any others are as bad as Informix.
I think you're probably right :)
Tim.