Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jean Sagi — — source: Usenet: comp.databases.informix
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
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.