Error when I create a new stored procedure with TOraStoredProc

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
plobry
Posts: 6
Joined: Wed 31 Mar 2010 08:17

Error when I create a new stored procedure with TOraStoredProc

Post by plobry » Mon 10 Feb 2014 10:49

Hello,

I have a program developed in Delphi 6 with odac Version 6.90.0.54

I can create a new stored procedure by running this code:
StorelandOraStoredProc.SQL.Text: = 'CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;';
// Not mandatory StoredProcName
StorelandOraStoredProc.ExecSQL;

It works.

We are migrating the program with Delphi XE4 with odac Version 9.0.1
The same code does not work.

1 - I get the message must be defined StoredProcName.
2 - When I set StoredProcName I have an ORA-04043 error: object does not exist proc_test

Here is the code with Delphi XE4:
OraStoredProc.SQL.Text: = 'CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;';
// If StoredProcName, I get the error message: StoredProcName must be defined.
OraStoredProc.StoredProcName: = 'proc_test';
OraStoredProc.ExecSQL;

My question: How to create a new stored procedure with ODAC v9.0.1?
What is the correct method?

Thank you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error when I create a new stored procedure with TOraStoredProc

Post by AlexP » Mon 10 Feb 2014 13:17

Hello,

This is a correct error message, since the OraStoredProc component is designed for work with existing procedures. To create procedures, you can use the following components:

Code: Select all

  OraSession1.ExecSQL('CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;');

  OraQuery1.SQL.Text('CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;');
  OraQuery1.Execute;

  OraSQL1.SQL.Text('CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;');
  OraSQL1.Execute;

  OraScript1.SQL.Text('CREATE OR REPLACE PROCEDURE proc_test IS BEGIN NULL; END;');
  OraScript1.Execute;

plobry
Posts: 6
Joined: Wed 31 Mar 2010 08:17

Re: Error when I create a new stored procedure with TOraStoredProc

Post by plobry » Mon 10 Feb 2014 13:41

Thank it works.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error when I create a new stored procedure with TOraStoredProc

Post by AlexP » Mon 10 Feb 2014 13:48

If you have any further questions, feel free to contact us.

Post Reply