1. Juan Carlos Rojas
  2. PowerBuilder
  3. Wednesday, 3 July 2019 14:08 PM UTC

Hello. I have a problem. Appears this message my application "cursor is not open". This message appears just in some machines. Others that have the same application does not have the error. Can you help me? please.

The machines are Windows 10, the DB is Oracle 11g. The software is developed with Appeon Power Builder 2017 R3.

The code is:

Declare lcur_indicador cursor for
SELECT "WEB_INDICA"."CD_INDICA_WEB", 
"WEB_INDICA"."NM_INDICA_WEB" 
FROM "WEB_INDICA" ORDER BY "WEB_INDICA"."CD_INDICA_WEB" ASC
Using SQLCA;

Open lcur_indicador;

If (SQLCA.sqlcode < 0) then
MessageBox ("Base de Datos", "ERROR-0 : " + &
SQLCA.sqlerrtext, StopSign!)
return
end if 

do while (SQLCA.sqlcode = 0)
fetch lcur_indicador into :li_cod_indicador, :ls_nom_indicador;
if (SQLCA.sqlcode = 0) then
ls_total = String(li_cod_indicador) + ' ' + RightTrim(ls_nom_indicador)
ddlb_indicador.AddItem (ls_total)
elseif (SQLCA.sqlcode < 0) then
MessageBox ("Base de Datos", "Error en fetch de lcur_indicador : " + &
SQLCA.sqlerrtext, exclamation!)
return
else
exit
end if
loop
ddlb_indicador.SetRedraw(true)

Close lcur_indicador;

 

Thanks

 

Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 3 July 2019 15:43 PM UTC
  2. PowerBuilder
  3. # 1

Hey Juan, 2 comments:

#1 :: At what line does the error occur?

Has cursor returned any rows before this?
What is actual value of SQLCA's SQLCode and SQLErrText after OPEN when error occurs?
What is actual value of SQLCA's SQLCode and SQLErrText exactly when error occurs?
Does your SQLCA use custom transaction subclass so that you can look at parameter values of its SQLPrevie and DBError event when the error occurs?

 

#2 :: Why not use a DataStore?

Why not copy SELECT into new DW object and use DataStore to retrieve and handle errors?

  1. Less code to maintain
  2. DataStore is faster than any embedded SQL you write

Converting DDLB to DDDW is more work but use DataStore as "Data Source" for DDLB is straightforward.

 

HTH /Michael

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.