RE: SPL problem



Art:

I don't know if this will work, but this is what I've discovered about
passing VBA and .NET stuff for the last year.

In VBA and .NET, I've noticed that when I build the variable load for an sql
to run, mainly for other than INFORMIX engines, I have to use this syntax:

varSQLstr = " SELECT * FROM tabname WHERE column_name = 'ExampleData' ;"

VBA translates the single quote (') in the double quoated string to a quote
mark. Then, in the destination code, you would do something like this:

/opt/informix/whateverpath/isql dbName ( varSQLstr )

Hope this helps.

SIDEBAR: VBA and .NET - Talk about culture shock...

Rob
-----Original Message-----
From: informix-list-bounces@xxxxxxxx [mailto:informix-list-bounces@xxxxxxxx]
On Behalf Of Art Kagel
Sent: Thursday, May 15, 2008 6:21 PM
To: informix-list@xxxxxxxx
Subject: SPL problem

Friends,

I wrote a set of SPL functions for a client for IDS v11.50UC1 on Linux
2.6.18 using dynamic SQL - a very cool feature even with the one bug I've
already reported but I'll post about that separately once I have a bug # for
you all. Here's my problem:

There is one function that builds SQL from user parameters and stores it in
a table and another that fetches the SQL string from the table, executes it,
and returns the data. When I run the generated SQL string manually in
dbaccess it works. When I call the execute function from dbaccess either as
myself or as the client's web user it works, however, when the client's
application connects remotely from a PC via .NET and executes the function
the query fails. Turning trace on in the execute function I see that for
the .NET connection there was a -217 error (unknown column or local
variable) from the cursor OPEN. Looking at the OPEN I notice that in this
user's trace file all of the literal strings in filters have had their
quotes stripped from them, though they were there in the original SQL string
and are shown in the version of the statement shown for the PREPARE
statement. So things like '...AND table.column = "astring" ...' become
'...AND table.column = astring ...' and the engine is complaining that
column 'astring' does not exist.

Anyone seen this before? Could it be a locale problem? I'm trying to
change the build function to generate the SQL with single quotes instead of
double quotes, but the client has gone home and won't test that workaround
attempt tonight. I'd like an answer when they get back in the AM instead
of waiting for them to try it and hope it doesn't fail.

Can anyone help an old furry faced coder?

Art S. Kagel
Oninit



.



Relevant Pages

  • Re: Update existing values incrementally w/UPDATE SQL
    ... and in the book; Access 2007 VBA Programmer's Reference. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... pretend that Me.txtString is a control on your form, ... You cant put Me.txtString inside the double quotes, or VBA just reads it as a ... and in the book; Access 2007 VBA Programmer's Reference. ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • RE: SQL syntax in VBA for Access
    ... Turns out that the quotes around my dashes are what ... > is with the quotes in the SQL string. ... I'm trying to use vba to ... >> not getting the proper format. ...
    (microsoft.public.excel.programming)
  • Re: SPL problem
    ... using dynamic SQL - a very cool feature even with the one bug I've ... a table and another that fetches the SQL string from the table, executes it, ... When I call the execute function from dbaccess either as ... quotes stripped from them, though they were there in the original SQL string ...
    (comp.databases.informix)
  • Re: SQL ODBC Connection
    ... with VBA? ... I have tried a few times to manipulate the SQL string but it seems ...
    (microsoft.public.excel.programming)

Loading