Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ORA-03113 error while executing an Oracle function from PowerBuilder

Posted on 2006-07-17
5
Medium Priority
?
1,862 Views
Last Modified: 2013-12-26
Hi,


My Stored Procedure is
------------------------------------------------------------------------
create or replace procedure concatname(a varchar2,
                              b varchar2,
                              c out varchar2)
  as
  begin
    c := a || b;
  end;
 


My Function is
--------------------------------------------------------------------
create or replace function ex(sp varchar2)
  return varchar2 as
   v varchar2(100);
  begin
    execute immediate 'begin '||sp||'(''test'','' procedure'',:o); end;'
    using out v;
    return v;
  end;
 


Iam using PowerBuilder 8 as a FRONTEND Tool( connecting to ORACLE db through ODBC driver) for executing the above function where i will pass the stored procedure name ( CONCATNAME ) as an argument.


While executing this function from the frontend tool iam getting the following error.

SQLCA.SqlErrText = ''SQLSTATE - 08S01||[ORACLE][ODBC][ORA]ORA-03113: end-of-file on communication channel.

I dont know, why this error is coming ?  As the function is executing fine through ISQL ?

Can anybody help me ? How to avoid this error ( ORA-03113 ) ?
0
Comment
Question by:xsysys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
michaelstoffel earned 500 total points
ID: 17121890
Execute immediate won't work with stored procedures where you are expecting results back.  It shouldn't have disconnected you from the database, but it still wouldn't have worked.

Check out Remote Procedure Calls,declaring in the help.  Basically, create a custom transaction object and in the local external functions, declare your procedure as:
SUBROUTINE concatname(string a, string b, ref string c) RPCFUNC;

Then simply call as SQLCA.concatename(a,b,c).

If you want dynamic invocation as indicated by your function, you really need to check out Dynamic SQL Syntax 4 in the help, which is not trivial.
0
 
LVL 4

Assisted Solution

by:Lordain
Lordain earned 500 total points
ID: 17170961
I agree with Michael as I find this to be a better practice.  My only comment is since you want a return you declare it as a function.  Use Subroutine when you don't want a return.
0
 
LVL 5

Expert Comment

by:michaelstoffel
ID: 17171962
I agree, the current Oracle procedure should be a function returning a VARCHAR2 instead of an OUT parameter and then change the corresponding PowerBuilder declaration to match.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question