Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help: dates and cobol - this is bizarre, not to mention irritating

Help: dates and cobol - this is bizarre, not to mention irritating

From: Andrew <razz_lee_at_yahoo.com>
Date: 28 Mar 2002 07:43:25 -0800
Message-ID: <6778df0f.0203280743.6964a267@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US