Subject | decision help needed |
---|---|
Author | Roman Rokytskyy |
Post date | 2002-10-16T19:24:27Z |
Dear All,
We have a bug in our driver in converting column name into column
position. This bug is connected to the SQL dialect 3. In most cases
Java developers use unquoted identifiers in our queries. In SQL
dialect 1 (and this is preserved in SQL dialect 3), they are case
insensitive. However, on the server side they are converted to the
upper case. So, actually 'col1' is a 'COL1' (I use single quotes here
to mark a string to avoid using double quotes). And 'COL1' is the name
of the column we get from the server in an XSQLVAR structure. However,
in SQL dialect 3 one can create column "col1" and server will return
it as 'col1'.
At present time in the driver code we convert column name in
getXXX(String) method to the upper case to make perform search in the
XSQLVAR structure. It is clear that this will not work for "col1".
My suggestion is the following:
If a column name starts with double quote (for example,
getString("\"col1\"") != getString("col1")), we do not convert it into
upper case, otherwise we convert column name into upper case (for
example, getString("col1") == getString("COL1")).
What do you think? Any other ideas?
Thanks in advance for your comments!
Roman Rokytskyy
We have a bug in our driver in converting column name into column
position. This bug is connected to the SQL dialect 3. In most cases
Java developers use unquoted identifiers in our queries. In SQL
dialect 1 (and this is preserved in SQL dialect 3), they are case
insensitive. However, on the server side they are converted to the
upper case. So, actually 'col1' is a 'COL1' (I use single quotes here
to mark a string to avoid using double quotes). And 'COL1' is the name
of the column we get from the server in an XSQLVAR structure. However,
in SQL dialect 3 one can create column "col1" and server will return
it as 'col1'.
At present time in the driver code we convert column name in
getXXX(String) method to the upper case to make perform search in the
XSQLVAR structure. It is clear that this will not work for "col1".
My suggestion is the following:
If a column name starts with double quote (for example,
getString("\"col1\"") != getString("col1")), we do not convert it into
upper case, otherwise we convert column name into upper case (for
example, getString("col1") == getString("COL1")).
What do you think? Any other ideas?
Thanks in advance for your comments!
Roman Rokytskyy