pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: quotes in pl/pgsql
4+ messages / 4 participants
[nested] [flat]

* Re: quotes in pl/pgsql
@ 2001-03-07 23:32  clayton cottingham <drfrog@smartt.com>
  parent: Najm Hashmi <najm@mondo-live.com>
  2 siblings, 0 replies; 4+ messages in thread

From: clayton cottingham @ 2001-03-07 23:32 UTC (permalink / raw)
  To: Najm Hashmi <najm@mondo-live.com>; +Cc: pgsql-sql

Najm Hashmi wrote:
> 
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape  a single quote.
> Thank you in advance.
> 
>   ------------------------------------------------------------------------
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

single qutoe escaping :

'here''s johnny'



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

* Re: quotes in pl/pgsql
@ 2001-03-08 00:37  Justin Clift <aa2@bigpond.net.au>
  parent: Najm Hashmi <najm@mondo-live.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Justin Clift @ 2001-03-08 00:37 UTC (permalink / raw)
  To: Najm Hashmi <najm@mondo-live.com>; +Cc: pgsql-sql

Hi Najm,

Is this what you mean?

CREATE FUNCTION foobar(int4) returns int4
  as 'DECLARE

  textbuf   varchar(120);

BEGIN

    textbuf := ''Example Text '';

    insert into sometable (something) values (textbuf);

    RETURN 0;
  END;'
LANGUAGE 'plpgsql';


Najm Hashmi wrote:
> 
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape  a single quote.
> Thank you in advance.
> 
>   ------------------------------------------------------------------------
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org



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

* Re: quotes in pl/pgsql
@ 2001-03-08 01:03  Roberto Mello <rmello@cc.usu.edu>
  parent: Najm Hashmi <najm@mondo-live.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Roberto Mello @ 2001-03-08 01:03 UTC (permalink / raw)
  To: Najm Hashmi <najm@mondo-live.com>; +Cc: pgsql-sql

On Thu, Mar 08, 2001 at 05:54:38PM -0500, Najm Hashmi wrote:
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape  a single quote.

	Others have answered how to quote a single string. I wrote an entire
section on quotes on the PL/SQL-to-PL/pgSQL-HOWTO. It's called "Quote me
on that" and mentions several cases on quote usage in PL/pgSQL and what to
do about it.
	http://www.brasileiro.net/roberto/howto

	-Roberto

-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club|------+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
      http://www.sdl.usu.edu - Space Dynamics Lab, Web Developer    
DOS = Damned Old Software



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

* quotes in pl/pgsql
@ 2001-03-08 22:54  Najm Hashmi <najm@mondo-live.com>
  0 siblings, 3 replies; 4+ messages in thread

From: Najm Hashmi @ 2001-03-08 22:54 UTC (permalink / raw)
  To: pgsql-sql

Hi all, I just want to know how to put quotes around a string. Is there a
function to do so?
If not how can I escape  a single quote.
Thank you in advance.

Attachments:

najm.vcf (text/x-vcard, 183B) download begin:vcard n:Hashmi;Najm x-mozilla-html:FALSE org:Mondo-Live.com;www.flipr.com adr:;;;;;; version:2.1 email;internet:najm@mondo-live.com x-mozilla-cpt:;6144 fn:Najm Hashmi end:vcard
^ permalink raw reply [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-03-08 22:54 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08 22:54 quotes in pl/pgsql Najm Hashmi <najm@mondo-live.com>
2001-03-07 23:32 ` clayton cottingham <drfrog@smartt.com>
2001-03-08 00:37 ` Justin Clift <aa2@bigpond.net.au>
2001-03-08 01:03 ` Roberto Mello <rmello@cc.usu.edu>

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