For Programmers: Free Programming Magazines  


Home > Archive > Clarion > September 2006 > How to Set and Execute "Prepared SQL Statement" in Clarion









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to Set and Execute "Prepared SQL Statement" in Clarion
scheng@vtecsys.com.sg

2006-09-07, 3:55 am

1) One of Clarion's best features is to execute a SQL statement
painlessly by using :

MemberTable{Prop:SQL} = 'select * from "MemberTable" where
"SurName"=''' & clip(AnySurname) & ''''

2) It works fine in most of the situation but fails if :

AnySurname = O'Neal or contains any UTF-8 characters

3) Java and some other languages can use "prepared SQL statement" to
ask the server to get the value of AnySurname from certain memory
location before executing the SQL statement. Clarion ODBC driver
actually uses this method in the Set(Key, Key) function to get records
from the Database servers.

4) But Can we do that in the Clarion language itself?

jonwaterhouse@gov.nl.ca

2006-09-12, 6:55 pm


scheng@vtecsys.com.sg wrote:
> 1) One of Clarion's best features is to execute a SQL statement
> painlessly by using :
>
> MemberTable{Prop:SQL} = 'select * from "MemberTable" where
> "SurName"=''' & clip(AnySurname) & ''''
>
> 2) It works fine in most of the situation but fails if :
>
> AnySurname = O'Neal or contains any UTF-8 characters
>
> 3) Java and some other languages can use "prepared SQL statement" to
> ask the server to get the value of AnySurname from certain memory
> location before executing the SQL statement. Clarion ODBC driver
> actually uses this method in the Set(Key, Key) function to get records
> from the Database servers.
>
> 4) But Can we do that in the Clarion language itself?


Would Quote() help you out? Certainly deals with doubling up single
quote marks.

scheng@vtecsys.com.sg

2006-09-18, 3:55 am

Hi Jon,

Thanks for the hint. Should try it out and let you know.


jonwaterhouse@gov.nl.ca wrote:

> scheng@vtecsys.com.sg wrote:
>
> Would Quote() help you out? Certainly deals with doubling up single
> quote marks.


scheng@vtecsys.com.sg

2006-09-18, 3:55 am

Hi Jon,

Tried out using "QUOTE". That solves the part if there is a single
quote in the string but not if the string is in UTF-8.

Any body has the experience to include French word in a SQL statement,
eg : L'extr=EAme



scheng@vtecsys.com.sg wrote:[color=darkred]
> Hi Jon,
>
> Thanks for the hint. Should try it out and let you know.
>
>
> jonwaterhouse@gov.nl.ca wrote:
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com