Manage OraKeywordLexems

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Manage OraKeywordLexems

Post by sinys » Mon 12 Aug 2013 15:45

We use OraScript for random users scripts from IDE for Oracle and one of the most common command it's SET DEFINE and SET FEED and other SET commands. Please do event for manage this keywords or even be add SET to ignore as PROMPT and REMARK.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Manage OraKeywordLexems

Post by AlexP » Tue 13 Aug 2013 08:32

Hello,

You can cancel execution of the SET command in the TOraSQL.BeforeExecute method as follows:

Code: Select all

procedure TForm1.OraScript1BeforeExecute(Sender: TObject; var SQL: String;
  var Omit: Boolean);
begin
  IF Pos('SET', UpperCase(Trim(SQL))) = 1 then
    Omit := True;
end;

dados
Posts: 82
Joined: Thu 18 Aug 2005 14:06

Re: Manage OraKeywordLexems

Post by dados » Tue 03 Sep 2013 20:00

What about a block like this:

begin
REM This is a comment
dbms_output.put_line('test');
end;

or a statement like this

select *
REM This is a comment
from dual

Can ODAC ignore these rem comment's?

Regards,
Arni Thor

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Manage OraKeywordLexems

Post by bork » Wed 04 Sep 2013 12:57

Why should ODAC ignore the REM statement? REM is not a comment directive in Oracle. If you need a comment, you should write SQL like this:

Code: Select all

begin
  /* This is a comment */
  dbms_output.put_line('test');
end;
or

Code: Select all

select *
/* REM This is a comment */
from dual

Post Reply