From: salman razzaq <salmanpostgresgeek@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: ODBC NLS Problem
Date: Thu, 24 Apr 2008 18:33:46 +0500
Message-ID: <39c59e6a0804240633g1578586fu96079d5100d4b328@mail.gmail.com> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: salmanpostgresgeek@gmail.com
Subject: Re: ODBC NLS Problem
In-Reply-To: <39c59e6a0804240633g1578586fu96079d5100d4b328@mail.gmail.com>
References: <39c59e6a0804240633g1578586fu96079d5100d4b328@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox