Re: [Sqlrelay-discussion] SQLRelay 0.35 + Perl API + DB2
Brought to you by:
mused
|
From: Lee S. <st...@st...> - 2008-03-27 00:18:43
|
Thanks David,
I worked that one out myself a couple of days after my first email.
The next snag I've run into is that I can't execute the same query more than once. It might be something that's fixed in a newer release (0.35 is the only one which will build on my system).
The error is:
Error: [IBM][CLI Driver] CLI0115E Invalid cursor state. SQLSTATE=24000
Any suggestions? :/
-----Original Message-----
From: sql...@li... [mailto:sql...@li...] On Behalf Of David Muse
Sent: Wednesday, 26 March 2008 23:24
To: Discussion of topics related to SQL Relay
Subject: Re: [Sqlrelay-discussion] SQLRelay 0.35 + Perl API + DB2
Ugg, it looks like the DBI driver for SQL Relay converts ?'s to :1's. I
suspect this is because back when the DBI driver was first written, SQL
Relay didn't support native binds and used the :1 format. It should
check the DB type and either leave the ?'s alone or convert to the
appropriate format like the PHP Pear DB driver does.
I think a quick fix would be to comment out line 135 of SQLRelay.pm:
Change:
$statement =~ s/\?/":" . ++$count/eg;
to:
# $statement =~ s/\?/":" . ++$count/eg;
That should have the effect of leaving ?'s alone. The rest should "just
work". Let me know how that goes though. It's possible that some other
code may need to be modified.
I'll put in a fix for this in the next release.
David Muse
dav...@fi...
On Thu, 2008-03-20 at 01:29 +0900, Lee Standen wrote:
> Hey Guys,
>
>
>
> I've been trying to get SQLRelay 0.35 working with DB2, and now that I
> finally got it to connect, I'm having trouble with the Perl API
> munging the SQL into an invalid format. Here's an example:
>
>
>
> Original SQL: SELECT oid FROM service WHERE oid=?
>
> Perl API Query: SELECT oid FROM service WHERE oid=:1
>
> Error: [IBM][CLI Driver][DB2/LINUX] SQL0312N The host variable "1" is
> used in a dynamic SQL statement, a view definition, or a trigger
> definition.
>
>
>
> This is just a simple query I've tried to replicate the issue, but it
> obviously happens with any.
>
>
>
> SQLRelay 0.35
>
> Client Version: 8.1.0.48 (Fixpak 5)
>
>
>
> Note: This works perfectly fine if I bypass the SQLRelay server and go
> direct to the database.
>
>
>
> So I have two quick questions:
>
> 1. Is this a known issue which has been fixed in a later version?
> (I'd try this, but newer versions won't build on my OS without serious
> hacky library updates)
>
> 2. If this is not fixed, is there a patch floating around I can
> apply to 0.35 to make this work?
>
>
>
> Thanks J
>
>
>
>
>
>
> __________________________________________________
> D O T E A S Y - "Join the web hosting revolution!"
> http://www.doteasy.com
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________ Sqlrelay-discussion mailing list Sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
__________________________________________________
D O T E A S Y - "Join the web hosting revolution!"
http://www.doteasy.com
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Sqlrelay-discussion mailing list
Sql...@li...
https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
|