How to write in Postgres

From: <mgould(at)isstrucksoftware(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: How to write in Postgres
Date: 2012-02-07 14:03:37
Message-ID: 20120207070337.c760ddbd7c0975bc4b045766db7d895c.8c8c67ccf2.wbe@email16.secureserver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general









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);








How do I convert this to PostGres. I'm getting a error


ERROR: syntax error at or near "("

LINE 23: set chr = substr(lfeid,idx,1);





Michael Gould


Intermodal Software Solutions, LLC


904-226-0978



Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2012-02-07 14:45:06 Re: How to write in Postgres
Previous Message Maton, Brett 2012-02-07 13:33:44 Re: problems sending email to list