------=_Part_21537_21408893.1214922714754
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi All,
I'm kind of new to Postgre and I need some advice.
I have the following table.
metadata (value:integer , field:integer , mydate:text)
given below is a sample record from that.
( 2 , 16 , Augest 2009)
I need a script that will read the above table and for each such row it
will
insert two rows as below.
( 2 , 91 , Augest )
( 2 , 86 , 2009 )
16, 91 and 86 are static values. *value and field together* creates the
primary key.
I could figure out and write the logic for this. I only need a little bit
similar sample script so that I can figure out Postgre syntax.
Like
- Loop syntax to through all the rows return by a select *
- How to assign that value to a parameter
- using that parameter in the Insert statement
- etc ...
Thanks,
Dhanushka.
------=_Part_21537_21408893.1214922714754
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi All,<br><br>I'm kind of new to Postgre and I need some advice.<br>I
have the following table.<br>metadata (value:integer , field:integer ,
mydate:text)<br><br>given below is a sample record from that.<br>( 2 , 16
, Augest 2009)<br>
<br>I need a script that will read the above table and for each such row
it will insert two rows as below.<br><br>( 2 , 91 , Augest )<br>( 2 , 86 ,
2009 )<br><br>16, 91 and 86 are static values. <u>value and field
together</u> creates the primary key.<br>
<br>I could figure out and write the logic for this. I only need a little
bit similar sample script so that I can figure out Postgre syntax.<br>Like
<br>- Loop syntax to through all the rows return by a select *<br>- How to
assign that value to a parameter<br>
- using that parameter in the Insert statement<br>- etc
...<br><br>Thanks,<br>Dhanushka.<br>
<br>
------=_Part_21537_21408893.1214922714754--


|