Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

special characters

Status
Not open for further replies.

CoquinD

Programmer
Jul 29, 2002
2
DE
Hi,

this might be easy, but I can't find an answer in the docu:

I'd like to parse a mail in a varchar-field of the postgres database.

Now I got an error because in my String (the mail), there are two "'"s ( the ' )

so the parser thinks that after the ' the input is finished and throws an error.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|So my question is: How to quote special characters. |
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

And by the way, what other characters should I quote.

&quot;Special&quot; ;) Thx,

CoquinD :) :) :)
 
Hi CoquinD,

You might try using a back slash in front of the apostrophe like so:

$test=&quot;Peg\'s Antiques&quot;

In the perl programming language using the back slash in front of special characters is called &quot;escaping the character&quot;. Another character in perl that needs to be escaped is the $. For example to print five-hundred and fifty-five dollars in perl without confusing the interpreter that might thing your are refering to a string varabile, I would escape the $ like:

print &quot;\$555.00&quot;;

I know the back slach is needed in front of apostrophes when parsing a string in an insert command to a postgres table, but I'm not sure about the $ sign.
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top