on 10-26-2012 8:40 AM
Hi experts
I have the following problem:
I try to implement a requirement where I need recursive procedure calls. I have a procedure that calls another procedure that, in certain cases, calls the first one again. If I try to activate the procedure I get a "invalidated procedure" "at ptime/query/checker/check_call.cc:308" error. Is it possible to have recursive procedure calls, if yes, what do I have to do to get them activated? Or does this error message mean something colpletely else?
Regards
Stefan
Hi Stefan,
HANA have a different behavior when activating things.
When you try to activate a procedure or an object HANA will look for all called objects to create the "plan execution" optimized for this procedure/object considering everything that is called.
As your scenario is call back for HANA optimizer can't create the correct plan and reach this error.
On other languages it's totally difference because on activation you don't even need to check the called objects because their build code is totally independant.
Regards, Fernando Da Rós
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
I'm not engaged but I don't think there's a plan for this.
You still have one option, but I'll not go for it if it's impossible to survive without it.
You can the source one coding dynamic execution with command EXEC, see details in SQL Script guide, but see also the recomendation:
"Avoid Using Dynamic SQL: Executing dynamic SQL is slow because compile time checks and
query optimization must be done for every invocation of the procedure. Another related
problem is security because constructing SQL statements without proper checks of the
variables used may harm security."
And would also add that it's not trackeable, if the name or parameters of called procedure changes you may only face errors when runtime, so it's also a bad design use it.
Anyhow it's an option.
Regards, Fernando Da Rós
Hi,
I am interested on recursive calls too. Googling around, I found an interesting article about using SAP Hana, as follows:
It seems that at least of the members is a SAP employee. On the article page 376 (or the PDF page 14) we can see that SQLScript is handling recursive calls.
Do any of you guys were able to recursive call procedures, as described in the article, or are you still handling this with EXEC calls?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.