Solved

working with quote

Posted on 2006-10-23
3
184 Views
Last Modified: 2011-10-03
Hello guys,

I am having some  trouble to create a string this way

Str = 'Select * from table where field='' september" '

 Month := QuotedStr('' " '') + month_alias[StrToInt(Copy(Std[I],5,2))-1] + QuotedStr('' " '')

I tried several ways, but nothing so far

As you can see, I have a double quote in september

Thanks
0
Comment
Question by:hidrau
  • 2
3 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 17788982
the way to use quotedstr is:
month:= quotedstr( month_alias[StrToInt(Copy(Std[I],5,2))-1] );
which will result in 'september' for example
if you wan it to put in that select then use:

str:=quotedstr('Select * from table where fieId="+month_alias[StrToInt(Copy(Std[I],5,2))-1]+"')

though in this particular case of yours, I don't really see the need of quotedstr as you do not use single quotes in the string.
0
 
LVL 28

Accepted Solution

by:
ciuly earned 500 total points
ID: 17789002
also keep in mind that
str:=quotedstr('Select * from table where fieId="+month_alias[StrToInt(Copy(Std[I],5,2))-1]+"')
will result in  'Select * from table where fieId="september"' WITH single quotes. in delphi that would be written as a constant
'''Select * from table where fieId="september"''' (see 3 single quotes at begining and end that represent 1 escaped single quote and a single quote so tha final string will actually contain a single quote at the beginig and end of the string. I am sure you don't want this ... but then again, you know better)
0
 
LVL 1

Author Comment

by:hidrau
ID: 17789021
Thanks very much ciuly
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now