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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to query this record

Status
Not open for further replies.

SkyHigh

Technical User
May 30, 2002
309
0
0
CA
Hi

I have a record where value is Uj"\n"KL the field type as you can guess is varchar, when I query this record by this value i.e.

SELECT * FROM my_table WHERE trid='Uj"\n"KL' it does not return anything while this record exists, can any one please help me there.

Thanks for your help
Brenda
 
Are you trying this query from the psql command line, or insinde a programming environment such as PHP. If you are using the query inside a programming environment, it's possible that the "\n" is being interpreted as a line break, instead of the literal text.

YOu might have to escape the double-quotes and double-escape the newline character:

Code:
SELECT * FROM my_table WHERE trid='Uj\"\\n\"KL'
-------------------------------------------

Big Brother: "War is Peace" -- Big Business: "Suspicion is Trust"
(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top