Board index » delphi » Oracle and BDE, case sensitive!?

Oracle and BDE, case sensitive!?

using TQuery with RequestLive := True, an stantement like:

select cod, name from table

do not work!! I need to use like this:

select COD, NAME from TABLE

why this happen?? It's a nightware, I have a app runing fine under MSSQL and
IB, know I'm converting to run under ORACLE as well, but if I will have to
rewrite every SELECT........ :((

is this configurable in Oracle server?

TIA

 

Re:Oracle and BDE, case sensitive!?


Oracle isn't case sensitive.  I believe the BDE is when dealing with
Oracle.

You could swap out the BDE for a different connection layer to eliminate
this and other problems...

Eric

Re:Oracle and BDE, case sensitive!?


"Eric Hill" <e...@ijack.net> escreveu na mensagem
news:3eef6c96$1@newsgroups.borland.com...

Quote
> Oracle isn't case sensitive.  I believe the BDE is when dealing with
> Oracle.

> You could swap out the BDE for a different connection layer to eliminate
> this and other problems...

yeah, sure, I would love swap BDE :)
But I dont have the time to do that much!!

I will eventualy swap to DBX, but... I cant do it right now

Lets check over BDE why its doing that case problem

[]s

Re:Oracle and BDE, case sensitive!?


Quote
Feijs wrote:
> Lets check over BDE why its doing that case problem

        The BDE double-quotes identifiers when RequestLive is true.  Under the
SQL standard this is a delimited identifier and must be case-sensitive.

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
Useful articles about InterBase and Delphi development:
  http://delphi.weblogs.com/articles

Re:Oracle and BDE, case sensitive!?


Only over Oracle??

When I connect to MSSQL or IB, works fine ...

"Craig Stuntz [TeamB]" <cstu...@vertexsoftware.com> escreveu na mensagem
news:3eef7e4a$2@newsgroups.borland.com...

Quote
> Feijs wrote:

> > Lets check over BDE why its doing that case problem

> The BDE double-quotes identifiers when RequestLive is true.  Under the
> SQL standard this is a delimited identifier and must be case-sensitive.

Re:Oracle and BDE, case sensitive!?


Quote
Feijs wrote:
> Only over Oracle??

> When I connect to MSSQL or IB, works fine ...

        IB SQL dialect 1 does not conform to this part of the SQL standard.
SQL dialect 3 does and exhibits the same problem.  In MS SQL Server,
it's a global option on the server or DB, IIRC.  Turn it on and you'll
see the same problem.

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase PLANalyzer 1.1 -- Free InterBase query optimization
  tool: http://delphi.weblogs.com/IBPLANalyzer

Re:Oracle and BDE, case sensitive!?


Quote
>Oracle isn't case sensitive.  I believe the BDE is when dealing with
>Oracle.

Oracle (with the BDE) *BECOMES* case-sensitive, when you use "live"
queries!

However, what happens normally in Oracle is this: if you create a
table called "MyTable", using a statement like this:

create table MyTable .......

then Oracle really stores "MYTABLE" in its data dictionary.

When you try to access that by means of a live BDE query, you have to
make sure to have the table name ALL CAPITALIZED, otherwise it won't
find a match ....

select * from MyTable would fail.

On the other hand, if you ever create a table in Oracle like so:

create table "MyTable"

then you've created a mixed-case table name which Oracle will leave as
is, but in this case, you'll have difficulty accessing the data from a
BDE app.

Marc

================================================================
Marc Scheuner                        May The Source Be With You!
Bern, Switzerland                         m.scheuner(at)inova.ch

Re:Oracle and BDE, case sensitive!?


Feijo,

Oracle isn't ANSI SQL-92 compliant. As such, you have more to worry about
than
just capitalization on table names with Oracle, if you have been developing
using MS SQL
or Interbase and not thinking Oracle in the back of your mind.

JOIN statements will kill you. Anything with an INNER JOIN needs to be in
the WHERE
clause, and anything with an OUTER JOIN has to be re-written for Oracle.
i.e.
  If {Oracle}
     then ...
     else ...

NULLs are handled differently in MS SQL/Interbase and Oracle. In MS SQL/IB
you can
do:
   SELECT ... FROM table WHERE field = ''

In MS SQL/IB it returns rows where field is null. Oracle does not. You need
to recode
it as:
    SELECT ... FROM table WHERE (field = '' OR field IS NULL)

and there are others. Integer fields, Long text fields, difference between
type names, handling
of numeric(x,y) fields, etc., etc.

If you haven't been thinking Oracle in the back of your mind during
development, then you are
going to have to test every SQL statement again. Getting 95% of your
statements to work by
making some switch change isn't going to help you. Consider this a blessing.
You are going to
have to revisit every SQL statement and manually check to see if it is going
to work against
Oracle.

Thanks,

Brett

Quote
"Feij" <fe...@x.suply.com> wrote in message

news:3eef699e@newsgroups.borland.com...
Quote
> using TQuery with RequestLive := True, an stantement like:

> select cod, name from table

> do not work!! I need to use like this:

> select COD, NAME from TABLE

> why this happen?? It's a nightware, I have a app runing fine under MSSQL
and
> IB, know I'm converting to run under ORACLE as well, but if I will have to
> rewrite every SELECT........ :((

> is this configurable in Oracle server?

> TIA

Re:Oracle and BDE, case sensitive!?


Quote
> Oracle isn't case sensitive.  I believe the BDE is when dealing with
> Oracle.

Wrong
Oracle is case sensitive, but the standard inside is to capitalize your
entries.
You can test it, if you enter in any oracle tool a command like

create table "Tabelle" ("Feld" charchar2(10));

and you will see that you have a table with upper and lower case and even
the field is mixed.

Regards

Nicolas

Re:Oracle and BDE, case sensitive!?


Quote
> Oracle isn't ANSI SQL-92 compliant. As such, you have more to worry about

Well, Oracle 7 and 8 aren't.  They're SQL 89 compliant.  Oracle 9 is SQL 92
compliant.

Quote
> NULLs are handled differently in MS SQL/Interbase and Oracle. In MS
SQL/IB
> you can
> do:
>    SELECT ... FROM table WHERE field = ''

> In MS SQL/IB it returns rows where field is null. Oracle does not. You
need
> to recode
> it as:
>     SELECT ... FROM table WHERE (field = '' OR field IS NULL)

Oracle treats NULL differently from an empty string in the WHERE clause.
This is part of the SQL 92 spec...

Eric

Re:Oracle and BDE, case sensitive!?


IMO the best BDE replacement is SQL Direct. It does not have TTable
equivalent, for the rest, you just do a search/replace TQuery with TSDQuery,
TDatabase with TSDDatabase,... and everything is functionally the same, only
ligher and faster.
Slightly more work is just to have live queries, it does not have
RequestLive property, but you have to use an UpdateObject (just like
CachedUpdates with BDE).
I converted a big BDE project to SQL-Direct in few hours.

The reason for case sensitivity is because Oracle *is* case sensitive. You
can have THETABLE, TheTable, theTable. When you use canned query, the SQL is
passed as-is and server does the best match, but with RequestLive, BDE
quotes object names, so they must be exact match:
//considering above table names
select * from thetable  //this works, but gets one of above tables
select * from "thetable"  //this does not work
select * from "THETABLE"  //this works
select * from "TheTable"  //this works

--
Robert Cerny
http://codecentral.borland.com/codecentral/ccWeb.exe/author?authorid=...

Quote
"Feij" <fe...@x.suply.com> wrote in message

news:3eef6e1e$1@newsgroups.borland.com...
Quote

> yeah, sure, I would love swap BDE :)
> But I dont have the time to do that much!!

> I will eventualy swap to DBX, but... I cant do it right now

> Lets check over BDE why its doing that case problem

Re:Oracle and BDE, case sensitive!?


Quote
Eric Hill wrote:

> Oracle treats NULL differently from an empty string in the WHERE clause.
> This is part of the SQL 92 spec...

Oracle will not store the empty string (at least through 9.2).  It always stores
NULL.  Oracle admits this is non compliant behavior and warns that they might
change this to come into compliance in the future.

BTW, InterBase has always done this correctly and not treated the two the same
unlike the original poster stating the opposite.

Quote
> Eric

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
If there is somebody up there could they throw me down a line.  Just a
little helping hand just a little understanding.  Just some answers to the
questions that surround me now.  If there's somebody up there could
they throw me down a line.               (Fish)

Re:Oracle and BDE, case sensitive!?


Quote
> > Oracle treats NULL differently from an empty string in the WHERE clause.
> > This is part of the SQL 92 spec...

> Oracle will not store the empty string (at least through 9.2).  It always
stores
> NULL.  Oracle admits this is non compliant behavior and warns that they
might
> change this to come into compliance in the future.

Correct - but it follows compliance in the WHERE clause.  Go figure.

Eric

Other Threads