home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!inews.Intel.COM!mipos2!kortikar
- From: kortikar@mipos2.intel.com (Aniruddha Kortikar)
- Newsgroups: comp.databases.oracle
- Subject: how to insert datetime in PRO*C
- Message-ID: <Bxvztx.63s@inews.Intel.COM>
- Date: 18 Nov 92 00:53:56 GMT
- Sender: news@inews.Intel.COM (USENET News System)
- Organization: Intel Corporation, Santa Clara, CA USA
- Lines: 25
- Nntp-Posting-Host: mipos2
-
- varchar var1;
- varchar var2;
- varchar datetime[15];
- datetime.arr contains "mm/dd/yy hh24:mi" i.e "12/30/92 15:54"
- datetime.len contains 14
-
- char stmt[1000];
- strcat(stmt,"insert into tablename (f1,f2,date_field) values (:v1,:v2,:v3)");
- exec sql prepare s1 from :stmt
- exec sql execute s1 using :var1,:var2,:datetime
-
- ORA-01859 : a number was found in a date and a letter was expected.
-
- How can I force oracle to consider this as datetime. in normal sql I would have
- done
- insert into tab (f1,f2,date_field) values
- (v1,v2,to_date('char text','mm/dd/yy hh24:mi');
-
- exec sql execute s1 using :var1,:var2,to_date(....) does not work
-
- Aniruddha Kortikar (kortikar@mipos2.intel.com)
- -------------------------------------------------------------------------------
- E-mail : kortikar@mipos2.intel.com | A billion here, a billion there ...
- Phone(W): 408 765 5515 | pretty soon it adds upto real money.
- -------------------------------------------------------------------------------
-