473,842 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 100589
> 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" <@@@ò.@@@@@@@.i t> 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 (@@@ò.@@@@@@@.i t) 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
duncan352
2 New Member
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
58425
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. Very straightforward. But, some NULL values are being inserted as a blank space, or the string "NULL" instead of a true NULL.
6
16267
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 Field! (It is successful to pass the Null Value to other type of Field)
1
1300
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
2300
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
8538
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
3771
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) but it shows warning that customer can't append all the records in the append query. Customer set 1 field(s) to Null due to a type conersion failure,and it didn't add 0 record(s) to the table due to key violation, 0 record(s) due to lock...
2
1679
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): ---------------------------- Dim strSQL As String Dim objErrorPercentage As Object If (CType(ea.Item.Cells(8).Controls(0), TextBox).Text = "") Then objErrorPercentage = DBNull.Value
2
5057
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 up this way and i'm able to insert text data into it with no problems. I've checked the database design its basiclly a duplicate. I did have to remove my not null on the long blob element. but other then that, i don't understand why this is...
2
14671
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 can I pass null value as parameter to the database stored procedure programattically using C#? Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value...
0
9870
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9715
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
10610
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...
0
10310
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
9452
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...
1
7855
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7035
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5696
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5884
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.