I try to Execute the following:
IF NOT EXISTS (select * from IT_IMAGES where IT_CODE='8717163044612')
BEGIN
INSERT INTO IT_IMAGES (LARGE_IMG,SMALL_IMG,IT_CODE,LAN_CODE) VALUES ('7290011051310.jpg','7290011051310.jpg','8717163044612','1')
END
But I keep getting ORA-00900: invalid SQL statement . Can you help me fix this?
The following should work for you:
As I think about it, I haven't used
if
except inbegin
/end
statements in Oracle. You may need a programming block to useif
(MySQL does require this). The above should fix the problem, though.Here is an example of it working in SQL Fiddle.