thanks for taking time to look at this.    I will be trying to debug next 
week.  Currently it is 

working with trim. 



Thanks again. 



----- Original Message ----- 
From: "Bill Eyring" <[email protected]> 
To: "RBASE-L Mailing List" <[email protected]> 
Sent: Thursday, May 14, 2009 4:08:46 PM GMT -06:00 US/Canada Central 
Subject: [RBASE-L] - Re: Fetch cursor 


Bob, 

I just tested your code using a table in one of my databases and the results 
were as expected - no spaces. It did not make a difference whether the variable 
was predefined or not. 

O ne suggestion - if you are using the same directory for the entire cursor 
then you might try predefining the directory in a variable and concatenate in 
the cursor 

Set v vdir text= 'G:\Edisoft\Sales\HOME DEPOT WESTCOAST\recv\' 
SET ERROR MESSAGE 705 OFF 
DROP CURSOR c100 
SET ERROR MESSAGE 705 ON 

DECLARE c100 CURSOR FOR SELECT Short_name FROM dir_table 

OPEN c100 
FETCH c100 INTO vedifile INDICATOR ivvar1 

WHILE SQLCODE <> 100 THEN 

  set var vEdiFile = (.vdir+.vedifile) 



etc.   


E NDWHILE 

also try a bigger data sample and use this code to test it in the while loop; 

WHILE SQLCODE <> 100 THEN 
  set var vEdiFile = ('G:\Edisoft\Sales\HOME DEPOT WESTCOAST\recv\' + 
.vEdiFile) 
  pau 2 using .vedifile 
  dia 'Continue ?' vans vendkey no 
  if vans='no' the 
    break 
  endi 
  FETCH c100 INTO vedifile INDICATOR ivvar1 
endwhile 

This will show you the variable in each row. 

Hope this helps. 

Bill Eyring 


From: [email protected] [mailto:[email protected]] On Behalf Of 
[email protected] 
Sent: Thursday, May 14, 2009 11:40 AM 
To: RBASE-L Mailing List 
Subject: [RBASE-L] - Re: Fetch cursor 





Thanks all.   Here is the actual code snippet pasted from the program.  I will 
use the 

trim for now. 













-- Define a cursor to step through each file. 
SET ERROR MESSAGE 705 OFF 
DROP CURSOR c100 
SET ERROR MESSAGE 705 ON 


DECLARE c100 CURSOR FOR SELECT Short_name + 
FROM dir_table 



OPEN c100 
FETCH c100 INTO + 
vedifile INDICATOR ivvar1 



WHILE SQLCODE <> 100 THEN 



--Add path to file name 
set var vEdiFile = ('G:\Edisoft\Sales\HOME DEPOT WESTCOAST\recv\' + .vEdiFile) 

... continues 


----- Original Message ----- 
From: "Lawrence Lustig" <[email protected]> 
To: "RBASE-L Mailing List" <[email protected]> 
Sent: Thursday, May 14, 2009 10:09:46 AM GMT -06:00 US/Canada Central 
Subject: [RBASE-L] - Re: Fetch cursor 


<< 
During trace I watch the variable vEdiFile and it displays a space as the first 
character after fetched. 
I can use the "Modify variable value" tool and confirm that the variable has a 
space as the first character. 
I have double and tripled checked that the data in the table does not have a 
space in front of it. 
>> 
  
If you're 100 % certain the problem is not in the data, can you post the 
DECLARE CURSOR for c100?  It sounds like you may be using an expression of the 
form (Col1 & ' ' & Col2) where you think you're referring only to Col2. 
-- 
Larry 


Reply via email to