Hi Mark!

Sorry for the delayed answer.

Thanks for the explanation, I get it too, although it works a little weird.

I tested it in IBExpert, it works "well" under ISQL.

The IBExpert preprocessor seems to have misunderstood something.

Thanks!

András

-----Original Message-----
From: Mark Rotteveel [mailto:m...@lawinegevaar.nl] 
Sent: Sunday, June 13, 2021 9:57 AM
To: firebird-devel@lists.sourceforge.net
Subject: Re: [Firebird-devel] Stored procedure call and parameter concatenation 
outside the parentheses

On 13-06-2021 07:48, Omacht András wrote:
[..]
> Why is a valid call any of the above? How is concatenation possible 
> outside the parentheses?
> 
> And, if valid, why is the concatenated text not the result in all cases?
> 
> 2.5, 3.0 and 4.0 is affected too.
> 
> Should I create a ticket, or is it the expected behavior?

The problem is related to the fact that the parentheses in EXECUTE PROCEDURE 
are optional, so

execute procedure ex('Exception ') || 'message';

is equivalent to

execute procedure ex(('Exception ') || 'message');

That is, the value passed as an argument is not `'Exception'`, but the 
expression `('Exception') || 'message'`.

So, this part is not a bug as far as I'm concerned, just a weird corner case 
due to ambiguous syntax.

The second part of your question, I cannot reproduce. In both cases the result 
is an exception with message 'exception message', not just 'message'. How are 
you executing this?

The result in ISQL is:

SQL> execute procedure ex('Exception') || 'message';
Statement failed, SQLSTATE = HY000
exception 1
-GL_EX
-Exceptionmessage
-At procedure 'EX' line: 9, col: 3
SQL> execute procedure ex('Exception ') || 'message';
Statement failed, SQLSTATE = HY000
exception 1
-GL_EX
-Exception message
-At procedure 'EX' line: 9, col: 3
SQL> execute procedure ex('Exception') || ' message';
Statement failed, SQLSTATE = HY000
exception 1
-GL_EX
-Exception message
-At procedure 'EX' line: 9, col: 3
SQL>
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to