<div dir="ltr">Many thanks for your replay.<div><br></div><div style>How i can call <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">stored procedure in unlang ?</span></div><div style><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</span></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 5, 2013 at 1:50 AM, Arran Cudbard-Bell <span dir="ltr"><<a href="mailto:a.cudbardb@freeradius.org" target="_blank">a.cudbardb@freeradius.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 4 Mar 2013, at 16:36, Mehdi Ravanbakhsh <<a href="mailto:babakco@gmail.com">babakco@gmail.com</a>> wrote:<br>
<br>
> I need to transfer one radacc Table record to another table (backup radacc) , Transfer means insert in new table and Dell from first one and this is happen every time each user get [ Acct-Status-Type == 'Stop ] .<br>
><br>
> i use perl script to do some calculate and return 3 replay attribute and change 3 check attribute in radcheck table and Unlang just work to execute perl script .<br>
<br>
</div>Ok.<br>
<div class="im"><br>
><br>
> so in this case i need to use Perl in general but i can use unlang and Perl to connect and update database by SQL query i need to know that which one is faster and which way has more performance :<br>
><br>
> Perl Directly connecting to PostgreSQL database<br>
<br>
</div>Perl as you can select all the values in one query, or the fastest would be to create a stored procedure and call it with unlang, but i'm not that familiar with PgSQL procedures so I can't tell you how to do that.<br>
<div class="im"><br>
><br>
> OR<br>
><br>
> Use Unlang to connect to database by freeradius PGSQL database back-end.<br>
><br>
><br>
> and in final i am not understand meaning of " Likely unlang if you only want to retrieve one value." it means that is limitation SQL query in UnLang ?<br>
<br>
</div>Yes. Unlang/XLAT queries will only assign the value of the first column.<br>
<br>
update request {<br>
Tmp-String-0 = "%{sql:SELECT `a`, `b` FROM `foo` WHERE `bar` = 1;}"<br>
}<br>
<br>
Tmp-String-0 will only hold the value of column a.<br>
<div class="HOEnZb"><div class="h5">-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br>
</div></div></blockquote></div><br></div>