From: Milan B. <mil...@gm...> - 2011-08-23 10:04:59
|
Hi, I'm trying to create a new template and run into some problems. Maybe I don't understand the templating language anymore, please help... 1. I'm trying to create trigger at position 999. In confdef file I wrote: <setting type="int"> <caption>Trigger position (0..32767)</caption> <key>{%object_path%}/triggerPosition</key> <default>999</default> <relation>{%object_handle%}</relation> <aligngroup>1</aligngroup> </setting> but it offers a value of 100 when dialog is shown. I make that 999 again, and when I submit and get generated code, it is reverted back to 100. 2. I have an exception string inside, so case is important. However, it spits out the text in uppercase. My .template file looks like this: -------------------------------------- {%--:Uncomment to edit template info visually.%}{%--:{%edit_info%}{%abort%}%}{%edit_conf%}{%kw:set term !! ; create trigger%} CT_{%object_name%} {%kw:for%} {%object_name%} {%kw:active after update or delete position {%getconf:{%object_path%}/triggerPosition:999%} as declare variable id bigint; declare variable operacija varchar(3); begin {%tab%}if (updating and new.ID is distinct from old.ID) then {%tab%}{%tab%}exception GRESKA 'THE FOLLOWING TEXT SHOULD NOT be lowercase!'; {%tab%}if%} (deleting or {%foreach:column: {%tab%}{%tab%}{%kw:or%} :{%ifcontains:{%getconf:{%object_path%}/columnNames%}:{%object_name%}:{%kw:old%}.{%object_name%} {%kw:is distinct from new%}.{%object_name%} %}%}) {%tab%}{%kw:then {%tab%}begin%} {%tab%}{%tab%}id = gen_id(gen_audit_id, 1); {%tab%}{%tab%}insert into audit_log(id, korisnik, datum, id) {%tab%}{%tab%}alues (:id, current_user, current_timestamp, old.ID); {%tab%}{%kw:end end!! set term%} ; !! -------------------------------------- any ideas? -- Milan Babuskov http://www.guacosoft.com |