Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Odbc > ODBC NLS Proble...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2349 of 2382
Post > Topic >>

ODBC NLS Problem

by salmanpostgresgeek@[EMAIL PROTECTED] ("salman razzaq") Apr 24, 2008 at 06:33 PM

------=_Part_6374_7386364.1209044028544
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,
   I just ran into a problem while calling a function using ODBC. The
function name is in japenese.

OS = Ubuntu, 7.10

But, when I call the function  using the following syntax

{ ? = call $B;2>H%+!<%=%k(B_inout_callee2(?,?)}

the server throws me a syntax error. when analyzing the server logs, I
found
that call is replaced with SELECT * FROM. The query actually passing to
the
server is

SELECT * FROM$B;2>H%+!<%=%k(B_inout_callee2('','') .

When further analyzing the query, I found that there was no space between
FROM keyword and procedure name.

Then, I debug the ODBC source code, I found the problem in convert.c at
function inner_process_tokens. But, I am confused over here why we need
this
condition (condition is bolded). Below is the code snippet.


         /*
          * Handle literals (date, time, timestamp) and ODBC scalar
          * functions
          */
         else if (oldchar == '{')
         {
                 if (SQL_ERROR == convert_escape(qp, qb))
                 {
                         if (0 == qb->errornumber)
                         {
                                 qb->errornumber = STMT_EXEC_ERROR;
                                 qb->errormsg = "ODBC escape convert
error";
                         }
                         mylog("%s convert_escape error\n", func);
                         return SQL_ERROR;
                 }
*                 if (isalnum((UCHAR)F_OldPtr(qp)[1]))*
                         CVT_APPEND_CHAR(qb, ' ');
                 return SQL_SUCCESS;
         }


The condition says that if the first character of the function name is
alpha
numeric, then append the space character. From man pages of isalnum, it
says
that for "C" locale characters, it will return true. This means that ASCII
characters will be considered.

Any help will be appreciated.


Thanks.

------=_Part_6374_7386364.1209044028544
Content-Type: text/html; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,<br>&nbsp;&nbsp; I just ran into a problem while calling a function
using ODBC. The function name is in japenese.<br><br>OS = Ubuntu,
7.10<br><br>But, when I call the function&nbsp; using the following
syntax<br><br>{ ? = call $B;2>H%+!<%=%k(B_inout_callee2(?,?)}<br>
<br>the server throws me a syntax error. when analyzing the server logs, I
found that call is replaced with SELECT * FROM. The query actually passing
to the server is <br><br>SELECT *
FROM$B;2>H%+!<%=%k(B_inout_callee2(&#39;&#39;,&#39;&#39;) .<br>
<br>When further analyzing the query, I found that there was no space
between FROM keyword and procedure name.<br><br>Then, I debug the ODBC
source code, I found the problem in convert.c at function
inner_process_tokens. But, I am confused over here why we need this
condition (condition is bolded). Below is the code snippet.<br>
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Handle
literals (date, time, timestamp) and ODBC
scalar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
functions<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (oldchar ==
&#39;{&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (SQL_ERROR == convert_escape(qp, qb))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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s convert_escape error\n&quot;,
func);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return
SQL_ERROR;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (isalnum((UCHAR)F_OldPtr(qp)[1]))</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CVT_APPEND_CHAR(qb, &#39;
&#39;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return SQL_SUCCESS;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br><br><br>The condition says that if the first character of the
function name is alpha numeric, then append the space character. From man
pages of isalnum, it says that for &quot;C&quot; locale characters, it
will return true. This means that ASCII characters will be considered.<br>
<br> Any help will be appreciated.<br><br><br>Thanks.<br><br><br>

------=_Part_6374_7386364.1209044028544--




 1 Posts in Topic:
ODBC NLS Problem
salmanpostgresgeek@[EMAIL  2008-04-24 18:33:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 9:15:50 CDT 2008.