Re: How to write in Postgres

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: mgould(at)isstrucksoftware(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to write in Postgres
Date: 2012-02-07 15:06:49
Message-ID: CAHyXU0xHoorJ-wQK9D4AVF+p1agcrQo3GucaZTc99paMaac7qA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 7, 2012 at 8:03 AM, <mgould(at)isstrucksoftware(dot)net> wrote:
>
>  I have a SQL statement that I'm trying to convert from a SQL Anywhere function, but I'm getting a error.  Can't seem to figure out why.  Is the substring usage incorrect and if it is how do I accomplish this.  I'm trying to step through the item 1 character at a time so that I can reformat the input correctly.
>
> This is inside a WHILE loop (While idx < 11 loop. idx has been initialized to 1 and is declared as a integer.
> set chr = substr(lfeid,idx,1);

in plpgsql:

WHILE idx < 11
LOOP
chr := substr(lfeid,idx,1);
END LOOP;

http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html

I could probably help you work it into a single query if you provided
some more detail.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2012-02-07 17:15:18 Re: Postgres Table level statement logging
Previous Message Adrian Klaver 2012-02-07 14:53:27 Re: Error while importing CSV file