Solved

Stocated procedures and php

Posted on 2002-05-10
5
490 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Split them.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Read about achieving the basic levels of HRIS security in the workplace.
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…

771 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

12 Experts available now in Live!

Get 1:1 Help Now