Subject | Re: [Firebird-Java] decision help needed |
---|---|
Author | David Jencks |
Post date | 2002-10-16T20:56:26Z |
I think Roman's idea will work.
equalsIgnoreCase won't because in dialect 3 "Col1" and "cOL1" can both be
present and different columns.
Hmmm thinking about it marginally more... does the spec have instructions
for this? I'd prefer actually to start by trying an exact match, and if
that fails then try converting the input to uppercase and trying again. I
don't think we should need to escape-quote case sensitive column names to
get them to work.
thanks
david jencks
equalsIgnoreCase won't because in dialect 3 "Col1" and "cOL1" can both be
present and different columns.
Hmmm thinking about it marginally more... does the spec have instructions
for this? I'd prefer actually to start by trying an exact match, and if
that fails then try converting the input to uppercase and trying again. I
don't think we should need to escape-quote case sensitive column names to
get them to work.
thanks
david jencks
On 2002.10.16 16:32:15 -0400 Richard Bair wrote:
>
> If I'm way off disregard!
>
> It sounds like the String.equalsIgnoreCase() should be employed? You are
>
> just talking about comparing the column names, right?
>
>
>
>
>
> >From: "Roman Rokytskyy" <rrokytskyy@...>
> >Reply-To: Firebird-Java@yahoogroups.com
> >To: Firebird-Java@yahoogroups.com
> >Subject: [Firebird-Java] decision help needed
> >Date: Wed, 16 Oct 2002 19:24:27 -0000
> >
> >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
> >
>
>
> _________________________________________________________________
> Internet access plans that fit your lifestyle -- join MSN.
> http://resourcecenter.msn.com/access/plans/default.asp
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>