Author Topic: Repository.Execute question  (Read 551 times)

qwerty

  • EA Guru
  • *****
  • Posts: 8968
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Repository.Execute question
« 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.
« Last Edit: April 29, 2011, 01:55:07 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7745
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Repository.Execute question
« Reply #1 on: April 29, 2011, 05:24:58 pm »
You could ofcourse also switch to a "real" database as your EA backend ;D

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 8968
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Repository.Execute question
« Reply #2 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.

EAUser3200

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Repository.Execute question
« Reply #3 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 ?  :'( :'( :'(

qwerty

  • EA Guru
  • *****
  • Posts: 8968
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Repository.Execute question
« Reply #4 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.