Home > Back-end > Delphi a potential problem: open the cursor statement behind, and assignment is given no effect!
Delphi a potential problem: open the cursor statement behind, and assignment is given no effect!
Time:04-17
Delphi7 invoke MySql stored procedures, under the open the cursor in the process of storage, give and assign a value to the stored procedure, can not get out the parameter values, as shown below: Create procedure MyProc (in inpara varchar (20), the out outpara varchar (100)) The begin . Declare cur1 cursor for the select id from table1; The open cur1; The set outpara='ABC';//as long as in the open cur1; Behind the statement, won't get outpara values, are shown as empty, . end; To solve!
CodePudding user response:
Outpara='ABC';
CodePudding user response:
Outpara='ABC'; Don't have to add in front of the set?? So no, warrior
CodePudding user response:
Online urgent, estimates that this is a potential problem, the altar to also can't solve!!!
CodePudding user response:
When you check, whether because of the open to the exception, lead to the code and didn't perform, can add exception handling,
CodePudding user response:
Without exception, in Navicat Premium in debugging the parameter values can be extracted, the cursor is a very simple query, after opening, do nothing, just close the cursor, followed by a given assignment,