using where clausule with Pervasive stored procedure in SQL

I've been trying to implement a where function in my iReport using SQL

i call a procedure (pTest), but i am unable to add a where clausule! It is no option to change the procedure unfortunately.
Do i need to make temp tables? how do i insert the return of a procedure in a table?
pr0fierAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mirtheilSoftware DeveloperCommented:
You have to drop and recreate the stored procedure in order to edit it.  
You return records from a stored procedure using the RETURNS clause or an OUT parameter.  I would suggest using the RETURNS clause as it returns the result as a resultset.  An example of a Stored Procedure with a RETURNS clause:
CREATE PROCEDURE DATERETURNPROC(IN :PDATE DATE)
RETURNS(
ID INTEGER,
Name CHAR(7),
Section CHAR(3),
Max_Size USMALLINT,
Start_Date DATE,
Start_Time TIME,
Finish_Time TIME,
Building_Name CHAR(25),
Room_Number UINTEGER,
Faculty_ID UBIGINT
);
BEGIN
SELECT ID, Name, Section, Max_Size, Start_Date, Start_Time, Finish_Time, Building_Name, Room_Number, Faculty_ID FROM CLASS WHERE START_DATE = :PDATE;
END;
 
And the calling for the stored procedure: 
CALL DATERETURNPROC('1995-06-05')

Open in new window

0
pr0fierAuthor Commented:
as i stated above (perhaps unclear) i cannot change the current procedure because it is used for a lot of other applications.
 
Might it be a sollution to call the pTest procedure inside a (newly, temporary) procedure and run a new SELECT statement with the WHERE clausule over the returned (first, pTest) data?
 
0
mirtheilSoftware DeveloperCommented:
I don't think there's any way to do what you are thinking.  
What I would suggest would be to extract the actual SQL statement being issued in the Stored Procedure, modify it with the WHERE clause you are wanting and either execute it directly or create a secondary stored procedure that executes the SQL you want.  That would maintain the original Stored Procedure and allow you to restrict with the WHERE clause.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pr0fierAuthor Commented:
agree with Mirtheil - this cannot be done with pervasive and ireport, i will try to make a resultset with this stored procedure and query that one :(
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.