Solved

Stocated procedures and php

Posted on 2002-05-10
5
504 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

733 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