Re: frustrated by plpgsql procedure

From: Dino Vliet <dino_vliet(at)yahoo(dot)com>
To: Bricklen Anderson <banderson(at)presinet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: frustrated by plpgsql procedure
Date: 2006-03-27 19:20:00
Message-ID: 20060327192000.85627.qmail@web51110.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nope:-(

I added it just now and still the same error message!!

--- Bricklen Anderson <banderson(at)presinet(dot)com> wrote:

> Dino Vliet wrote:
> > Hi guys,
> >
> > I trying for days to get this simple plpgsql
> procedure
> > to run but I keep getting this error:
> >
> > psql:pgsql_procedure.txt:15: ERROR: syntax error
> at
> > or near at character 17
> > QUERY: copy cancel TO $1 with delimiter as ','
> null
> > as '.'
> > CONTEXT: SQL statement in PL/PgSQL function
> doedit
> > near line 12
> > psql:pgsql_procedure.txt:15: LINE 1: copy cancel
> TO $1
> > with delimiter as ',' null as '.'
> > psql:pgsql_procedure.txt:15:
> >
> > The source code of this plpgsql procedure is:
> >
> > create or replace function doedit() returns void
> AS $$
> > /* Procedure to create textfile from database
> table.
> > */
> >
> > DECLARE
> > i integer := 340;
> > start date :='2004-08-06';
> > eind date :='2004-08-12';
> > location varchar(30) :='/usr/Data/plpgtrainin';
> >
> > BEGIN
> > create table cancel as (SOME QUERY);
> > location := location || i || '.txt' ::varchar(30);
> > raise notice 'location is here %', location;
> > copy cancel TO location with delimiter as ',' null
> as
> > '.' ;
> > END
> > $$ Language plpgsql;
> >
> Missing semi-colon after END?
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bricklen Anderson 2006-03-27 19:27:45 Re: frustrated by plpgsql procedure
Previous Message Tom Lane 2006-03-27 19:18:18 Re: Advantages of PostgreSQL over MySQL 5.0