pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
quote_literal() fails with unmatched quotes
3+ messages / 2 participants
[nested] [flat]

* quote_literal() fails with unmatched quotes
@ 2005-11-30 20:32 James M Doherty <jim@jdoherty.net>
  2005-11-30 21:04 ` Re: quote_literal() fails with unmatched quotes Tom Lane <tgl@sss.pgh.pa.us>
  2005-11-30 21:22 ` Re: quote_literal() fails with unmatched quotes James M Doherty <jim@jdoherty.net>
  0 siblings, 2 replies; 3+ messages in thread

From: James M Doherty @ 2005-11-30 20:32 UTC (permalink / raw)
  To: pgsql-sql

 
I have had the following problem and been unable to determine the cause !
 
 nmostlikemat := iso_date(nmostlikemat);
    EXECUTE  ''insert into scenario_inv (''
     || ''inv_id,''
     || ''record_date,''
     || ''scenario_type,''
     || ''mostlikemat,''
     || ''mktpr,''
     || ''mktyld )''
     || '' values ( ''
     || quote_literal(ID)
     || '',''
     || quote_literal(nnrecord_date)
     || '',''
     || quote_literal(nscid)
     || '',''
     || quote_literal(nmostlikemat)
     || '',''
     || quote_literal(nmktpr)
     || '',''
     || quote_literal(nmktyld)
     || '');'';
 
 
The following error returns from postgres 8.1
 
ERROR:  unterminated quoted string at or near "'2009-10-03" at character 122
QUERY:  insert into scenario_inv
(inv_id,record_date,scenario_type,mostlikemat,mktpr,mktyld ) values (
'405832','2005-06-30','1','2009-10-03
CONTEXT:  PL/pgSQL function "scenario_set" line 502 at execute statement
PL/pgSQL function "fix_invest_set_scenario" line 18 at if
LINE 1: ...mktpr,mktyld ) values ( '405832','2005-06-30','1','2009-10-0...
 
 
James M Doherty
Principal
 
JMD CONSULTING
411 Thunderbay Dr
Georgetown, TX 78626
A reputation is something others give you HONOR is something you give
yourself!




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: quote_literal() fails with unmatched quotes
  2005-11-30 20:32 quote_literal() fails with unmatched quotes James M Doherty <jim@jdoherty.net>
@ 2005-11-30 21:04 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-11-30 21:04 UTC (permalink / raw)
  To: James M Doherty <jim@jdoherty.net>; +Cc: pgsql-sql

"James M Doherty" <jim@jdoherty.net> writes:
> I have had the following problem and been unable to determine the cause !

Can you show us a complete example?  I can't see what's going on from
the info you've provided ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: quote_literal() fails with unmatched quotes
  2005-11-30 20:32 quote_literal() fails with unmatched quotes James M Doherty <jim@jdoherty.net>
@ 2005-11-30 21:22 ` James M Doherty <jim@jdoherty.net>
  1 sibling, 0 replies; 3+ messages in thread

From: James M Doherty @ 2005-11-30 21:22 UTC (permalink / raw)
  To: pgsql-sql

 
Nmostlikemat := ''10/3/2009'';

What happens is that quote_literal works for everyone in the example but
this one.

Jim

James M Doherty
Principal

JMD CONSULTING
411 Thunderbay Dr
Georgetown, TX 78626
A reputation is something others give you HONOR is something you give
yourself!

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of James M Doherty
Sent: Wednesday, November 30, 2005 2:33 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] quote_literal() fails with unmatched quotes

 
I have had the following problem and been unable to determine the cause !
 
 nmostlikemat := iso_date(nmostlikemat);
    EXECUTE  ''insert into scenario_inv (''
     || ''inv_id,''
     || ''record_date,''
     || ''scenario_type,''
     || ''mostlikemat,''
     || ''mktpr,''
     || ''mktyld )''
     || '' values ( ''
     || quote_literal(ID)
     || '',''
     || quote_literal(nnrecord_date)
     || '',''
     || quote_literal(nscid)
     || '',''
     || quote_literal(nmostlikemat)
     || '',''
     || quote_literal(nmktpr)
     || '',''
     || quote_literal(nmktyld)
     || '');'';
 
 
The following error returns from postgres 8.1
 
ERROR:  unterminated quoted string at or near "'2009-10-03" at character 122
QUERY:  insert into scenario_inv
(inv_id,record_date,scenario_type,mostlikemat,mktpr,mktyld ) values (
'405832','2005-06-30','1','2009-10-03
CONTEXT:  PL/pgSQL function "scenario_set" line 502 at execute statement
PL/pgSQL function "fix_invest_set_scenario" line 18 at if
LINE 1: ...mktpr,mktyld ) values ( '405832','2005-06-30','1','2009-10-0...
 
 
James M Doherty
Principal
 
JMD CONSULTING
411 Thunderbay Dr
Georgetown, TX 78626
A reputation is something others give you HONOR is something you give
yourself!


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-11-30 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-30 20:32 quote_literal() fails with unmatched quotes James M Doherty <jim@jdoherty.net>
2005-11-30 21:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-11-30 21:22 ` James M Doherty <jim@jdoherty.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox