followup to my below problem - I correct my code as per Razzak
instruction and still have the problem - I rewrote the program to have
only on DECLARE statement and everything works correctly - is there a
problom with two declare statement using the same table/view?
J
Can some one explain why when I trace rhe below code everything works
correctly - but when I input I get the following error -
thanks
J
set echo on
R>inp qq
inp qq
drop cursor c1
DECLARE c1 CURSOR FOR SELECT DISTINCT CUSTIDEN FROM VWEMAILCUST where
EMAIL IS NOT NULL AND EMAIL NOT CONTAIN 'EMAIL'
OPEN c1
FETCH c1 INTO vCUSTIDENFM IND v1
WHILE sqlcode <>100 THEN
drop cursor c2
DECLARE c2 CURSOR FOR SELECT EMAIL FROM VWEMAILCUST where CUSTIDEN
= .VCUSTIDENFM
OPEN c2
clear var vemailname
set v vemailname text
set v vcount integer = 0
FETCH c2 INTO vemail IND v2
WHILE sqlcode <>100 THEN
if vcount = 0 then
set v vemailname = .vemail
else
set v vemailname = (.vemailname + ',' + .vemail)
endif
set v vcount = (.vcount + 1)
FETCH c2 INTO vemail IND v2
ENDWHILE
label emailsetup
set v vSUBJECT = (FirstName & MiddleName & LastName & FullNameX
& 'CUSTOMER CONFIRMATION' ) from A1Customer where custiden = .vcustidenFM
set v vfullnamexem = (CTXT(.VCUSTIDENFM))
set v vdirectory text = ('c:\pdf_files\')
set v vfileext text = ('.pdf')
set v vfullnamexpdf = (.vdirectory + .vfullnamexem + .vfileext)
--('c:\pdf_files\' + .vfullnamexem + '.pdf')
SET V VBODY TEXT = EmailMsgTxt FROM A3EmailMgs WHERE
EmailMgsIden = 3
WRITE *.VCUSTIDENFM .vemailname .vfullnamexpdf .VSUBJECT
* clear var vemailname
set v vemailname text
set v vcount integer = 0
FETCH c1 INTO vCUSTIDENFM IND v1
ENDWHILE
computer displays the following:
*7
12,13,20,24,28,30,32,34,36,39,47,70,75,77,78,86,88,89,91,92,93,101,103,104,112,114,115,116,121,128,131,134,138,141,142,155,163,165,169,172,173,178,181,184,187,190,191,192,198,201,209,210,212,213,217,218,219,221,229,230,231,232,235,236,238,239,241,254,255,266,273,275,279,280,282,283,284,286,291,293,304,306,308,310,321,326,330,333,336,338,343,346,350,351,357,359,366,368,370,389,393,403,404,405,406,410,412,421,423,425,426,429,432,433,434,435,436,437,438,439,440,442,444,446,448,450,451,456,457,462,463,466,467,471,472,473,475,478,480,484,485,488,489,490,492,495,498,499,508,510,515,516,517,519,522,524,526,527,534,535,536,541,543,545,546,549,550,551,552,553,560,561,563,567,568,569,570,571,574,575,577,582,583,586,587,588,589,592,594,595,597,598,599,600,606,608,609,610,611,613,614,615,616,618,619,620,622,625,626,629,630,631,632,634,635,636,637,639,640,642,645,646,653,654,656,657,658,662,664,665,670,672,673,674,675,676,677,678,681,682,684,685,686,689,692,693,694,697,699,701,702,705,70
6,707,708,709,719,720,721,722,72
,727,728,729,730,731,732,733,734,737,738,739,740,741,742,748,749,750,751,752,753,754,756,758,759,761,763,764,765,768,771,772,774,775,776,779,780,782,783,784,785,787,788,789,792,793,794,797,799,803,804,805,806,808,810,811,812,813,814,815,816,818,820,821,822,823,824,826,827,828,829,847,848,849,850,855,858,859,868,869,871,876,878,882,884,886,887,888,891,897,899,901,904,906,909,910,911,912,913,917,918,919,921,926,927,930,931,932,934,936,941,943,945,947,948,953,956,957,959,961,9
c:\pdf_files\7.pdf ***Capital Structures DoNotFill WC bringB CUSTOMER
CONFIRMATION
-ERROR- Missing right side of comparison. (2295)
c:\pdf_files\0.pdf ***Capital Structures DoNotFill WC bringB
CUSTOMER CONFIRMATION
*RETURN
*J. Blaustein*
*J Blaustein Associates, Inc.*
* 12 Herrick Drive*
* Lawrence, NY 11559*
*516-371-3445 FAX 516-345-8009*