Single Quote Preservation

View: New views
5 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Parent Message unknown Re: Single Quote Preservation

by Andrew Scott-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's the thing, the error messaged changed for example.

#PresserSingleQuotes(String)#

Produced an error on the single quote and the s Where

'#PreserveSingleQuotes(String)#'

Produced unknown column and as I have updated the drivers I am not going to
be able to repeat this.

Now here is the kicker...

<cfqueryparam ..... >

Produced the same result has '#PreserveSingleQuotes(String)#'

And this

Values ('God's Kitchen 05')

Produced the same error as #PresserSingleQuotes(String)#

Now that I have updated the Macromedia Drivers all the above now work
correctly except for the reason I ran into this problem in the first place
still exists, and has been logged as a bug against MM.

It appears that if a java webservice returns a structured array, this line
of code will not work.

Values ( '#Array[1].getStringValue()#') nor will
'#PreserveSingleQuotes(SQLString)#' nor will <cfqueryparam ....>

However updating the drivers at least allowed me to save the query into a
variable and do this

<cfquery>
  #PreserveSingleQuotes(SQLString)#
</cfquery>

Now as I stated I wrote, and rewrote this code in many ways to find out why
this would not work. And all the code written now works with the latest
drivers.

Now the documentation to CF says that by default Single Quotes are preserved
in a query, so that means this should have worked but it didn't.

<cfset test = "God's Kitchen 05" />
<cfquery>
  Insert into table ( fieldname) values ( '#test#' )
</cfquery>

But it didn't so the next step was to try this.

<cfset test = "God's Kitchen 05" />
<cfsavecontent variable="Andrew">
  Insert into table ( fieldname) values ( '#test#' )
</cfsavecontent>
<cfquery>
  #PreserveSingleQuotes(Andrew)#
</cfquery>

Which is supposed to work as well, and it didn't. But as I stated I upgraded
the Macromedia Drivers to 3.5 and all the above code now works.

So back of Neil, you were not here pulling your hair out on this one. I
was..


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
98% of all statistics are made up. (Anonymous)
----------------------------------------------------------------------------
--------------------------
-----



---
You are currently subscribed to cfaussie as: lists@...
To unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/

Parent Message unknown Re: Single Quote Preservation

by Robertson-Ravo, Neil (RX) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The cfsavecontent code is nonsense - totally unecessary and pointless.

why the hell would you want to do that when cfquery works AOK?!

It was also not your original code you posted.






"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: bounce-cfaussie-21631@...
<bounce-cfaussie-21631@...>
To: CFAussie Mailing List <cfaussie@...>
Sent: Thu Nov 10 22:23:35 2005
Subject: [cfaussie] Re: Single Quote Preservation

What is the DB? As I noted, my example used the exact same ColdFusion
version as you, same DataDirect drivers.

What error did you get - and I mean an exact error - what datatype did you
try to insert into?

I tested this on 5 different ColdFusion servers and all worked - first time
(this was on J2EE and Server Config)

If you have been developing for a good time you should know that
cfqueryparam preserves quotes by default - or you could use an SP.

Also, if you think it is an error/bug then log sn issue with MM.







"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: bounce-cfaussie-21631@...
<bounce-cfaussie-21631@...>
To: CFAussie Mailing List <cfaussie@...>
Sent: Thu Nov 10 21:53:58 2005
Subject: [cfaussie] Re: Single Quote Preservation

Neil,

I don't care what you say....

I have had the 3.4 drivers installed and the code did not work, I installed
the 3.5 drivers and the code did work.

The code in question did in fact have the cfqueryparam and to test my theory
I decide to go to vanilla query to see if it was something else. It also had
a problem, and then I update the drivers and it was fixed on the vanilla,
and then when run against the proper code with the cfqueryparam it worked.

Which is also why I posted the version number to see if there were other
influences in this as well.

I have been developing coldfusion long enough to try all options before
posting here.


Regards,
Andrew Scott
 
Quote of the Day:
Teachers open the door, but you must enter by yourself. - Chinese Proverb
-----Original Message-----
From: bounce-cfaussie-12196@...
[mailto:bounce-cfaussie-12196@...] On Behalf Of
Robertson-Ravo, Neil (RX)
Sent: Thursday, 10 November 2005 9:09 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

Well, no, it shows how little you know!; see below - this is using 3.4
drivers (same version of CF) accessing a SQL DB (Northwind sample);if you
have the DB setup as a DSN in CF this will work out of the box.

It works fine; There is no way that this would not be known in the 3.4
drivers for this duration of time and no one spotted it.  I think there was
an issue with Oracle but not SQL server.

<cfset drivernames = "macromedia.jdbc.oracle.OracleDriver,
macromedia.jdbc.db2.DB2Driver, macromedia.jdbc.informix.InformixDriver,
macromedia.jdbc.sequelink.SequeLinkDriver,
macromedia.jdbc.sqlserver.SQLServerDriver,
macromedia.jdbc.sybase.SybaseDriver"> <cfset
drivernames=Replace(drivernames," ","","ALL")><!--- replace all spaces --->
<cfloop index="drivername" list="#drivernames#"> <cfobject action="CREATE"
class="#drivername#" name="driver" type="JAVA"> <cfset args= ArrayNew(1)>
<cfset driver.main(args)> <cfoutput>#drivername# is
#driver.getMajorVersion()#.#driver.getMinorVersion()#<br></cfoutput>
</cfloop>

<cfquery name="insert" datasource="northwind">  
        UPDATE Orders
        SET ShipName = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="God's
Kitchen 05">
        WHERE orderid = <cfqueryparam cfsqltype="CF_SQL_INTEGER"
value="10251">
</cfquery>

<cfquery name="qselect" datasource="northwind">  
        SELECT ShipName FROM ORDERS
        WHERE orderid = <cfqueryparam cfsqltype="CF_SQL_INTEGER"
value="10251">
</cfquery>

<CFDUMP VAR="#qselect#">  <!--- this will return "God's Kitchen 05"--->





-----Original Message-----
From: bounce-cfaussie-21631@...
[mailto:bounce-cfaussie-21631@...] On Behalf Of Andrew Scott
Sent: 10 November 2005 09:57
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

How little you actually know then!!

Regards,
Andrew Scott
 
Quote of the Day:
Homer Simpson: When I first heard that Marge was joining the police academy,
I thought it would be fun and zany, like that movie Spaceballs. But instead
it was dark and disturbing. Like that movie -- Police Academy.
-----Original Message-----
From: bounce-cfaussie-12196@...
[mailto:bounce-cfaussie-12196@...] On Behalf Of
Robertson-Ravo, Neil (RX)
Sent: Thursday, 10 November 2005 7:52 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

Indeed, it should.

I would doubt that this would have went unoticed to MM/DataDirect if it were
an issue with the new drivers (I think 3.4 are the new editions).






---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/ This e-mail is
from Reed Exhibitions (Oriel House, 26 The Quadrant, Richmond, Surrey, TW9
1DL, United Kingdom), a division of Reed Business, Registered in England,
Number 678540.  It contains information which is confidential and may also
be privileged.  It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s) please note that any form of
distribution, copying or use of this communication or the information in it
is strictly prohibited and may be unlawful.  If you have received this
communication in error please return it to the sender or call our
switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: andrews@... To
unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/






