Re: select into - Mailing list pgsql-sql

From Mulham freshcode
Subject Re: select into
Date
Msg-id 20061124065413.38499.qmail@web90514.mail.mud.yahoo.com
Whole thread Raw
In response to Re: select into  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: select into
List pgsql-sql
Hi Tom,<br /><br /> Thanks for the help. Am using version 8.0 and it seems like RECORD is not that dynamic still. I
triedwith the FOR ... IN EXECUTE ... LOOP and it does the trick. But am still finding it hard to move forward with
this.I have the name of table field in a varchar variable that i got from information_schema.columns and I have the
recordsvariable that stores the  contains the data from that table. Usually I'd do something like data_rec.col_name to
extractthe data from the record but now I don't know the name per se. how can i say something like data_rec[col_name] 
wherecol_name is a variable that has the actual column name. I found no examples in the docs that explain this. Can it
bedone in version 8.0.1?<br /><br />I find variable substitution kind of confusing. I mean why is there no way of
sayingexplicitly replace this variable with its content before executing the statement?<br /><br /> Sorry for the long
question,<br/> and thanks again for the help<br /><br /> Mustafa...<br /><br /><br /><b><i>Tom Lane
<tgl@sss.pgh.pa.us></i></b>wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255);
margin-left:5px; padding-left: 5px;"> Mulham freshcode  writes:<br />> execute sql_str1 into svc_data_rec ;<br /><br
/>>svc_data_rec is a RECORD, which is supposed to be dynamic.<br /><br />This should work --- in PG 8.1 or later. In
olderversions you'd have<br />to fool around with a FOR ... IN EXECUTE ... loop.<br /><br /> regards, tom lane<br /><br
/>---------------------------(endof broadcast)---------------------------<br />TIP 3: Have you checked our extensive
FAQ?<br/><br /> http://www.postgresql.org/docs/faq<br /></blockquote><br /><p><hr size="1" />Everyone is raving about
<ahref="http://us.rd.yahoo.com/evt=45083/*http://advision.webevents.yahoo.com/mailbeta">the all-new Yahoo! Mail
beta.</a>

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: select into
Next
From: "Ezequias Rodrigues da Rocha"
Date:
Subject: Numbers