Link to home
Start Free TrialLog in
Avatar of IssacJones
IssacJones

asked on

Returning rows with a stored procedure

Hi

I hope somebody can help me with the following.

I need to retrieve some records using a SELECT but also using a stored procedure.

Suppose the table (myTable) I have has the following format:

ID      NAME     DOB     SCORE

I have a stored procedure myStoredProcedure(NAME, X, Y, Z)

where NAME and SCORE are values passed in and X, Y and Z are returned values.

This is the pseudo code I'm trying to do

SELECT * FROM myTable WHERE myTable.SCORE = X "using" myStoredProcedure(myTable.NAME, X, Y, Z)

where X is an output parameter from the stored procedure using values from myTable.

Can anybody help?

Thanks in advance

John
ASKER CERTIFIED SOLUTION
Avatar of Barry Cunney
Barry Cunney
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The function will have just return a single value - Why are you returning 3 different values - What is the business logic?
May have to look at using a table valued function and cross apply
Avatar of IssacJones
IssacJones

ASKER

the 3 different values are used in other cases. I'll try your first idea.