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.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================