Book a Demo

Author Topic: Access Code Generation Options via SQL  (Read 6076 times)

Konrad Wieland

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Access Code Generation Options via SQL
« on: April 16, 2013, 06:41:01 pm »
Hi all,

I've tried to access the code generation option table (t_genopt) via SQL out of my C# plug-in, but I failed.

The call looks like that:
Code: [Select]
repository.SQLQuery("SELECT * from t_genopt")
However, I always get an error message inside EA:
Quote
Error:
Code = 0x0
Source = Line: 0; Char:0
Error Description = (null)
For all other tables, which I tested, it works, but not for t_genopt. The select statement works when executing it in Access or EA or SQL server.

Do you have an idea why it does not work?

Thanks a lot in advance!

Cheers
Konrad

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Code Generation Options via SQL
« Reply #1 on: April 16, 2013, 06:49:01 pm »
I also get this error and it seems to be dependent on the contents of t_genopt. It is definitely an EA bug (but it was never important for me to report it.) If you run
Code: [Select]
Execute ("DELETE FROM t_genopt WHERE AppliesTO = 'class'")once you will not get the error. So it's because of some data in the class row. Feel free to report the bug.

q.

P.S. This row contains the binary non-displaying char unit separator.
P.P.S.:Can't check this easily now, but likely if you execute
Code: [Select]
SELECT * FROM t_genopt WHERE NOT AppliesTo = 'Class'you will not see the error message. To get the original contents, run the query builder which returns also the binary data.
« Last Edit: April 16, 2013, 06:55:24 pm by qwerty »

Konrad Wieland

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Access Code Generation Options via SQL
« Reply #2 on: April 16, 2013, 07:06:47 pm »
Thanks a lot for your response.

But problem is, that I'm interested in exactly this raw to set the code gen options before generating code... :(

Cheers
Konrad

P.S.: I will contact the HQ for this issue/bug.
« Last Edit: April 16, 2013, 07:07:23 pm by konradw »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Code Generation Options via SQL
« Reply #3 on: April 16, 2013, 07:41:15 pm »
Konrad,
you should then report the bug.

As a workaround: you can construct your own SQL bypassing EA's API. For this you have to find out which ODBC/native driver to choose. I once did that before I was aware of the Execute API call. It's ugly but somehow it works.

Alternatively if you have control of the class row you eventually must not read it (since you have it stored somewhere else). The Repository.Execute will eventually take the binary data without moaning.

However, a fix from Sparx is appreciated.

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Access Code Generation Options via SQL
« Reply #4 on: April 16, 2013, 08:25:56 pm »
Hi,

in %appdata%Sparx System\EA\DBerr.txt
you find the original error message.

Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Code Generation Options via SQL
« Reply #5 on: April 16, 2013, 08:38:51 pm »
Not in this case, Helmut. It's some computation error inside EA when parsing the contents of the row. Simply because they store binary data which then can't be converted correctly to XML.

q.