![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am running SQL Anywhere 9.0.2 on Windows XP and just applied the latest EBF, 9.0.2.3850, and now a sotred procedure that worked without error on 9.0.2.3137, gives the following error: 'Error at line 1' 'proc_name returned a result set with a different schema than expected' This makes no sense to me at all. Does anyone know if stored procedure behavior or syntax or who knows what changed that would cause this error? Thanks in advance, |
#3
| |||
| |||
|
|
Jon, Are you using the stored procedure in the from clause of a SELECT statement? If so, then be advised that the result set that the procedure returns MUST match either the WITH clause or the RESULT clause on the procedure declaration. Karim Jon Springs wrote: I am running SQL Anywhere 9.0.2 on Windows XP and just applied the latest EBF, 9.0.2.3850, and now a sotred procedure that worked without error on 9.0.2.3137, gives the following error: 'Error at line 1' 'proc_name returned a result set with a different schema than expected' This makes no sense to me at all. Does anyone know if stored procedure behavior or syntax or who knows what changed that would cause this error? Thanks in advance, |
#4
| |||
| |||
|
|
Jon, Are you using the stored procedure in the from clause of a SELECT statement? If so, then be advised that the result set that the procedure returns MUST match either the WITH clause or the RESULT clause on the procedure declaration. Karim Jon Springs wrote: I am running SQL Anywhere 9.0.2 on Windows XP and just applied the latest EBF, 9.0.2.3850, and now a sotred procedure that worked without error on 9.0.2.3137, gives the following error: 'Error at line 1' 'proc_name returned a result set with a different schema than expected' This makes no sense to me at all. Does anyone know if stored procedure behavior or syntax or who knows what changed that would cause this error? Thanks in advance, |
#5
| |||
| |||
|
|
Yes, I am using the stored procedure in a select statement. The documentation mentions returning a variable number of columns and does not describe a 'return' or 'with' requirement. This procedure does return 3 or 4 columns depending on a condition passed to it. |
#6
| |||
| |||
|
|
Jon, A procedure can return different result sets with different schemas based on how it is called or what execution path is taken within the procedure, but that only works well when the procedure is explicitly called. When the procedure is used in the from clause of a select statement, the expected result set's schema needs to be well defined and declared up front using either the WITH clause or the RESULT clause. Check the documentation for difference between calling a procedure directly and calling it within the from clause. Karim Jon Springs wrote: Yes, I am using the stored procedure in a select statement. The documentation mentions returning a variable number of columns and does not describe a 'return' or 'with' requirement. This procedure does return 3 or 4 columns depending on a condition passed to it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |