Solved

Stocated procedures and php

Posted on 2002-05-10
5
495 Views
Last Modified: 2013-12-09
I have a stocated procedure in interbase and i want to execute this procedure with php.
What i actually did is that i execute the procedure but i can't acces the result that the procedure is returning.
I have tried this:

        $sql_stat = 'execute procedure get_trn_id RETURNING_VALUES :var';
     $res = ibase_query($dbh, $sql_stat);        

the result should be in the variable 'var' but i get an error message looking like this:

Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 29
RETURNING_VALUES
Statement: EXECUTE PROCEDURE get_trn_id RETURNING_VALUES :sumb

So, help please!!
0
Comment
Question by:lindu
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:YodaMage
ID: 7006781
Lets see the SQL of your procedure.

I think you want somethin like:

PROCEDURE get_trn_id  
RETURNS (
    NUM INTEGER)
AS
begin
  NUM = {Whatever code needed to get you var};
end
0
 
LVL 1

Accepted Solution

by:
thegroup earned 50 total points
ID: 7027866
You could use:

select sumb from get_trn_id into :sumb

That way the select statement extract the values and put them in the variable :sumb.

(I don't know exactly the php sintax that executes a query)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7096337
Please update and finalize this question.  Experts, if no response in 7 days, please provide me with closing recommendations.
Thanks,
Moondancer - EE Moderator
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 7096373
Split them.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7100486
Thanks for returning and finalizing this.  Can you please tell us where we "missed" giving you A level response here?  If the grade was given in error, I can correct this for you.

More about grades here:
http://www.experts-exchange.com/new_users/Q_20310437.html

Thanks
Moondancer - EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

939 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

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now