Having a problem getting data from a DB2 database to a cursor using VFP6. Here's my code:
I'm getting an error stating "Table MSA_INF does not exist."
When I run from the command box, it appears to select records, but won't assign them to a query, cursor, or table.
Any help would be appreciated.
TIA,
MMund
Code:
c_query = " SELECT Associate.ASSOC_NUM, Associate.STORE, Associate.DEPT,Associate.Norm_hours, "+;
" Associate.LAST_NAME, Associate.FIRST_NAME, Associate.MIDDLE_INIT, "+;
" Associate.HIRE_DATE, Associate.FULL_PART_TIME, Accumulator.ACCUM_AMT , "+;
" CASE " +;
" WHEN Associate.STORE IN ('0012','0029','0031','0068') Then "+;
" DECIMAL(ROUND(QPY.PAID_TIME_OFF.HOL_ELIG/7,2),3,2) "+;
" ELSE "+;
" DECIMAL(ROUND(QPY.PAID_TIME_OFF.HOL_ELIG/6,2),3,2) "+;
" END AS Hours"+;
" FROM {OJ QPY.ASSOCIATE Associate LEFT OUTER JOIN QPY.ACCUMULATOR Accumulator ON "+;
" (Accumulator.ASSOC_NUM = Associate.ASSOC_NUM "+;
" AND Accumulator.LEVEL2 = Associate.LEVEL2 "+;
" AND Accumulator.ACCUM_YEAR = 2009 "+;
" AND Accumulator.ACCUM_ID = '001')} , QPY.PAID_TIME_OFF" +;
" WHERE Associate.LEVEL2 = 'ST' "+;
" AND Associate.UNION IS NULL "+;
" AND Associate.STATUS_1 NOT IN ('T','P') "+;
" AND Associate.FULL_PART_TIME IN ('1','3') "+ STR_SELECT + ;
" AND Associate.HIRE_DATE <= " + cur_date + ;
" AND ASSOCIATE.ASSOC_NUM = QPY.PAID_TIME_OFF.ASSOC_NUM "
c_connect = SQLCONNECT('RPYPROD')
n_exec = SQLEXEC(C_CONNECT,c_query,'msa_inf')
= SQLDISCONNECT(c_connect)
SELECT msa_inf.* ;
FROM msa_inf ;
WHERE full_part_time = '1' ;
OR (full_part_time = '3') ;
ORDER BY store, full_part_time, dept ;
INTO TABLE (f_elig1)
When I run from the command box, it appears to select records, but won't assign them to a query, cursor, or table.
Any help would be appreciated.
TIA,
MMund