Page 1 of 1

OraScript: macro inside string constant

Posted: Tue 08 Jul 2014 07:23
by m.ghilardi
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?

Re: OraScript: macro inside string constant

Posted: Tue 08 Jul 2014 09:31
by AlexP
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.

Re: OraScript: macro inside string constant

Posted: Tue 08 Jul 2014 13:06
by m.ghilardi
Then I'll go ahead and change my scripts. Thanks for the prompt reply.

Re: OraScript: macro inside string constant

Posted: Thu 10 Jul 2014 11:34
by AlexP
If you have any further questions, feel free to contact us.