<font color='black' size='2' face='Arial, Helvetica, sans-serif'><font color="black" face="Arial, Helvetica, sans-serif" size="2">
<div> Hi <font color="black" face="Arial, Helvetica, sans-serif" size="2">Seven Du</font>,<br>
<br>
I'd really like to know if this is possible too, couldn't find it documented anywhere.<br>
<br>
Instead of being cryptic, if you know the answer won't you please help by explaining what the RETURNING clause is and how to use it?<br>
<br>
Does it somehow return mysql_insert_id()?<br>
<br>
How should we use it.<br>
<br>
You help is invaluable and is contributing to the freeswitch community.<br>
<br>
-Jm<br>
</div>
<div> <br>
</div>
<div> <br>
</div>
<div style="font-family:helvetica,arial;font-size:10pt;color:black">-----Original Message-----<br>
From: Seven Du <dujinfang@gmail.com><br>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org><br>
Sent: Sat, May 25, 2013 12:52 pm<br>
Subject: Re: [Freeswitch-users] dbh:query - insert id<br>
<br>
<div id="AOLMsgPart_2_72ff3194-ad1d-4464-9fa2-66798543a5c4">
<div>
Maybe try the RETURNING clause ?
</div>
<div>
<div><br>
</div>
<div>-- </div>
<div>Seven Du</div>
<div><span style="font-size: 10pt; "><a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a></span></div>
<div><a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a></div>
<div>
<div><a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a></div>
</div>
<div><br>
</div>
<div>Sent with <a target="_blank" href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div>
<div><br>
</div>
</div>
<div style="color: #A0A0A8;">On Saturday, May 25, 2013 at 8:14 AM, Lloyd Aloysius wrote:</div>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span>
<div>
<div>
<div><font face="verdana, sans-serif">
<div>
<div><font face="verdana, sans-serif">
<div>Hello All</div>
<div><br>
</div>
<div>How to get the id value after insert a record a record using dbh:query</div>
<div><br>
</div>
<div><u>table_a - columns</u>.</div>
<div><br>
</div>
<div>id - auto increment</div>
<div>field1</div>
<div>field2</div>
<div><br>
</div>
<div><br>
</div>
<div>dbh:query("insert into table_a ( field1,field2) values ('11','Test')")</div>
<div>
<br>
</div>
<div><br>
</div>
<div>After insert how to get the table_a - id value for the inserted record?</div>
<div><br>
</div>
<div>Thanks</div>
<div>Lloyd</div>
</font></div>
</div>
</font></div>
</div>
<div>
<div>_________________________________________________________________________</div>
<div>Professional FreeSWITCH Consulting Services:</div>
<div><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></div>
<div><a target="_blank" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></div>
<div><br>
</div>
<div>FreeSWITCH-powered IP PBX: The CudaTel Communication Server</div>
<div><a target="_blank" href="http://www.cudatel.com">http://www.cudatel.com</a></div>
<div><br>
</div>
<div>Official FreeSWITCH Sites</div>
<div><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a></div>
<div><a target="_blank" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a></div>
<div><a target="_blank" href="http://www.cluecon.com">http://www.cluecon.com</a></div>
<div><br>
</div>
<div>FreeSWITCH-users mailing list</div>
<div><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></div>
<div><a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></div>
<div>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></div>
<div><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a></div>
</div>
</div>
</span>
</blockquote>
<div>
<br>
</div>
</div>
<div id="AOLMsgPart_3_72ff3194-ad1d-4464-9fa2-66798543a5c4" style="margin: 0px;font-family: Tahoma, Verdana, Arial, Sans-Serif;font-size: 12px;color: #000;background-color: #fff;">
<pre style="font-size: 9pt;"><tt>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>
Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</tt></pre>
</div>
<!-- end of AOLMsgPart_3_72ff3194-ad1d-4464-9fa2-66798543a5c4 -->
</div>
</font></font>