Databases
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Databases

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 1st, 2008, 10:11 AM
Dhanushka Samarakoon
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Need a sample Postgre SQL script

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.

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Databases > Need a sample Postgre SQL script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT