Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / SQL help

Author
Message
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 24th Apr 2008 17:03
Dunno where to post this but...

I keep getting error messages come up when im tryin to enter data into tables. It keeps saying

ORA-01861: literal does not match format string

Ive tried google and im guessing its something to do with the date type. Heres the table and input code:



Cheers
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 24th Apr 2008 17:11
I would have to try it out to be honest and don't have the time at the moment, but here is something which might be worth checking...
A SMALLINT can usually only be in the range -32768 to 32767 unless its unsigned (in which case the range is 0 to 65535).

Actually, the error looks like its an ORACLE database. In which case I can't try it out any more. I got rid of ORACLE a while ago because I hated the administration tools (they were all Java based if I remember correctly).


Chart data provided with kind permission from ELSPA
GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 24th Apr 2008 18:45 Edited at: 24th Apr 2008 18:52
Like the previous poster said, some of you values are UNSIGNED SMALLINT not SMALLINT

I think the chance of an orderNumber going larger than UNSIGNED SMALLINT is high I'd use something larger

DinoHunter (still no nVidia compo voucher!), CPU/GPU Benchmark, DarkFish Encryption DLL, War MMOG (WIP), 3D Model Viewer
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 24th Apr 2008 19:44
Do numbers really need to be surrounded by quote characters?

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Apr 2008 20:17
No. Literals surrounded by single quotes are strings, but I would guess that isn't the problem.

I think the problem is in the date literal '20070207' - if it's oracle, that's not an acceptable format for the default. It should be '07-FEB-2007', or he should use the TO_DATE function to convert the text to a date.

Login to post a reply

Server time is: 2024-11-20 04:29:43
Your offset time is: 2024-11-20 04:29:43