Re: 9th's bug
Posted in 2005
Topics: Stored Procedures & SPL, Data Types & Schema Design, Versions, Editions & End-of-Life
I find this very interesting :
EXECUTE PROCEDURE p( ( SELECT f FROM t2 ) );
And the argument to p is a nvarchar(10)...
What is "rotor" trying to do?
What about if the select on t2 returns more than one row?
J.
Jonathan Leffler wrote:
> rotor wrote:
>
>>Hi community!
>>
>>IDS 9.40.TC6
>>
>>CREATE TABLE t1 ( f NVARCHAR( 10 ) );
>>CREATE TABLE t2 ( f NVARCHAR( 10 ) NOT NULL );
>>CREATE PROCEDURE p( p CHAR( 10 ) ) END PROCEDURE;>>
>>EXECUTE PROCEDURE p( ( SELECT f FROM t2 ) );>>-- Oops! SQL Error (-674) : Routine (p) can not be resolved.
>>
>>But if the folowed SQL will be executed first:
>>EXECUTE PROCEDURE p( ( SELECT f FROM t1 ) );>>then the problematic statement also works properly. Funny?
>>
>>Any comments awaiting...
>
>
>
> It sounds suspiciously like:
> B172186 EXECUTE PROCEDURE STATEMENT RETURNS 674 ERROR WHEN RUN FIRST TIME.
>
>
sending to informix-list
Jean Sagi wrote:
> I find this very interesting :
>
> EXECUTE PROCEDURE p( ( SELECT f FROM t2 ) );>
> And the argument to p is a nvarchar(10)...
>
> What is "rotor" trying to do?
>
> What about if the select on t2 returns more than one row?
>
> J.
Should be the same error as when you do:
1 + (select f from t2)
At the end of the day (select f from t2) is just a (scalar) expression.
I presume if t2 has no rows the result of the scalar subquery is
NULL::NVARCHAR(10)?
Cheers
Serge
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab