![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to do a simple If Exists... table update on a |
#3
| |||
| |||
|
|
Hello, I'm trying to do a simple If Exists... table update on a "Sybase Adaptive Server Anywhere e-Business Anywhere" db on a Linux server. I'm getting a syntax error but I don't know enough about Sybase to see what's wrong here. Here's my code. IF NOT EXISTS(SELECT * FROM LP_DIV WHERE DIV_NUM='070388') THEN BEGIN INSERT INTO LP_DIV (DIV_NUM, NAME, CREATE_DTM) VALUES ('070388', '070388', NOW()); INSERT INTO LP_DIV_GRP (GRP_CD, DIV_NUM) VALUES ('ALL','070388');END IF NOT EXISTS(SELECT * FROM LP_DIV WHERE DIV_NUM='070416') THEN BEGIN INSERT INTO LP_DIV (DIV_NUM, NAME, CREATE_DTM) VALUES ('070416', '070416', NOW()); INSERT INTO LP_DIV_GRP (GRP_CD, DIV_NUM) VALUES ('ALL','070416');END Is it okay that the lines have several commands and are separated by semi-colons? Thanks. Ken |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |