INSERT DELETE RETURNING - Mailing list pgsql-sql
From | Phillip Smith |
---|---|
Subject | INSERT DELETE RETURNING |
Date | |
Msg-id | 008201c7198a$93ad5520$9b0014ac@wbaus090 Whole thread Raw |
List | pgsql-sql |
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Hi All,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">As per Daniel Caune’s posting (with no replies) on October 22<sup>nd</sup>, (<a href="http://archives.postgresql.org/pgsql-sql/2006-10/msg00195.php">http://archives.postgresql.org/pgsql-sql/2006-10/msg00195.php</a>), CanI do this…?</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New"">INSERT INTO stock_deleted_tmp (</span></font><p class="MsoNormal"><font face="Courier New" size="2"><spanstyle="font-size:10.0pt; font-family:"Courier New""> code,</span></font><p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New""> description,</span></font><p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New""> date_deleted</span></font><p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New""> )</span></font><p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New""> DELETE FROM ONLY stock_tmp</span></font><p class="MsoNormal"><font face="Courier New" size="2"><spanstyle="font-size:10.0pt; font-family:"Courier New""> WHERE grp = '0001'</span></font><p class="MsoNormal"><font face="Courier New" size="2"><spanstyle="font-size:10.0pt; font-family:"Courier New""> RETURNING code, description, current_timestamp</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">At the moment I’m getting this error:</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">ERROR: syntax error at or near "DELETE"</span></font><p class="MsoNormal" style="text-indent:36.0pt"><font face="CourierNew" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">LINE 6: DELETE FROM ONLY stock_tmp</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Yes I have upgraded to PG 8.2:</span></font><p class="MsoNormal" style="text-indent:36.0pt"><font face="CourierNew" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">horseland=# DELETE FROM ONLY stock_tmpWHERE grp = '0001' RETURNING code, description, current_timestamp;</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> code | description | now</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">--------+--------------------------------------+-------------------------------</span></font><pclass="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 920687| DEBRISOL 500ML | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 460950| ROMA BASIC BUZZ OFF F/MSK SND/BRN S | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 460951| ROMA BASIC BUZZ OFF F/MSK SND/BRN M | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 460952| ROMA BASIC BUZZ OFF F/MSK SND/BRN L | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 460953| ROMA BASIC BUZZ OFF F/MSK SND/BRN XL | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New""> 402832| COMB PLASTIC BALL BLK | 2006-12-07 09:57:37.434605+11</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">(6 rows)</span></font><pclass="MsoNormal"><font face="Courier New" size="2"><span style="font-size:10.0pt; font-family:"Courier New""> </span></font><p class="MsoNormal" style="text-indent:36.0pt"><font face="Courier New" size="2"><spanstyle="font-size:10.0pt;font-family:"Courier New"">DELETE 6</span></font><p class="MsoNormal" style="text-indent:36.0pt"><fontface="Courier New" size="2"><span style="font-size:10.0pt;font-family:"Courier New"">horseland=#</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Thanks,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">-p</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Phillip Smith<br /> IT Coordinator<br /> Weatherbeeta P/L<br /></span></font><font face="Arial" size="2"><spanstyle="font-size:10.0pt;font-family: Arial">8 Moncrief Rd</span></font><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial"><br/> Nunawading, VIC, 3131<br /></span></font><font face="Arial" size="2"><spanstyle="font-size:10.0pt;font-family: Arial">AUSTRALIA</span></font></div><br /><p><b>*******************Confidentialityand Privilege Notice*******************</b><p> The material contained in this messageis privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsiblefor delivery of the message to such person, you may not copy or deliver this message to anyone, and you shoulddestroy it and kindly notify the sender by reply email. <p> Information in this message that does not relate to theofficial business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees,contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmissionof this message or any attachments <br />