Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help: dates and cobol - this is bizarre, not to mention irritating
I have a bizarre problem. I'm trying to pull data of a table with the
following cursor:
EXEC SQL DECLARE C_CURSOR CURSOR FOR SELECT BC_GROUP_ID
,BC_ID_NO
,BC_CARD_TYPE
,BC_DATE_STAMP
,BC_NO_OF_CARDS
,BC_TRANS_DATE
,BC_LANGUAGE
,BC_CORP_LOGO
,BC_COVERAGE_LOGO
FROM MSC_CARDSTATS WHERE BC_TRANS_DATE >= TO_DATE(:WS-TEMP-START-DT,'YYYYMMDD') AND BC_TRANS_DATE < TO_DATE(:WS-TEMP-END-DT,'YYYYMMDD') ORDER BY BC_TRANS_DATE
,BC_LANGUAGE
,BC_CORP_LOGO
END-EXEC.
the two host variables used to interrogate bc_trans_date are derived by this select:
EXEC SQL SELECT TO_CHAR(ADD_MONTHS(SYSDATE,-1),'YYYYMMDD')
INTO :WS-DB-START-DATE FROM SYS.DUAL END-EXEC.
Now here's the catch. If I run it as is i get no data found (-1403). If I hardcode the date values into the host fields I get data returned. Whats worse, when i compare the host variable with the hard coded value to the host variable with the derived date (from the select) cobol says there the same. Does anybody know what the heck is going on. platform is an HP, oracle 7.3.4, compiler is micro-focus.
thanks in advnace,
Andrew
Received on Thu Mar 28 2002 - 09:43:25 CST
![]() |
![]() |