Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: qwerty on April 28, 2011, 11:40:45 pm
-
Does anybody know a way to pass parameters? I tried
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.
-
You could ofcourse also switch to a "real" database as your EA backend ;D
Geert
-
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.
-
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 ? :'( :'( :'(
-
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.