OraScript: macro inside string constant

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

OraScript: macro inside string constant

Post by m.ghilardi » Tue 08 Jul 2014 07:23

Using sqlplus I used to put macros inside scripts pretty much everywhere, even inside strings. I've found that this is impossible in ODAC. For instance, this script has a macro:

Code: Select all

create or replace package pkg_str is
  function get_str return varchar2 deterministic;
end;
/

create or replace package body pkg_str as
  function get_str return varchar2 deterministic
  is begin
    return 'the macro is &1';
  end;
end;
/
Of course I can rewrite the script and put the macro outside the quotes ('the macro is '||&1). Apart from the loss in performance, which is not a big deal, the rewriting process becomes annoying in those scripts where I have the same macro inside AND outside quotes.

My guess is that this feature has been removed after this bug report. Am I right?

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

Re: OraScript: macro inside string constant

Post by AlexP » Tue 08 Jul 2014 09:31

Hello,

In previous and current versions (even before fixing the specified behavior), both macros and parameters were ignored if they were quoted. All symbols in quotes are treated as strings.

m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

Re: OraScript: macro inside string constant

Post by m.ghilardi » Tue 08 Jul 2014 13:06

Then I'll go ahead and change my scripts. Thanks for the prompt reply.

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

Re: OraScript: macro inside string constant

Post by AlexP » Thu 10 Jul 2014 11:34

If you have any further questions, feel free to contact us.

Post Reply