SQl Query

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fire.tiger
Posts: 9
Joined: Thu 31 Jan 2008 20:29

SQl Query

Post by fire.tiger » Tue 25 Mar 2008 17:05

Hello,

I have just simple question. It is not critical, but just interests me.

I'm using TOraQuery.
When I run this SQL :

Code: Select all

select * from JOBS
everything works nice.
But when I use

Code: Select all

select * from JOBS;
(including semi-colon)
then an OraError is raised - invalid character.

I'm using Query.ExecSQL procedure.

Why? When I'm using SQL statement including semi-colon
in (for example) SQL command line, it works...

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Wed 26 Mar 2008 09:31

The point is: the ";" is not a valid part of a sql statement.

The definition of the ";" cames from the sql*plus.

SQL*plus uses the ";" to separate sql statements. Additional it uses the "/" for pl/sql blocks.
So the ";" is a separator and TOraQuery doesn't support the separators. They are only support by the TOraScript.

Greetings
Jens

Andreas Heinrich
Posts: 5
Joined: Tue 22 Nov 2005 07:26
Location: Germany

Post by Andreas Heinrich » Wed 18 Jun 2008 15:11

Hi,

you might be right with the ";" to Oracle.

But SDAC supports ";" in TMSQuery! And this difference between SDAC and ODAC is a problem for me.


Thanks.
Andreas

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 19 Jun 2008 14:14

You can archive similar result in Oracle using PL/SQL block. Include seperated by ";" statements into BEGIN END; block.

Post Reply