Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerBuilder 6.5: Did I find a bug?

Status
Not open for further replies.

montjoile

Programmer
May 23, 2011
23
CO
Hi. I'm consulting a database thru a datawindow. The user enters the number of a item, if it is out of range(if the number exceds or is lower of the registries in the db), a messagebox is showed. I tested it a couple of times, and i don't know why I get aleatory registries showed without any reason while the condition is passed
Below is my code: (clicked event of my button)

if sle_1.text="" then //if the user doesn't enter any number, I'll don't do anything
return 0;
else
if correl>=1 and correl<=il_max_correl then //if number is on the range
select buque
into:xg
from alumnospb.if_bq_bqs
where buque=:correl;


if isnull(xg) or xg=0 then //if the registry doesn't exist
messagebox("error", "registry not found")
do while isnull(xg) or xg=0 //I'll show the next item
correl++
select buque
into:xg
from alumnospb.if_bq_bqs
where buque=:correl;
loop
dw_1.retrieve(correl ) //shows the next item that exists
var=correl //I need correl for another consults
sle_1.text=""
else
dw_1.retrieve(xg) //shows the item if it does exists
sle_1.text=""
end if
else
messagebox("error", "registry out of range")
sle_1.text=""
dw_1.reset()
correl=0 //correl is always 0 before the event is activated!!!
end if
end if
xg=0

//if I start making a lot of consults that are out of range I ocassionaly get some weird numbers God know how powerbuilder obtains it. I'm pretty sure it is caused by a bug. Am I right?
 
I'd get rid of this
Code:
        do while isnull(xg) or xg=0  //I'll show the next item
            correl++
            select buque 
            into:xg
            from alumnospb.if_bq_bqs
            where buque=:correl;
        loop

In favor of something like
Code:
select min(buque) into :xg from blah.blah where buque>:correl;
.

Matt


"Nature forges everything on the anvil of time"
 
start by checking your sql error messages after doing:
select buque into:xg from alumnospb.if_bq_bqs where buque=:correl;

maybe you're getting more than one row returned.

if sqlca.sqlcode < 0 then
....etc

another possibility is that you might have to install latest patches/fixes/ebf's of your database.
I seem to remeber getting different result sets - doing the same select repeatedly - using oracle.
(caused by lack of patches).



regards,
Miguel L.
 
talking about bugs ....

are you using version 6.5 or 6.5.1

(you should use 6.5.1 !!!)



regards,
Miguel L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top