<div dir="ltr"><div><div>i am  testing  a script      new_chat.lua    script is below<br></div><br>#!/usr/bin/lua<br>local dbh = freeswitch.Dbh(&quot;odbc://dbname:db_username:db_passwd&quot;) -- connect to ODBC database <br>
assert(dbh:connected()) -- exits the script if we didn&#39;t connect properly<br><br>if dbh:connected() == false then<br>   freeswitch.consoleLog(&quot;ALERT&quot;, &quot;lua cannot connect to database&quot; .. dsn .. &quot;\n&quot;);<br>
end<br><br>sql_query    = &quot;SELECT * FROM cc_card WHERE id =&#39;197&#39;&quot;<br>dbh:query(sql_query ,function(row)<br>for key, val in pairs(row) do   <br>key = val<br>end<br> freeswitch.consoleLog(&quot;INFO&quot;,&quot; inside  QUERY lastname = &quot; .. row.lastname .. &quot;\n&quot;);<br>
freeswitch.consoleLog(&quot;INFO&quot;,&quot; inside  QUERY  redial = &quot; .. row.redial .. &quot;\n&quot;);<br>end)<br><br>freeswitch.consoleLog(&quot;INFO&quot;,&quot; outside  QUERY  lastname = &quot; .. row.lastname .. &quot;\n&quot;);<br>
freeswitch.consoleLog(&quot;INFO&quot;,&quot;  outside  QUERY    redial = &quot; .. row.redial .. &quot;\n&quot;);<br><br>freeswitch.consoleLog(&quot;INFO&quot;,&quot; outside  QUERY  lastname = &quot; .. lastname .. &quot;\n&quot;);<br>
freeswitch.consoleLog(&quot;INFO&quot;,&quot;  outside  QUERY    redial = &quot; .. redial .. &quot;\n&quot;);<br><br>dbh:release() -- optional<br><br></div>but here is some problum    in this script  inside query lines are  working  but outside query lines  are not working  WHY  ??   <br>
 any suggestions are very wellcome<br></div>