473,396 Members | 1,996 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,396 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 100556
> 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...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...

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.