0

I can not insert data into my table, I get an error when entering real data types, and I understand that the real data is a double in the sql server. Why is it wrong, if I insert numbers of type double?

Stored Procedure:

enter image description here

Execute the Procedure:

enter image description here

Error After executing: enter image description here

Julio Mizrahi
  • 33
  • 1
  • 9
  • 2
    Note - we usually **much** prefer code to be in the question as *code*, not as images. We cannot copy & paste an image into our editors, and we don't need the typing practice. (It also excludes would-be answerers who use assistive technologies to access this site) – Damien_The_Unbeliever Sep 16 '18 at 07:40

2 Answers2

2

You're misusing the single quote signs. They should be used for string literals - not for numbers and definitely not for variables.

So what it boils down to is:

  • you should use the variables as @variable
  • you should pass string values with quote as 'string'
  • you should pass number values without quotes as 1.2345

Therefore, your procedure should insert the values like this:

INSERT INTO DataImage VALUES (@username, @picture, ...)

... and you should execute the procedure like so:

EXEC addlocal 'us1', ..., 123445555.2345

To do some more research on this matter, check the following documentation:

MK_
  • 1,139
  • 7
  • 18
1

Change your Insert line like this:

Insert into DataImage values(@username,@picture,@name,@zone,@category,@coment,@altitude,@longitude)
Amirhossein Yari
  • 2,054
  • 3
  • 26
  • 38