SHARE
TWEET

Untitled

a guest Jan 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IF EXISTS(SELECT * FROM component_psar WHERE tbl_id = '2' AND row_nr = '1')
  2.    UPDATE component_psar
  3.       SET col_1 = '1', col_2 = '1', col_3 = '1', col_4 = '1', col_5 = '1',
  4.                  col_6 = '1', unit = '1', add_info = '1', fsar_lock = '1'
  5.     WHERE tbl_id = '2' AND row_nr = '1'
  6. ELSE
  7.     INSERT INTO component_psar (tbl_id, row_nr, col_1, col_2, col_3, col_4,
  8.                                 col_5, col_6, unit, add_info, fsar_lock)
  9.     VALUES ('2', '1', '1', '1', '1', '1', '1', '1', '1', '1', 'N')
  10.    
  11. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your
  12.      MySQL server version for the right syntax to use near 'IF EXISTS(SELECT * FROM
  13.      component_psar WHERE tbl_id = '2' AND row_nr = '1') UP' at line 1
  14.    
  15. INSERT INTO component_psar (tbl_id, row_nr, col_1, col_2, col_3, col_4, col_5, col_6, unit, add_info, fsar_lock)
  16. VALUES('2', '1', '1', '1', '1', '1', '1', '1', '1', '1', 'N')
  17. ON DUPLICATE KEY UPDATE col_1 = VALUES(col_1), col_2 = VALUES(col_2), col_3 = VALUES(col_3), col_4 = VALUES(col_4), col_5 = VALUES(col_5), col_6 = VALUES(col_6), unit = VALUES(unit), add_info = VALUES(add_info), fsar_lock = VALUES(fsar_lock)
  18.    
  19. IF EXISTS(SELECT * FROM component_psar WHERE tbl_id = '2' AND row_nr = '1')
  20. THEN
  21. UPDATE component_psar SET col_1 = '1', col_2 = '1', col_3 = '1', col_4 = '1', col_5 = '1', col_6 = '1', unit = '1', add_info = '1', fsar_lock = '1' WHERE tbl_id = '2' AND row_nr = '1'
  22. ELSE
  23. INSERT INTO component_psar (tbl_id, row_nr, col_1, col_2, col_3, col_4, col_5, col_6, unit, add_info, fsar_lock) VALUES('2', '1', '1', '1', '1', '1', '1', '1', '1', '1', 'N')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top