Problem with table name  
Author Message
none





PostPosted: 2006-8-11 19:30:00 Top

java-programmer, Problem with table name Hi!

I have a problem to access tables in an Informix Database. Table names
are something like that :
informix.pv_tvvte

When I try a "SELECT informix.pv_tvvte.numero_vente FROM
informix.pv_tvvte WHERE informix.pv_tvvte.numero_vente=#value#", (I use
ibatis and spring) I get a syntax error exception (SQLException "Bad SQL
Grammar").

If I replace dot with "_" in the name, I get a "Table Not Found" Exception.

How could I escape the dot in the tables names ?

TIA

Arnaud
 
Lee Fesperman





PostPosted: 2006-8-13 9:33:00 Top

java-programmer >> Problem with table name none wrote:
>
> Hi!
>
> I have a problem to access tables in an Informix Database. Table names
> are something like that :
> informix.pv_tvvte
>
> When I try a "SELECT informix.pv_tvvte.numero_vente FROM
> informix.pv_tvvte WHERE informix.pv_tvvte.numero_vente=#value#", (I use
> ibatis and spring) I get a syntax error exception (SQLException "Bad SQL
> Grammar").
>
> How could I escape the dot in the tables names ?

The normal solution is to use name delimiters. They surround the name and allow you to
use names that contain embedded special characters and are reserved words. For SQL92,
you use double quotes ("); can't tell you what Informix takes.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)