Search Postgresql Archives

Re: How to write in Postgres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 7, 2012 at 8:03 AM, <mgould@xxxxxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux