Subject: What is an unterminated char/string constant?

From: "Guy R. Thomas" <[email-masked]>
Date: Mon, 20 Dec 1993 17:08:23 -0800

Hi;

I am using perl ( not pg-perl )to interact with postgres.  I assign a  
value to a perl varrialble like so:

   ($address_2, $city, $province, $country,
   $postal_code,$liais_numb) = split(/\|/, $_);

Where $_ comes from a text file. Thus $liais_numb is a text string in  
perls eyes.  In the class liaisons, liais_numb is an int2 field. Thus  
the query that I try to send to postgres is:

   system ("monitor commcontent -N -c \"retrieve ( l.all ) 

   from l in liaisons where l.liais_numb = \\\"$liais_numb\\\" ::int2
   \" > /tmp/liaison ");

the error porduced is:

WARN:Dec 20 17:02:22:*** scanner error: Unterminated char/string  
constant

Is this a quirk in perl or postgres?  How do I terminate perl  
strings?  Mystery galore.

---
Guy R. Thomas                           Native Education Centre
Library Coordinator                     285 East Fifth Avenue
[email-masked]                 Vancouver B. C.
V:(604) 873-3761 --- F:(604) 873-9152   V5T 1H2

---

From: [email-masked] (Paul M. Aoki)
Date: Mon, 20 Dec 1993 18:55:53 -0800

>    from l in liaisons where l.liais_numb = \\\"$liais_numb\\\" ::int2

this is a postgres error indicating that a string started with "
was not properly terminated with ".  does it work without the 
embedded newlines?  i wouldn't think the shell would be all that
happy if that were the problem, but..
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki