Dan,

I understand what you are saying. In the scenarios that I’m testing I know that 
I will get multiple rows.

Stu Hellman

From: [email protected] [mailto:[email protected]] On Behalf Of 
Dan Goldberg
Sent: Wednesday, June 28, 2017 10:10 AM
To: [email protected]
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

You do not have to do a cursor for indicators. Just use the select into command.

SELECT T1.MasterPart#, T1.Length, T2.UMMult  into vQPart# INDICATOR vInd1, 
vLength INDICATOR  vInd2, vUMMult INDICATOR  vInd3 +
FROM &vTable T1, SnapPartMast T2 &vWhere

If vind1 = -1 or vind2 = -1 or vind3 = -1 then
   Goto EndLoop
Endif


Dan Goldberg


From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stuart Hellman
Sent: Wednesday, June 28, 2017 7:43 AM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

Buddy & Dan,

I’m using the indicators to not get an error message when the variable 
retrieved is null.   I know the range of the indicator values, that’s why  
initialized it to the -9. In tracing the code, the indicator values are 
unchanged after executing the FETCH command. That indicates to me that 
something behind the scenes of the cursor, something isn’t right.


Stu

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Buddy Walker
Sent: Wednesday, June 28, 2017 9:26 AM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

Stuart

   The indicator value will only show two values a 0 for non-null and -1 for 
null

Buddy


From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stuart Hellman
Sent: Wednesday, June 28, 2017 9:47 AM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

Dan,

Thanks for the suggestion.

I did try your idea. I defined the indicators setting them to an initial value 
of -9 so I would know that those values changed.  Unfortunately, the FETCH  
command didn’t change the indicator values.

Stu Hellman

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Dan Goldberg
Sent: Tuesday, June 27, 2017 12:27 PM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

Shouldn’t you have Indicator in your fetch command? I think the variables that 
hold the indicators should be different as well.


FETCH QteDetail  +       <--Here is where the 406 error code is returned in my 
error variable
    INTO vQPart# INDICATOR vInd1, vLength INDICATOR  vInd2, vUMMult INDICATOR  
vInd3

Dan Goldberg



From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stuart Hellman
Sent: Tuesday, June 27, 2017 10:11 AM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

There are different sets of tables used for different processes, so that is why 
the WHERE clause is a variable

  SET VAR vTable = 'QuoteDetail'
  SET VAR vWhere = ('WHERE Quote# = .vQuote# AND Window = .vWindow ')
  SET VAR vWhere = (.vWhere & 'AND CostType = .vPrimAlt')

SET VAR vWhere = +
(.vWhere & 'AND T2.SnapShotID = .vSnapShotID AND T1.MasterPart# = 
T2.MasterPart#')

BROWSE T1.MasterPart#, length, ummult FROM &vTable T1, snappartmast T2 &vWhere

DECLARE QteDetail CURSOR +
FOR SELECT T1.MasterPart#, T1.Length, T2.UMMult +
FROM &vTable T1, SnapPartMast T2 &vWhere

OPEN QteDetail

  FETCH QteDetail  +       <--Here is where the 406 error code is returned in 
my error variable
    INTO vQPart# vInd, vLength vInd, vUMMult vInd
   IF SQLCODE = 100 THEN
       GOTO EndLoop
   ENDIF



From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Buddy Walker
Sent: Tuesday, June 27, 2017 9:28 AM
To: [email protected]<mailto:[email protected]>
Subject: RE: [RBASE-L] - Peculiar Cursor Behavior

Stuart
  Is it possible for you to show the complete browse and declare statements.

Buddy

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stuart Hellman
Sent: Tuesday, June 27, 2017 8:51 AM
To: [email protected]<mailto:[email protected]>
Subject: [RBASE-L] - Peculiar Cursor Behavior

Need some expert advice on a cursor problem I’m having.

The situation is a large form in which is using about 10, one at a time. 
Nothing “exotic” is going on with the cursor in question. All of them work 
except one. Data is being retrieved from 2 tables. The cursor is dropped, 
declared, opened and then the data is to be fetched. This is the point where 
things go south.

The SQLCode being returned is ‘100’ and the Error Variable value returned is 
‘406’, which means End-Of-Data. In trying to determine the cause, a BROWSE was 
placed before the FETCH having converted the DECLARE statement. The three rows 
expected are displayed. Put a SELECT after, again converting the DECLARE 
statement plus adding a LIMIT = 1 clause. No problems.

Two very simple questions here:
1: Why is R:Base returning the End-Of-Data condition when the SELECT clause is 
correct?
2: What needs to be done to fix the situation?

Thank you in advance for your  help.


Stu Hellman

[cid:[email protected]]<http://www.qmiusa.com/>

Stuart Hellman

Software Designer

Email:

  [email protected]<mailto:[email protected]>

Toll Free:

  800-446-2500

International:

  01 630-529-7111

Extension:

  1029


www.qmiusa.com<http://www.qmiusa.com>




.

________________________________
This email may contain material that is confidential, privileged and/or 
attorney work product for the sole use of the intended recipient. Any review, 
reliance or distribution by others or forwarding without express permission is 
strictly prohibited. If you are not the intended recipient, please contact the 
sender and delete all copies

--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to