Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: qwerty on April 28, 2011, 11:40:45 pm

Title: Repository.Execute question
Post by: qwerty on April 28, 2011, 11:40:45 pm
Does anybody know a way to pass parameters? I tried
Code: [Select]
Repositotry.Execeute ("INSERT INTO table ('col1', 'col2') VALUES (?, ?)", val1, val2)but that did not work. Especially I want to insert a BLOB (image) which is probably not so nice using quoted values.

q.

[edit:] I found a way to insert a BLOB by using 0x notation for the binary data (which is a workaround as this differs between databases).

[argh!] Now I get DAO.Database errors when trying to insert the BLOB. Jet 3 and 4 messages are different but none of them works. Bah! Mikeysoft!

[edit:] It now seems to be obvious that there is a 64k limit to the SQL string length. Who can be blamed for that? (I guess you need to tell Mikeysoft that BLOBs and the according SQLs are large - I have a faint remembering...) However, I'll report this as a bug to Sparx.
Title: Re: Repository.Execute question
Post by: Geert Bellekens on April 29, 2011, 05:24:58 pm
You could ofcourse also switch to a "real" database as your EA backend ;D

Geert
Title: Re: Repository.Execute question
Post by: qwerty on April 30, 2011, 04:50:06 am
Haha. As if that would ease access to the database from within EA.

Btw.: The "real" data is the XMI. The database is just a means of getting fast access. RR in ancient days worked only on its XMI predecessor (the mdl files).

I got feedback from Sparx: Execute is not officially supported.

q.
Title: Re: Repository.Execute question
Post by: Arshad on November 22, 2017, 10:17:49 pm
Hi Qwerty
First sorry for digging this post. ::)

You've mentioned as found a way for inserting blob data.Can you please share the qorkaround ?  :'( :'( :'(
Title: Re: Repository.Execute question
Post by: qwerty on November 23, 2017, 12:46:05 am
Phew. 6 years later....

I really can't remember. Probably you can pass a string value which is encoded by the compiler using the "0x" followed by hex data notation. But that's just a guess. The real "work around" is likely to get the database connection from EARepository.ConnectionString and bypass EA completely.

q.