Re: Re: sintax???

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Alfonso Peniche <alfonso(at)iteso(dot)mx>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: sintax???
Date: 2001-02-02 17:39:35
Message-ID: Pine.BSF.4.21.0102020938040.21728-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


It looks like you also may have some dos style end of lines in whatever
you entered in. Did you cut and paste or copy a file from a windows
box?

That's why the " is over the E in ERROR because it's seeing the
CR character.

On Fri, 2 Feb 2001, Alfonso Peniche wrote:

> Thanks, Now I have another problem:
>
> If I run select registrarconexion('mine', '201.201.201.1','MYCPU');
>
> I get a message
>
> NOTICE: plpgsql: ERROR during compile of registrarconexion near line 1
> "RROR: parse error at or near "
>
> Any ideas?
>
> Thanx.
>
> Stephan Szabo wrote:
>
> > On Thu, 1 Feb 2001, Alfonso Peniche wrote:
> >
> > > I have the following:
> > >
> > > CREATE FUNCTION RegistrarConexion(char(8),char(16),char(20))
> > > RETURNS integer
> > > AS '
> > > DECLARE ret integer;
> > >
> > > BEGIN
> > > INSERT INTO BitacoraConexion(username, IPmaquina,
> > > nombremaquina, conexion)
> > > VALUES ($1, $2, $3, CURRENT_TIMESTAMP);
> > >
> > > SELECT INTO ret
> > > currval('bitacoraconex_idbitacoracon_seq');
> > >
> > > RETURN ret;
> > > END;'
> > > LANGUAGE 'plpgsql';
> > >
> > > and if I execute this file I get the following error:
> > >
> > > psql:SPRegConex.sql:20: ERROR: parser: parse error at or near
> > > "bitacoraconex_idbitacoracon_seq"
> > >
> > > I asume it's due to a sintax error having to do with "currval", but I
> > > can't find what the proper sintax would be for 'plpgsql' for getting the
> > > last sequence value assigned (I even tried
> >
> > I believe the problem is that you need to escape the single quotes,
> > otherwise it thinks you're ending the function text. Try
> > currval(''bitacoraconex_idbitacoracon_seq'');
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-02-02 17:44:08 Re: adding not null constraint to existing table
Previous Message Stephan Szabo 2001-02-02 17:37:08 Re: plpgsql always returning null..