Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Method to receive table from function/procedure

574175Apr 24 2007 — edited Apr 26 2007
Hi everybody,

I'm new to Oracle SQL resp. PL/SQL and looking for a method to receive manipulated and combined data via SQL.

In MS SQL Server I can define a function that returns a table like this:

CREATE FUNCTION LargeOrderShippers ( @FreightParm money )
RETURNS @OrderShipperTab TABLE
(
ShipperID int,
ShipperName nvarchar(80),
OrderID int,
ShippedDate datetime,
Freight money
)
AS
BEGIN
INSERT @OrderShipperTab
SELECT S.ShipperID, S.CompanyName,
O.OrderID, O.ShippedDate, O.Freight
FROM Shippers AS S INNER JOIN Orders AS O
ON S.ShipperID = O.ShipVia
WHERE O.Freight > @FreightParm
RETURN
END

Is there a similar way to get back a table in Oracle? Since I need calculated values depending on record and filter criteria views won't work for this purpose.

Regards,
Stefan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2007
Added on Apr 24 2007
18 comments
737 views