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

Home -> Community -> Usenet -> c.d.o.server -> ORA-01843 - not a valid month

ORA-01843 - not a valid month

From: Edwinah63 <edwinah_at_customercare.com.au>
Date: 27 Aug 2002 18:55:32 -0700
Message-ID: <d714e824.0208271755.7184ecbc@posting.google.com>


Hi everyone,

when i run an oracle stored proc in sql*plus, i get "ORA-01843: not a valid month". i have checked the query syntax, and the source data
(the dates and times appear to be in order). this proc sometimes
returns records, before this error is returned.

the problem appears to be because i am using a date/time component in the where statement (i have to be able to do this). if i just use dates, it runs, but will not be useable for reporting purposes. i take in dates and times as string parameters, and convert them to dates after manipulation.

has anyone else had this error while trying to filter on both date and time??

the code for the proc is below

i need an urgent fix on this - all thoughts greatly appreciated

Edwina

*****procedure code *****
ast005_clientrpt_all
(cur IN OUT pkgassist.rtncur, stdt IN VARCHAR2, sttime IN VARCHAR2,
enddt IN VARCHAR2, endtime IN VARCHAR2)
as

st Date;
en Date;

begin

st := to_date((stdt || ' ' || sttime),'DD/MM/YYYY HH24:MI'); en := to_date((enddt || ' ' || endtime),'DD/MM/YYYY HH24:MI');

open cur for
Select CMN_MAIN.CASE_NO, cli_code, pol_code, header, open_date, surname, first, cad_address.type, contact, company, street, town, country, postcode, phone, fax, telex, note_date, to_char(note_time, 'HH24:MI'), notes
From cmn_main, cad_address, clr_clreport Where
(cmn_main.case_no = cad_address.case_no) and
(cmn_main.case_no = clr_clreport.case_no) and
(
(cancel = 'N') and
(

to_date(
to_char(note_date,'DD/MM/YYYY') || to_char(note_time,' HH24:MI'), 'DD/MM/YYYY HH24:MI'
)
Between st and en);

Received on Tue Aug 27 2002 - 20:55:32 CDT

Original text of this message

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