![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here are the first few lines of a PROCEDURE: my_procedure: create procedure my_procedure( in a_p_id bigint, in a_region_id integer, in a_a_date timestamp, in a_a_flag character ) Calling it normally works fine: call my_procedure (0245674,3,NULL,'Y') But I'd like to call my_procedure where the parameters come from a SELECT statement. Something like this (which doesn't work): call my_procedure (select p_id,region_id,a_date,a_flag from people where b_id= 700050188 and t_flag='Y' ); I understand that I can create another procedure that declares a P_cursor and calls my_procedure in a LOOP. But does syntax exist to execute my_procedure where the parameters come from a SELECT statement? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I'm getting this error: DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0440N No authorized routine named "MY_PROCEDURE" of type "PROCEDURE" having compatible arguments was found. LINE NUMBER=10. SQLSTATE=42884 But the arguments look like they should be okay. |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
I can define the function - but now get this error: 51034(-740)[IBM][CLI Driver][DB2/SUN64] SQL0740N Routine "my_f1" (specific name "SQL120118130715600") is defined with the MODIFIES SQL DATA option, which is not valid in the context where the routine is invoked. SQLSTATE=51034 (0.02 secs) Both the procedure and function have a "modifies sql data" option. |
![]() |
| Thread Tools | |
| Display Modes | |
| |