Author Topic: OracleOleDB problem?  (Read 4063 times)

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
OracleOleDB problem?
« on: April 20, 2010, 10:27:24 pm »
Hello,
I begin to play with oracle and EA.
I connect to DB using Oracle Provider for OLE DB.
I have the following problem:
this SQL query>
select instr('Tag:Value',':') + 1 AS C1 from dual;

returns 5 in PL/SQL Developer
but
returns 41 when using it as as Custom SQL search in EA.

Is this a problem of OLE bridge?
Do you know how to solve it?

Thanks for any hints.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: OracleOleDB problem?
« Reply #1 on: April 20, 2010, 11:34:17 pm »
Quick look suggests a data typing problem...

try: select instr('Tag:Value',':') + '1' AS C1 from dual;

You should get '41' from both...

(Fingers crossed)  ;)

Isn't software wonderful?

HTH,
Paolo
« Last Edit: April 20, 2010, 11:34:45 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: OracleOleDB problem?
« Reply #2 on: April 20, 2010, 11:44:07 pm »
OK I haven't described my goal :-)
I want to get  5 in EA search.

Thanks

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: OracleOleDB problem?
« Reply #3 on: April 21, 2010, 12:00:11 am »
I have overcome it by:

select instr('Tag:Value',':') - -1    as C1 from dual;

You'are right, software is wonderful ;-)

Still interesting in more appropriate solution...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: OracleOleDB problem?
« Reply #4 on: April 21, 2010, 12:08:22 am »
Quote
OK I haven't described my goal :-)
I want to get  5 in EA search.

Thanks

have you tried
Code: [Select]
select 5 as C1 from dual ;D

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: OracleOleDB problem?
« Reply #5 on: April 21, 2010, 04:40:38 pm »
For your information,

On SQL Server both (ran through EA search)
Code: [Select]
select CHARINDEX (':', 'Tag:Value') + '1' AS c1and
Code: [Select]
select CHARINDEX (':', 'Tag:Value') + 1 AS c1result in 5

Geert

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: OracleOleDB problem?
« Reply #6 on: April 21, 2010, 06:27:43 pm »
It's interesting,
I still have the result 41 in EA search. It seems it's a problem of some driver bridge...
But the hack with '- -' works so I will not continue to try to discover it.

Thanks