Problem with special symbols in ExecSQL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Freezer_86
Posts: 9
Joined: Thu 14 Feb 2013 09:11

Problem with special symbols in ExecSQL

Post by Freezer_86 » Tue 14 Feb 2017 12:02

Hello,

I findout that ODAC got problem with using special symbols in table names.
I got table which named like "СКЛАД СІМ'Ї" (i know that it's not a good practice, but Oracle supports it).
When i use this table in TOraQuery (select * from "СКЛАД СІМ'Ї"), it's works perfectly.
But when i try to use it in PL/SQL block, like this:

Code: Select all

    Session.ExecSQL( 'begin ' + #13#10 +
                     '  select idgroup, parent, parentfield        ' + #13#10 +
                     '  into :p_idgroup, :p_parent, :p_parentfield ' + #13#10 +
                     '  from "СКЛАД СІМ'Ї"      ' + #13#10 +
                     '  where idobject = :p_idobject;              ' + #13#10 +
                     'end;',
                     [ FGroupID, FParentID, FParentField, ObjectID
                     ]
                   );
It's raise exception "Compilation is not possible".

Strange, but PL/SQL Developer exec it fine, so problem not in Oracle:

Code: Select all

begin 
  select idgroup, parent, parentfield        
  into :p_idgroup, :p_parent, :p_parentfield 
  from "СКЛАД СІМ'Ї"      
  where idobject = :p_idobject;              
end;
Problem is in ' - symbol, because with all other tables all works fine.
P.S. Odac version 9.6.20 in direct mode, Oracle Database 10g Enterprise Edition Release 10.2.0.3.0

Freezer_86
Posts: 9
Joined: Thu 14 Feb 2013 09:11

Re: Problem with special symbols in ExecSQL

Post by Freezer_86 » Fri 24 Feb 2017 08:26

Hello again,

Did you reproduce error?
Maybe you need something from my side (test case or ... whatever)?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Problem with special symbols in ExecSQL

Post by MaximG » Wed 01 Mar 2017 10:36

We fixed the error related to using in a query a table which has quotes in its name. The fix will be included in the next ODAC build.

Post Reply