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

Home -> Community -> Usenet -> c.d.o.tools -> WildCards to match Date

WildCards to match Date

From: liming <lmxu_at_glue.umd.edu>
Date: Mon, 25 Sep 2000 20:04:20 -0400
Message-ID: <39CFE804.B2508CB6@glue.umd.edu>

hi, I'm trying to match a date in my database with wildcards in the format of DD-MM-YYYY...for example, *-12-1998 should match with any dates of Dec in 1998.... .A gentleman called Steve pointed out some of my syntax error this afternoon......thanks Steve... I'm a newbie and just got started....thanks guys..

I'm using Pro C...

here is what I have in the program

EXEC SQL declare curdob cursor for

                                select dob,name from Contacts where
to_date(dob,'DD-MM-YYYY') like to_date(:tdob,'DD-MM-YYYY') ORDER BY to_date(dob,'DD-MM-YYYY'),name;
EXEC SQL open curdob;
EXEC SQL fetch curdob into :cmatchdob,:cmatchname;

But when I tested if the above operated correctly or not, using (sqlca.sqlcode<0) , it always tell me it's <0 which means that the above code was not excute correctly....what was wrong????? Thank you..

Variable Descriptions:
dob: date column name in the table (varchar) name: name column in the table. (varchar)
:tdob: the string date I read from the input... (Varch
:cmatchdob: a string to store date.....(Varchar)

Thanks. Received on Mon Sep 25 2000 - 19:04:20 CDT

Original text of this message

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