473,657 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting NULL value into date datatype

From the psql command line, I am having absolutely no problems
inserting a NULL value into a date datatype field.

When attempting to insert a NULL value via my Web app using SQL Relay,
I am getting the following error:

DBD::Pg::st execute failed: ERROR: invalid input syntax for type
date: "null"

I also get the exact same error if I attempt to insert an empty string
rather than explicitly setting a NULL value:

DBD::Pg::st execute failed: ERROR: invalid input syntax for type
date: ""

My question isn't so much to do with SQL Relay, but does anyone know
any possible reasons for the "invalid input syntax for type date:
"null" " error message?

Thanks ahead of time,

-Mark
Nov 23 '05 #1
1 10389
Nevermind. Apparently from the psql command line the string NULL is
interpreted correctly as a NULL value, but from the DBI interface I'm
using, it is not translated correctly as a NULL value, but rather the
string 'NULL'.

I'll try using UNDEF instead.
Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6087
by: boclair | last post by:
I have some date fields which in some records will have NULL value. I am trying to show nothing in the HTML display. IF <? $date3=$myrow; ?> <p><?=$date3?><p> The html display is 0000-00-00 if there is no date value in the db table. I
4
5347
by: R. Santiago | last post by:
I have a table cc_rd_user_questions with the following columns: NUM NUMBER (25) DEFAULT 1 NOT NULL, COMPANY_ID NUMBER (15) NOT NULL, PROJ_ID NUMBER (15) NOT NULL, SEQ NUMBER (25) NOT NULL, QUEST_ID NUMBER (15) NOT NULL, RESPONSE VARCHAR2 (40), CREATE_DATE DATE NOT NULL, LAST_UPDATE DATE NOT NULL
1
5141
by: Michael Albanese | last post by:
I am building an application to report on-the-job injuries and incidents. There are a lot of Date fields, some of which are optional and can be left blank by the user. I have allowed Nulls on these fields in my SQL Server DB, as well as in my stored proc. The problem is that when I submit this data i get an error that states "Input not in date format" or a similar statement when there arevnull date fields.
1
2471
by: Ken | last post by:
I wrote a function to use in queries that takes a date and adds or subtracts a certain length time and then returns the new value. There are times when my function needs to return Null values. Function DateCalc (blah...) As Variant Do Stuff... If Not IsNull(varNewDate) Then DateCalc = varNewDate End If End Function
11
16415
by: Mark Rae | last post by:
Hi, I have a class with several properties, one of which is of the DateTime datatype. However, this property will not always have a value, and I need to check later whether it has a value or not. When I create a new instance of the class, this property acquires a default value of {1/1/1}, which I don't want at all, as that is a perfectly valid date.
15
18877
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract the value in timeonly format by using this command Format(now,"HH:mm:ss") But when I insert it into the Sql Server database, it embadded date value with it. the output looks like that "01/01/1900 08:59:00" in that case time is
3
4596
by: Jay | last post by:
Hi , I am trying to assign a NULL value to a date (datatype). I am using VB NET 2003. I know that date cannot be assigned a null value in 2003. I cannot change the datatype as I am submitting the data to a web service and it accepts only date (datatype). I dont want to display 01/01/0001 on the screen. I want to leave the date field as "blank". Are there any suggestions to work around this problem. thanks Jay
6
3297
by: fniles | last post by:
I am using VB.NET 2003 and SQL Server 2000. I have a table with a datetime column type. When inserting into the table for that column, I set it to Date.Now.ToString("T") , which is something like "2:50:54 PM". But after the row is inserted and I check the data in the database, the column data is set to "1/7/2007 2:50:04 PM" (notice today's date in front of the time). If I insert data directly into the table in the Enterprise Manager, the...
1
2777
by: rreddy | last post by:
I am using connections to 2 databases(oracle) in my code(C#.NET) wher i read from one and update the other. when the first DB returs a null value I'm unable to enter the read nulls into the other DB. my update stmt looks smthing lik "insert into table(.....) values(reader.GetString(2),reader.GetString(3)....)"; here "reader.GetString(2)" is a DATE datatype and "GetString(3)" is a string which return a null. I'm unable to redirect the...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.