<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: postgres - psql error when using a for loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826552#M778513</link>
    <description>How about just:&lt;BR /&gt;&lt;BR /&gt;SELECT COUNT(*) FROM ldev-rg;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Wed, 19 Jul 2006 10:09:34 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2006-07-19T10:09:34Z</dc:date>
    <item>
      <title>postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826548#M778509</link>
      <description>Hi there...I've got PostgreSQL A.06.00-8.1.3.1 installed on my server and I'm trying to create a for loop:&lt;BR /&gt;&lt;BR /&gt;for LV in 1..10 LOOP&lt;BR /&gt;&lt;BR /&gt;        select * from ldev-rg where rg='$lv';&lt;BR /&gt;&lt;BR /&gt;END LOOP;&lt;BR /&gt;&lt;BR /&gt;but when I run it, I get:&lt;BR /&gt;&lt;BR /&gt;psql:blah.sql:3: ERROR:  syntax error at or near "for" at character 1&lt;BR /&gt;psql:blah.sql:3: LINE 1: for LV in 1..10 LOOP&lt;BR /&gt;psql:blah.sql:3:         ^&lt;BR /&gt;psql:blah.sql:5: ERROR:  syntax error at or near "LOOP" at character 5&lt;BR /&gt;psql:blah.sql:5: LINE 1: END LOOP;&lt;BR /&gt;psql:blah.sql:5:             ^&lt;BR /&gt;&lt;BR /&gt;Am I totally missing something here?</description>
      <pubDate>Wed, 19 Jul 2006 09:46:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826548#M778509</guid>
      <dc:creator>Kevin Nikiforuk</dc:creator>
      <dc:date>2006-07-19T09:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826549#M778510</link>
      <description>Ken,&lt;BR /&gt;&lt;BR /&gt;I don't have much plpgsql experience, but try this:&lt;BR /&gt;&lt;BR /&gt;FOR LV in 1..10 LOOP&lt;BR /&gt;SELECT * FROM ldev-rg WHERE rg="$LV";&lt;BR /&gt;END LOOP;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 19 Jul 2006 09:56:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826549#M778510</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-19T09:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826550#M778511</link>
      <description>Same thing's happening...&lt;BR /&gt;&lt;BR /&gt;xp512-0715-0716=# FOR LV in 1..10 LOOP&lt;BR /&gt;xp512-0715-0716-# SELECT * FROM ldev-rg WHERE rg="$LV";&lt;BR /&gt;ERROR:  syntax error at or near "FOR" at character 1&lt;BR /&gt;LINE 1: FOR LV in 1..10 LOOP&lt;BR /&gt;        ^&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jul 2006 09:57:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826550#M778511</guid>
      <dc:creator>Kevin Nikiforuk</dc:creator>
      <dc:date>2006-07-19T09:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826551#M778512</link>
      <description>Do you have to declare LV?</description>
      <pubDate>Wed, 19 Jul 2006 10:05:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826551#M778512</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-07-19T10:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826552#M778513</link>
      <description>How about just:&lt;BR /&gt;&lt;BR /&gt;SELECT COUNT(*) FROM ldev-rg;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 19 Jul 2006 10:09:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826552#M778513</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-19T10:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: postgres - psql error when using a for loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826553#M778514</link>
      <description>My mistake, the table name is actually ldevrg, not ldev-rg.&lt;BR /&gt;&lt;BR /&gt;xp512-0715-0716=# select count(*) from ldevrg;&lt;BR /&gt; count &lt;BR /&gt;-------&lt;BR /&gt;  1491&lt;BR /&gt;(1 row)&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jul 2006 11:04:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/postgres-psql-error-when-using-a-for-loop/m-p/3826553#M778514</guid>
      <dc:creator>Kevin Nikiforuk</dc:creator>
      <dc:date>2006-07-19T11:04:17Z</dc:date>
    </item>
  </channel>
</rss>

