Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Leif B. Kristensen
On Friday 20. February 2009, Adrian Klaver wrote: >On Friday 20 February 2009 6:29:43 am Leif B. Kristensen wrote: >> About twenty years ago I wrote a lot of Turbo Pascal code, and IIRC >> semicolon after an END was allowed but considered bad style. The rules concerning ENDs and semicolons in Pasc

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Adrian Klaver
On Friday 20 February 2009 6:29:43 am Leif B. Kristensen wrote: > On Friday 20. February 2009, Adrian Klaver wrote: > >Actually you need both semicolons. One after the RETURN statement and > > one after the END statement > >See below for full details: > >http://www.postgresql.org/docs/8.3/interacti

Re: Fwd: Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Shawn Tayler
Ah.. Missed that one. Thank you Adrian! Shawn On Fri, 2009-02-20 at 06:27 -0800, Adrian Klaver wrote: > Actually you need both semicolons. One after the RETURN statement and > one after > the END statement > See below for full details: > http://www.postgresql.org/docs/8.3/interactive/plp

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Leif B. Kristensen
On Friday 20. February 2009, Adrian Klaver wrote: >Actually you need both semicolons. One after the RETURN statement and > one after the END statement >See below for full details: >http://www.postgresql.org/docs/8.3/interactive/plpgsql-structure.html I see the documentation, but empirically you d

Fwd: Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Adrian Klaver
Memo to self: Remember hit reply all. -- Forwarded Message -- Subject: Re: [SQL] Creating a function with single quotes Date: Friday 20 February 2009 From: Adrian Klaver To: "Leif B. Kristensen" On Friday 20 February 2009 6:13:03 am you wrote: > On Friday 20.

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Shawn Tayler
Hi Leif! Thank you to you and the group. Worked like a charm. The SQL language was the key Shawn On Fri, 2009-02-20 at 15:12 +0100, Leif B. Kristensen wrote: > You should place a semicolon at the end of the RETURN line, and > remove > the one after END, > > BTW, simple functions as th

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Leif B. Kristensen
On Friday 20. February 2009, Shawn Tayler wrote: >Hello Jasen and the List, > >I tried the $$ quote suggestion: > >create function f_csd_interval(integer) returns interval as >$$ >BEGIN >RETURN $1 * interval '1 msec' >END; >$$ >LANGUAGE 'plpgsql'; > >Here is what I got: > >edacs=# \i 'f_csd_interva

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Shawn Tayler
Hello Jasen and the List, I tried the $$ quote suggestion: create function f_csd_interval(integer) returns interval as $$ BEGIN RETURN $1 * interval '1 msec' END; $$ LANGUAGE 'plpgsql'; Here is what I got: edacs=# \i 'f_csd_interval.sql' psql:f_csd_interval.sql:7: ERROR: syntax error at or n

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Jasen Betts
On 2009-02-19, Shawn Tayler wrote: > Hello, > > This has me befuddled. I am trying create a simple experiment, rather > new to SQL and I am running into an issue with single quotes. All I can > find on creating a function states the procedure should be contained > within single quotes. My probl

Re: [SQL] Creating a function with single quotes

2009-02-19 Thread Craig Ringer
Shawn Tayler wrote: > Hello, > > This has me befuddled. I am trying create a simple experiment, rather > new to SQL and I am running into an issue with single quotes. All I can > find on creating a function states the procedure should be contained > within single quotes. My problem comes when I

Fwd: Re: [SQL] Creating a function with single quotes

2009-02-19 Thread Adrian Klaver
Oops, forgot to reply to list. -- Forwarded Message -- Subject: Re: [SQL] Creating a function with single quotes Date: Thursday 19 February 2009 From: Adrian Klaver To: stay...@washoecounty.us On Thursday 19 February 2009 7:41:11 am Shawn Tayler wrote: > Hello, > >

Re: [SQL] Creating a function with single quotes

2009-02-19 Thread Agustin Bialet
On Feb 19, 2009, at 1:41 PM, Shawn Tayler wrote: Hello, This has me befuddled. I am trying create a simple experiment, rather new to SQL and I am running into an issue with single quotes. All I can find on creating a function states the procedure should be contained within single quotes.

[SQL] Creating a function with single quotes

2009-02-19 Thread Shawn Tayler
Hello, This has me befuddled. I am trying create a simple experiment, rather new to SQL and I am running into an issue with single quotes. All I can find on creating a function states the procedure should be contained within single quotes. My problem comes when I want to use a textual represent