If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > PostgreSQL > Looping with changing variable

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Nov 2012
Posts: 1
Looping with changing variable

Hi all,

I would like to run a set of SQL code on a repeat loop, with each loop using a different value for a specific parameter.

In other words, I have a data set (X,Y,Z) and I want to run the code passing X as a variable, using Y, and then again using Z. I actually have more than 3 values to run, I have around 100, so I would prefer to store them in a separate table I can query from on each loop.

I was thinking stored procedure but since I am a novice I have never used them before.

I am using Netezza with Aginity workbench but it's based on postgresql so any help you can provide would be great.

Last edited by gsm113; 11-08-12 at 19:13.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On