Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 8th, 2003, 09:34 AM
acd acd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 acd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simple SQL Plus Question

I'm trying to Insert the following into a field that has a datatype of Date and it is giving me a 'Not a valid month' error message:

'08/08/2003 10:07:58 AM'

I took out the single quotes and it didn't like the 07 in the time, got an error message saying, 'Bind variable "07" not declared.'

I definitely need a date/timestamp for this field and it is formatted this way because of coding standards I must adhere to.

Why is it saying 'Not a valid month'????? Help!

Reply With Quote
  #2  
Old August 8th, 2003, 09:56 AM
ishnid's Avatar
ishnid ishnid is online now
kill 9, $$;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Sep 2001
Location: Dublin, Eire
Posts: 5,654 ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 5 Days 22 h 27 m
Reputation Power: 1432
Re: Simple SQL Plus Question

Quote:
Originally posted by acd

I definitely need a date/timestamp for this field and it is formatted this way because of coding standards I must adhere to.


Have you checked the documentation with your database to see what format it requires the dates to be formatted in. You'll have to change your standard date formatting for database interaction if they're not compatible.

Reply With Quote
  #3  
Old August 8th, 2003, 01:17 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 693 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 23 h 47 m 32 sec
Reputation Power: 20
2 options

1. put a to_date('08/08/2003','mm/dd/yyyy') around it... you'll have to look up the correct mask for the time.

2. if you actually want a timestamp just use sysdate() in your insert/update query.

Reply With Quote
  #4  
Old September 18th, 2003, 07:23 AM
yoduc yoduc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 yoduc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try
INSERT INTO asd (date) VALUE ('01-APR-02');

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Simple SQL Plus Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT