Re: How to write in Postgres - Mailing list pgsql-general

From Merlin Moncure
Subject Re: How to write in Postgres
Date
Msg-id CAHyXU0xHoorJ-wQK9D4AVF+p1agcrQo3GucaZTc99paMaac7qA@mail.gmail.com
Whole thread Raw
In response to How to write in Postgres  (<mgould@isstrucksoftware.net>)
List pgsql-general
On Tue, Feb 7, 2012 at 8:03 AM, <mgould@isstrucksoftware.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
tofigure out why.  Is the substring usage incorrect and if it is how do I accomplish this.  I'm trying to step through
theitem 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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Error while importing CSV file
Next
From: Madhu S R
Date:
Subject: Postgres Table level statement logging