Home > database >  PB + SQL cursor application problems
PB + SQL cursor application problems

Time:10-03

Wrote a column in the PB data validation function:
Int li_count
String sql_txt

If isnull (fs_to_check) or trim (fs_to_check)="" then return true

DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA;

String ls_var

Fs_what_column sql_txt="SELECT" + + "FROM" + fs_what_column fs_from_table + "where" + + "='" + fs_to_check +"' "+ fs_other_condition

PREPARE SQLSA FROM: sql_txt;
The OPEN DYNAMIC my_cursor;
The FETCH my_cursor INTO: ls_var;
The CLOSE my_cursor;

If len (ls_var) & gt; 0 then
Return true
The else
Return false
End the if

The question is: in the source program runtime execution result variable ls_var have value, but run into PBD, out of the same data variable ls_var is empty, why, please prawns teach,

CodePudding user response:

The cursor need not cycle?

CodePudding user response:

Execute only once in this function, is to find the column, the table name and search a value passed as a parameter, to check whether there is in the table,

CodePudding user response:

It doesn't have to cursor

CodePudding user response:

What's missing DLL

CodePudding user response:

Agree with upstairs

CodePudding user response:

The FETCH my_cursor INTO: ls_var;
Behind that add a language name
If the sqlca. Sqlcode & lt;> 0 then
F_stop (sqlca sqlerrtext)
End the if
Have a look at what's the problem
  • Related