MySQL Forums
Forum List  »  Newbie

SQL stops when running into non-integer
Posted by: Ellen van Drunen
Date: August 31, 2018 03:14AM

Hi,
I'm Ellen and I hope someone can help me. I don't know if this is the right place, if not, sorry about that. I'm a newbie, and someone already helped me with this SQL, but we keep having an issue.

This is the SQL code:

update <@PREFIX>stock_available
set quantity='<@NEWFQTYONHAND@>'
where id_product =
(Select id_product from <@PREFIX>product
where reference = '<@SSTOCKCODE@>' )

@@GO@@

update <@PREFIX>stock_available
set quantity='<@NEWFQTYONHAND@>'
where id_product_attribute =
(Select id_product_attribute from <@PREFIX>product_attribute
where reference = '<@SSTOCKCODE@>' )

@@GO@@

====

We think the problem has to do with the id_product and id_product_attribute variable.
In our stock system we sometimes have used non-integer codes, that we are unable to change.

It looks like that when the SQL runs into a product with a non-integer, it just stops.

We have tested the SQL directly and changed the variables for id-numbers and it works perfectly.

So, my question is, how can I add something to this SQL or change this SQL, that when it runs into a non-integer id, it just skips this product and continues to the next?

Thank you in advance for your help!
Regards, Ellen

Options: ReplyQuote


Subject
Written By
Posted
SQL stops when running into non-integer
August 31, 2018 03:14AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.