473,382 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Haw can I insert null value from a query

I'd like insert null value from a query but i can do it,
if my query is :
UPDATE table:name UPDATE euro='' WHERE id='5';

i have a sybase message warning like this :

Error converting data type varchar to numeric.
Why ????

Jul 20 '05 #1
4 100555
> i have a sybase message warning like this :

Sybase? This is an MS SQLServer group.

The syntax is:

UPDATE TableName
SET euro = NULL
WHERE id='5';

--
David Portas
------------
Please reply only to the newsgroup
--

"stefy" <@@@ò.@@@@@@@.it> wrote in message
news:7W**********************@news2.tin.it...
I'd like insert null value from a query but i can do it,
if my query is :
UPDATE table:name UPDATE euro='' WHERE id='5';

i have a sybase message warning like this :

Error converting data type varchar to numeric.
Why ????

Jul 20 '05 #2
David Portas wrote:
i have a sybase message warning like this :
Sybase? This is an MS SQLServer group.


I'm using MS SQLServer but with PHP and Apache, i don't know she (for me Db
is a girl :) told me Sybase message.
I'm connecting to SQLServer from a Linux by FreeTDS.

The syntax is:

UPDATE TableName
SET euro = NULL
WHERE id='5';


Thank you !!! It's wotking !!!
Thank you !!!Thank you !!!Thank you !!!Thank you !!!Thank you !!!Thank you
!!!Thank you !!!Thank you !!!Thank you !!!Thank you !!!Thank you !!!

and sorry for my english i'm italian :)

Hello

Stefano
Jul 20 '05 #3
stefy (@@@ò.@@@@@@@.it) writes:
I'd like insert null value from a query but i can do it,
if my query is :
UPDATE table:name UPDATE euro='' WHERE id='5';

i have a sybase message warning like this :

Error converting data type varchar to numeric.
Why ????


I would guess that id is a numeric column, whence the error. I don't know
about Sybase these days, but up till SQL 6.5, MS SQL Server did not have
auto-conversion from numeric to string and vice versa. If Sybase still
does not have this auto-conversion, that's 1-0 to Sybase.

And as David Portas pointed out, use NULL if you mean NULL. The
empty string is something else. (And is likely to be expanded to a
single space on Sybase.)

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
Could you help me out with that as well? I think I may have a slightly different situation though. I need to INSERT a null value that shows just as if I had hit "ctrl+0" in Enterprise Manager.

The closest I get is having it show as 1/1/1900 when I use the syntax of the following:

[PHP]$qryStr = "UPDATE OPSCenterISS SET EndDateTime = NULL" or die ("Error in ODBC Update")[/PHP]

I guess I could delete the row and put the values from it into a new row...but that sounds annoying and dumb. Please let me know if you have any advice on this. I've posted on way too many groups to find no answer. You seem more knowledgable than anyone I've had responses from.
Jun 29 '06 #5

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

Similar topics

2
by: Mark Davenport | last post by:
Hi, Here's my question: How do I pass a NULL value in a variable to a MySQL DB? Here's an overview of my problem: I have a PHP page that processes code, then inserts the code into a database....
6
by: FatboyCanteen | last post by:
When I using dataset to append a null value to the datetime field. It throw a error -> can not convert db.null to system.date Can there is any standard to pass a Null value to the DateTime...
1
by: Vaidas Gudas | last post by:
how to insert Null value and "Please select..." text to combobox, which have datasource from like sqldatasource. In ASP.NET 2.0 thanks.
0
by: hemant123 | last post by:
Hi I Am Trying To Insert Null Value In Oracle Date Column Using Visual Basic 6 Textbox. I Tried Various Options But Unable To Insert. Please Advise Me A Solution. Thanks In Advance Hemant
1
by: hemant123 | last post by:
Hi I am trying to insert null value in date field using vbasic textbox.I tried various options but failed.Please tell me the solution. Thanks in advance. Hemant
1
by: billa856 | last post by:
Hi, I am trying to insert Null value in column(ShipDate) in my table.That column(ShipDate)'s type id date/time and format is short date. I am using "" to insert Null in that column(ShipDate)...
2
by: RN1 | last post by:
How do I insert NULL values in a SQL Server DB table in a column whose datatype is int? This is what I am trying currently (in the UpdateCommand event function of a DataGrid): ...
2
by: wizardry | last post by:
hello - i'm trying to insert a blob into my table, it will insert but the string that i insert when i query the inserted data returns null with 0 bytes in the column. I have other tables set...
2
by: qwedster | last post by:
Folk! How to programattically check if null value exists in database table (using stored procedure)? I know it's possble in the Query Analyzer (see last SQL query batch statements)? But how...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.