Albert,

I took care of the INTEGER and the Declare cursor works.
The area I now have to care for is your last email on how to reset the
Autonum so it starts over at each Control#.  

I looked at your email and understand what you were saying but where to
put the code exactly within the other code has me baffled.  

This is all new to me so it take awhile for me to learn.

Jim

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Albert
Berry
Sent: Friday, December 25, 2009 12:05 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: shipping labels

Jim - where you need to change to integer is in this section of your
code:

WHILE vPcs > 0 THEN
    INSERT INTO tBollabels +
(BOLDate, Control#, OrderNumber, Lblpcs,PackageWgt) +
* VALUES (.vBdate, .vCnum, .vOrdNum, '1', .vPkgwgt)
*    SET VAR vPCS = (.VPCS - 1)
ENDWHILE

Take the quotes off the integer between .vOrdNum and .vPkgwgt.
Albert

Jim Belisle wrote:
> John,
>
> I appreciate your input but I still get the same error message.  I
> changed the vpc to integer as you suggested and made sure the values
> section had the 1 as an integer.  
>
> Are there certain settings I should check in 7.6?
>
> Jim
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of John
> Engwer
> Sent: Thursday, December 24, 2009 7:00 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: shipping labels
>
> Jim,
>
> I did not test this code but I think it should work.
>
> SET VAR vBOLDate = 12/23/2009
> Set VAR vPCS integer = 0
> CREATE TEMP TABLE tBOLLabels (Lblitem INTEGER, BOLDate DATE, Control#
> TEXT
> 9,+
>      OrderNumber TEXT 20, Lblpcs INTEGER, PackageWgt
REAL,AutoNumberCol
> Integer)
> AUTONUM AutoNumberCol IN ctBOLLabels USING 1 1 NUM
> DECLARE cBollbl CURSOR FOR SELECT BOLDate, Control# OrderNumber,
> PackageQty,
> PackageWgt +
>    FROM BOLRows WHERE BOLDate = .vBOLDate
> OPEN cBollbl
> FETCH cBollbl INTO vBdate INDIC vi1, vCnum INDIC vi2, vOrdNum INDIC
vi3,
> +
> vPcs INDIC vi4, vPkgwgt INDIC vi5
> WHILE SQL <> 100 THEN
>   WHILE vPcs > 0 THEN
>     INSERT INTO tBollabels (BOLDate, Control#, OrderNumber, Lblpcs,+
>     PackageWgt) VALUES (.vBdate, .vCnum, .vOrdNum, '1', .vPkgwgt)
>     SET VAR vPCS = (.VPCS - 1)
>   ENDWHILE
> FETCH cBollbl INTO vBdate INDIC vi1, vCnum INDIC vi2, vOrdNum INDIC
vi3,
> +
> vPcs INDIC vi4, vPkgwgt INDIC vi5
> ENDWHILE
>
> John
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Jim
> Belisle
> Sent: Thursday, December 24, 2009 7:34 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: shipping labels
>
> Albert,
>
> Forgive me for my ignorance.  I guess I do not understand why I would
> get an error when the FETCH command works.  I was able to insert a row
> into the table using the insert command without the WHILE command. See
> below.
>
> SET VAR vBOLDate = 12/23/2009
> CREATE TEMP TABLE tBOLLabels (Lblitem INTEGER, BOLDate DATE, Control#
> TEXT 9, OrderNumber TEXT 20, Lblpcs INTEGER, PackageWgt REAL)
> DECLARE cBollbl CURSOR FOR SELECT BOLDate, Control# OrderNumber,
> PackageQty, 
>         PackageWgt FROM BOLRows WHERE BOLDate = .vBOLDate
> OPEN cBollbl
> FETCH cBollbl INTO vBdate INDIC vi1, vCnum INDIC vi2, vOrdNum INDIC
vi3,
> +
>       vPcs INDIC vi4, vPkgwgt INDIC vi5
> INSERT INTO tBollabels (BOLDate, Control#, OrderNumber, Lblpcs,
> PackageWgt) +        VALUES (.vBdate, .vCnum, .vOrdNum, '1', .vPkgwgt)
>
>
> Why would putting the WHILE code before the INSERT clause cause it not
> to work?
>
> Jim
>
> This is all new to me so I have to muddle through this.
> Sorry to be a bother.
>
>
>
>   


Reply via email to