I do use <@BIND> in plain old SQL within DirectDBMS precisely to get the same handling as I would in an Insert/Update Action.

I think you're running into the bug I reported on April 4:

Here's one I just ran into.

Do NOT quote parameters in the <@BIND> meta tag.

<@BIND NAME="text" SCOPE="user"> ==> [BoundVals] ["text"=' ']

but

<@BIND NAME=text SCOPE=user> ==> [BoundVals] [text='try now
';]

I'll file a bug report.



On Apr 20, 2006, at 11:36 AM, Matt Muro wrote:

Thanks for the suggestion, Bill. Though it doesn't appear that you can use
<@BIND> in a regular SQL statement.

We do use <@BIND> when we are calling an Oracle function or procedure from
a DirectDBMS action, but I can't get it to work in a plain ol' SQL
statement right in the DirectDBMS action. Not to mention the fact that
this would still require us to modify our code base, rather than simply ensuring that the witango.ini NOSQLENCODING is set to false, automatically
doubling our single quote characters (as the doco says).

Has anyone else using 5.5 found this non-doubling of quotes to be a
problem? Have you simply modified all your insert/update statments to
explicitly set "encoding=sql" on fields that could potentially contain a
hyphen?

Thanks,
Matt


[email protected] writes:
Sorry:

INSERT INTO users ( user_id, user_name, date) VALUES (<@VAR
name="user_id" scope="local">, <@BIND name="user_name"
scope="local">, sysdate)
On Apr 20, 2006, at 10:18 AM, William M Conlon wrote:

Have you tried (despite some bugs and limitations):

INSERT INTO users ( user_id, user_name, date) VALUES (<@VAR
name="user_id" scope="local">, '<@BIND name="user_name"
scope="local">', sysdate)


On Apr 20, 2006, at 9:23 AM, Matt Muro wrote:

I searched through the forum archives and saw some posts regarding
Witango
5.5 and SQL encoding in DirectDBMS actions. It sounds like people
WERE
able to get the noSQLEncoding=false setting in the 5.5 witango.ini to
automatically quote meta tag values. This doesn't seem to be
working for
me, requiring me to add "encoding=sql" to all meta tag variables
in my SQL
insert/update statements. Is this .ini setting fried in 5.5
(Win32) or am
I doing something wrong? Thank you.

We're using: Witango Application Server 5.5.009 Liquorice (Win32)
[Professional Edition]

This worked in 5.0:

[in witango.ini]   NOSQLENCODING=false

INSERT INTO users ( user_id, user_name, date)
VALUES (<@VAR name="user_id" scope="local">, '<@VAR name="user_name"
scope="local">', sysdate)

-- producing the extra single quote in the user's name, O'Malley (damn
Irish :)
INSERT INTO users ( user_id, user_name, date)
VALUES ( 1, 'O''Malley', sysdate)

In 5.5, I have to add encoding=sql to my meta tags even though I have
NOSQLENCODING=false set in the witango.ini

[in witango.ini]   NOSQLENCODING=false

INSERT INTO users ( user_id, user_name, date)
VALUES (<@VAR name="user_id" scope="local">, '<@VAR name="user_name"
scope="local" encoding="sql">', sysdate)

INSERT INTO users ( user_id, user_name, date)
VALUES ( 1, 'O''Malley', sysdate)



From the "Witango 5.5 Programmer's Guide" page 494 (510 in PDF).

noSQLEncoding
Valid in all scopes This configuration variable determines whether
text in
Direct DBMS actions is SQL-encoded by default (single quote
characters
doubled). The default value is false. Setting the value to true
turns off
automatic SQL-encoding in Direct DBMS actions. If noSQLEncoding is
set to
true, you can use the ENCODING=SQL attribute on most value-
returning meta
tags to SQL-encode the value returned by that meta tag.


From the "Witango 5.5 Programmer's Guide" page 73 (89 in PDF).
------------------------------------------------------------------- --
-------------------------------
The SQL encoding type converts the specified value by doubling all
occurrences of the single quote character. Witango Server
automatically
performs SQL encoding on meta tag values substituted in Direct
DBMS SQL,
except when the configuration variable noSQLEncoding is set to
true. The
SQL ENCODING attribute value is generally appropriate only when
noSQLEncoding is set to true, and allows you to toggle SQL
encoding on or
off for particular meta tags.


________________________________________________________
Matt Muro [EMAIL PROTECTED]
Harvard University                           phone:  617.998.8522
Division of Continuing Education       fax:      617.495.9176

___________________________________________________________________ __
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Bill

William M. Conlon, P.E., Ph.D.
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
   vox:  650.327.2175 (direct)
   fax:  650.329.8335
mobile:  650.906.9929
e-mail:  mailto:[EMAIL PROTECTED]
   web:  http://www.tothept.com

____________________________________________________________________ __
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Bill

William M. Conlon, P.E., Ph.D.
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
   vox:  650.327.2175 (direct)
   fax:  650.329.8335
mobile:  650.906.9929
e-mail:  mailto:[EMAIL PROTECTED]
   web:  http://www.tothept.com

_____________________________________________________________________ ___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf




________________________________________________________
Matt Muro                                      [EMAIL PROTECTED]
Harvard University                           phone:  617.998.8522
Division of Continuing Education       fax:      617.495.9176

______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Bill

William M. Conlon, P.E., Ph.D.
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
   vox:  650.327.2175 (direct)
   fax:  650.329.8335
mobile:  650.906.9929
e-mail:  mailto:[EMAIL PROTECTED]
   web:  http://www.tothept.com

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to