ternary operator inside a query
I have this query-it is a prepared statement:
UPDATE appointments
SET Bookfrom=(?),staffID=(?),startDate=(?),endDate=(?) where apID=(?)
AND appointments.bookedfor=(SELECT user_ID
FROM users
WHERE email=(?))
the staffID you see above is related with a variable that IT WILL NOT ALWAYS be available
Αs such I must find a way to rewrite the above query without staffID in it...one solution I though was to use a ternary operator...but I do not know how exactly to implement this from a query/code point of view.
How I could a ternary operator in the query above...staffID=false?....etc
Subject
Written By
Posted
ternary operator inside a query
February 24, 2015 01:19PM
February 24, 2015 02:23PM
February 25, 2015 05:55AM
February 25, 2015 11:29AM
February 25, 2015 01:05PM
February 25, 2015 03:21PM
Sorry, you can't reply to this topic. It has been closed.
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.