468,321 Members | 2,033 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

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 100239
> 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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark Davenport | last post: by
6 posts views Thread by FatboyCanteen | last post: by
1 post views Thread by Vaidas Gudas | last post: by
2 posts views Thread by RN1 | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.