---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: lists@...
To unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/

Parent Message unknown Re: Single Quote Preservation

by Robertson-Ravo, Neil (RX) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This looks like bad coding I'm afraid - look at what you are trying to
achieve and look at the example I, and others posted for better examples.





"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: bounce-cfaussie-21631@...
<bounce-cfaussie-21631@...>
To: CFAussie Mailing List <cfaussie@...>
Sent: Thu Nov 10 23:09:44 2005
Subject: [cfaussie] Re: Single Quote Preservation

That's the thing, the error messaged changed for example.

#PresserSingleQuotes(String)#

Produced an error on the single quote and the s Where

'#PreserveSingleQuotes(String)#'

Produced unknown column and as I have updated the drivers I am not going to
be able to repeat this.

Now here is the kicker...

<cfqueryparam ..... >

Produced the same result has '#PreserveSingleQuotes(String)#'

And this

Values ('God's Kitchen 05')

Produced the same error as #PresserSingleQuotes(String)#

Now that I have updated the Macromedia Drivers all the above now work
correctly except for the reason I ran into this problem in the first place
still exists, and has been logged as a bug against MM.

It appears that if a java webservice returns a structured array, this line
of code will not work.

Values ( '#Array[1].getStringValue()#') nor will
'#PreserveSingleQuotes(SQLString)#' nor will <cfqueryparam ....>

However updating the drivers at least allowed me to save the query into a
variable and do this

<cfquery>
  #PreserveSingleQuotes(SQLString)#
</cfquery>

Now as I stated I wrote, and rewrote this code in many ways to find out why
this would not work. And all the code written now works with the latest
drivers.

Now the documentation to CF says that by default Single Quotes are preserved
in a query, so that means this should have worked but it didn't.

<cfset test = "God's Kitchen 05" />
<cfquery>
  Insert into table ( fieldname) values ( '#test#' )
</cfquery>

But it didn't so the next step was to try this.

<cfset test = "God's Kitchen 05" />
<cfsavecontent variable="Andrew">
  Insert into table ( fieldname) values ( '#test#' )
</cfsavecontent>
<cfquery>
  #PreserveSingleQuotes(Andrew)#
</cfquery>

Which is supposed to work as well, and it didn't. But as I stated I upgraded
the Macromedia Drivers to 3.5 and all the above code now works.

So back of Neil, you were not here pulling your hair out on this one. I
was..


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
98% of all statistics are made up. (Anonymous)
----------------------------------------------------------------------------
--------------------------
-----



---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: lists@...
To unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/

Parent Message unknown Re: Single Quote Preservation

by Andrew Scott-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Neil don't piss me off, read my posts.

I was not interested in the fact I should be using cfqueryparam, I was
interested in the preservation of single quotes with basic code that should
work and didn't.

I found the problem and posted the results, leave it at that. And go and
find another person to have a debate with that is not interested in your
opinion anymore.


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
The glory of friendship is not the outstretched hand, nor the kindly smile,
nor the joy of companionship; it is the spiritual inspiration that comes to
one when he discovers that someone else believes in him and is willing to
trust him with his friendship. - Ralph Waldo Emerson
----------------------------------------------------------------------------
--------------------------
-----Original Message-----
From: bounce-cfaussie-12196@...
[mailto:bounce-cfaussie-12196@...] On Behalf Of
Robertson-Ravo, Neil (RX)
Sent: Friday, 11 November 2005 10:24 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

This looks like bad coding I'm afraid - look at what you are trying to
achieve and look at the example I, and others posted for better examples.





"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: bounce-cfaussie-21631@...
<bounce-cfaussie-21631@...>
To: CFAussie Mailing List <cfaussie@...>
Sent: Thu Nov 10 23:09:44 2005
Subject: [cfaussie] Re: Single Quote Preservation

That's the thing, the error messaged changed for example.

#PresserSingleQuotes(String)#

Produced an error on the single quote and the s Where

'#PreserveSingleQuotes(String)#'

Produced unknown column and as I have updated the drivers I am not going to
be able to repeat this.

Now here is the kicker...

<cfqueryparam ..... >

Produced the same result has '#PreserveSingleQuotes(String)#'

And this

Values ('God's Kitchen 05')

Produced the same error as #PresserSingleQuotes(String)#

Now that I have updated the Macromedia Drivers all the above now work
correctly except for the reason I ran into this problem in the first place
still exists, and has been logged as a bug against MM.

It appears that if a java webservice returns a structured array, this line
of code will not work.

Values ( '#Array[1].getStringValue()#') nor will
'#PreserveSingleQuotes(SQLString)#' nor will <cfqueryparam ....>

However updating the drivers at least allowed me to save the query into a
variable and do this

<cfquery>
  #PreserveSingleQuotes(SQLString)#
</cfquery>

Now as I stated I wrote, and rewrote this code in many ways to find out why
this would not work. And all the code written now works with the latest
drivers.

Now the documentation to CF says that by default Single Quotes are preserved
in a query, so that means this should have worked but it didn't.

<cfset test = "God's Kitchen 05" />
<cfquery>
  Insert into table ( fieldname) values ( '#test#' )
</cfquery>

But it didn't so the next step was to try this.

<cfset test = "God's Kitchen 05" />
<cfsavecontent variable="Andrew">
  Insert into table ( fieldname) values ( '#test#' )
</cfsavecontent>
<cfquery>
  #PreserveSingleQuotes(Andrew)#
</cfquery>

Which is supposed to work as well, and it didn't. But as I stated I upgraded
the Macromedia Drivers to 3.5 and all the above code now works.

So back of Neil, you were not here pulling your hair out on this one. I
was..


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
98% of all statistics are made up. (Anonymous)
----------------------------------------------------------------------------
--------------------------
-----



---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: andrews@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/




---
You are currently subscribed to cfaussie as: lists@...
To unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/

Parent Message unknown Re: Single Quote Preservation

by Robertson-Ravo, Neil (RX) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hold on, let's review your posts...

Your first code snippet was:

<cfquery name="insert" database="Database">  
Insert into Tablename  ( Fieldname ) values ( 'God's Kitchen 05' )
</cfquery>

This will never work for obvious reasons the apostrophe is ending the SQL
command early and renders it invalid - not surprises here.

Rod (as did Ryan) -  posted a solution; which will work - escape the quote;

Insert into Tablename  ( Fieldname ) values ( 'God''s Kitchen 05')

I then mentioned using cfqueryparam which would work 100% of the time no
messing on all versions of the DataDirect driver all the way back to 3.1 I
think.  I provided a nice snippet which you could run to prove it on the
same drivers (so it is definitely not the drivers) - to repeat, it is not a
problem with the drivers.

You then posted these absurd code snippets:

<cfquery>
  #PreserveSingleQuotes(SQLString)#
</cfquery>

And

<cfset test = "God's Kitchen 05" />
<cfsavecontent variable="Andrew">
  Insert into table ( fieldname) values ( '#test#' ) </cfsavecontent>
<cfquery>
  #PreserveSingleQuotes(Andrew)#
</cfquery>

I have no idea why you would want to do this, its not good coding and it
will obviously not work - it will suffer the same fate as your first
snippet, as the values block would read ('God's Kitchen 05')....error every
time.

It seems what you have here is you were using bad/malformed code and blaming
the 3.4 drivers - and that the fact that the 3.5 drivers actually allow you
to do it is no more than luck I think; they handle it for you - but it
doesn't detract away from the fact that its bad code which just happens to
work on 3.5.











-----Original Message-----
From: bounce-cfaussie-21631@...
[mailto:bounce-cfaussie-21631@...] On Behalf Of Andrew Scott
Sent: 10 November 2005 23:54
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

Neil don't piss me off, read my posts.

I was not interested in the fact I should be using cfqueryparam, I was
interested in the preservation of single quotes with basic code that should
work and didn't.

I found the problem and posted the results, leave it at that. And go and
find another person to have a debate with that is not interested in your
opinion anymore.


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
The glory of friendship is not the outstretched hand, nor the kindly smile,
nor the joy of companionship; it is the spiritual inspiration that comes to
one when he discovers that someone else believes in him and is willing to
trust him with his friendship. - Ralph Waldo Emerson
----------------------------------------------------------------------------
--------------------------
-----Original Message-----
From: bounce-cfaussie-12196@...
[mailto:bounce-cfaussie-12196@...] On Behalf Of
Robertson-Ravo, Neil (RX)
Sent: Friday, 11 November 2005 10:24 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Single Quote Preservation

This looks like bad coding I'm afraid - look at what you are trying to
achieve and look at the example I, and others posted for better examples.





"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: bounce-cfaussie-21631@...
<bounce-cfaussie-21631@...>
To: CFAussie Mailing List <cfaussie@...>
Sent: Thu Nov 10 23:09:44 2005
Subject: [cfaussie] Re: Single Quote Preservation

That's the thing, the error messaged changed for example.

#PresserSingleQuotes(String)#

Produced an error on the single quote and the s Where

'#PreserveSingleQuotes(String)#'

Produced unknown column and as I have updated the drivers I am not going to
be able to repeat this.

Now here is the kicker...

<cfqueryparam ..... >

Produced the same result has '#PreserveSingleQuotes(String)#'

And this

Values ('God's Kitchen 05')

Produced the same error as #PresserSingleQuotes(String)#

Now that I have updated the Macromedia Drivers all the above now work
correctly except for the reason I ran into this problem in the first place
still exists, and has been logged as a bug against MM.

It appears that if a java webservice returns a structured array, this line
of code will not work.

Values ( '#Array[1].getStringValue()#') nor will
'#PreserveSingleQuotes(SQLString)#' nor will <cfqueryparam ....>

However updating the drivers at least allowed me to save the query into a
variable and do this

<cfquery>
  #PreserveSingleQuotes(SQLString)#
</cfquery>

Now as I stated I wrote, and rewrote this code in many ways to find out why
this would not work. And all the code written now works with the latest
drivers.

Now the documentation to CF says that by default Single Quotes are preserved
in a query, so that means this should have worked but it didn't.

<cfset test = "God's Kitchen 05" />
<cfquery>
  Insert into table ( fieldname) values ( '#test#' )
</cfquery>

But it didn't so the next step was to try this.

<cfset test = "God's Kitchen 05" />
<cfsavecontent variable="Andrew">
  Insert into table ( fieldname) values ( '#test#' )
</cfsavecontent>
<cfquery>
  #PreserveSingleQuotes(Andrew)#
</cfquery>

Which is supposed to work as well, and it didn't. But as I stated I upgraded
the Macromedia Drivers to 3.5 and all the above code now works.

So back of Neil, you were not here pulling your hair out on this one. I
was..


Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976

Quote:
98% of all statistics are made up. (Anonymous)
----------------------------------------------------------------------------
--------------------------
-----



---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: andrews@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/




---
You are currently subscribed to cfaussie as:
Neil.Robertson-Ravo@...
To unsubscribe send a blank email to
leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

---
You are currently subscribed to cfaussie as: lists@...
To unsubscribe send a blank email to leave-cfaussie-23165F@...
Aussie Macromedia Developers: http://lists.daemon.com.au/
< Prev | 1 - 2 | Next >