Subject: Quotes in Strings

From: [email-masked]
Date: Wed, 8 Jan 92 14:23:44 -0800

I am trying to insert a string into a table, however the  string
itself has quotes in it, so understandably when I try to apend a
string from the monitor I get an error : 

append ProcessSteps ( Station = "Sta1", Entity = "Product", StepNumber = 0.500
, Operand = "'FASSIGN("*;ExpectedOpTime",FVAL("OPERATION:OprName=Op1;%%sTime",CV
AL("*;Entity")));' " )

WARN:Jan  8 16:41:03:parser: syntax error at or near ";"

The field Operand is defined as char[100] 

Does anyone have any ideas how I can overcome this problem ?

Thanks

Ed

---

From: postarch (Postgres Mailing Archive)
Date: Wed, 08 Jan 92 17:45:30 PST

you write:
> append ProcessSteps ( Station = "Sta1", Entity = "Product", StepNumber = 0.50
 +0
> , Operand = "'FASSIGN("*;ExpectedOpTime",FVAL("OPERATION:OprName=Op1;%%sTime"
 +,CV
> Does anyone have any ideas how I can overcome this problem ?

The general mechanism for embedding quotes in string constants is to
use the \ character.  The only catch is that when you're running the
terminal monitor you need to give two backslashes:

	create foo ( a = text )
	append foo ( a = "This has a quote \\" <-----" ) \g

so it doesn't try to interpret the double quote as some escape sequence
command (e.g. \g).

	* retrieve (foo.all) \g

	Query sent to backend is "retrieve (foo.all) "
	---------------
	| a           |
	---------------
	| This has a quote " <---|
	---------------

Jeff Meredith
[email-masked]