Book a Demo

Author Topic: EA Scripting problem with auto name counter.  (Read 3067 times)

asseco

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
EA Scripting problem with auto name counter.
« on: July 29, 2011, 10:01:47 pm »
Hi.
I tried to update auto name counter for diagram from within JScript script. I have configured EA > Settings > Auto name counter .. > Type: Dgm-Logical. It store data inside t_trxtypes table;  

I get counter data ( number ) from this xml variable:

xml = Repository.SQLQuery('select notes from t_trxtypes where description = \'Autocount\' and trx = \'Dgm-Logical\';');      


Repository.SQLQuery method can only select data. I tried update data like below but it not work.

counter = Repository.SQLQuery('update t_trxtypes set notes =\''+data+'\' where description = \'Autocount\' and trx = \'Dgm-Logical\'; commit;');

Is any other way to get/change or update actual counter value within JScript?
« Last Edit: July 29, 2011, 10:41:15 pm by marcin.asseco »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13419
  • Karma: +569/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA Scripting problem with auto name counter.
« Reply #1 on: July 29, 2011, 10:57:05 pm »
Use Repository.Execute(SQLUpdateString)

Geert

asseco

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: EA Scripting problem with auto name counter.
« Reply #2 on: July 30, 2011, 12:15:03 am »
Thx. Its working.