SQL Editor

Posted by Roger Blanchard on 30-Jul-2014 07:18

I am attempting to use CREATE TRIGGER in the SQL Editor according to OE Data Management SQL Development doc. the following code will not run. It returns a syntax error in SQL statement at or about END (10713). 

Does anyone have any ideas?

CREATE TRIGGER Pub.nitroasl_mailer_trigger
BEFORE
INSERT ON Pub.nitroasl_mailer REFERENCING NEWROW FOR EACH ROW
IMPORT
import java.sql.* ;
BEGIN
Long current_id = (Long)NEWROW.getValue(1, BIGINT);
if (current_id <= 1) {
SQLCursor next_id_query = new SQLCursor("SELECT TOP 1 Pub.nitroasl_mailer_seq.NEXTVAL FROM SYSPROGRESS.SYSCALCTABLE");
next_id_query.open();
next_id_query.fetch();
Long next_id = (Long)next_id_query.getValue(1,BIGINT);
next_id_query.close();
NEWROW.setValue(1, next_id);
}
END

All Replies

Posted by DivyaTheja on 30-Jul-2014 07:56

Hi,

If you are using Progress DB Navigator's SQL Editor, by default the preference Progress Databases->DBNavigator>SQLEditor Separator will be set to semicolon(;). Can you please change the delimiter to some other character and try to execute the code?

Following article has more details.

knowledgebase.progress.com/.../P135184

Hope this helps,

DivyaTheja

Posted by Roger Blanchard on 30-Jul-2014 08:09

That was it...THANKS!!

This thread is closed