Home » SQL & PL/SQL » SQL & PL/SQL » dynamic view
dynamic view [message #207346] Tue, 05 December 2006 04:00 Go to next message
user82
Messages: 49
Registered: June 2006
Location: Romania
Member
Hy

In the following example is the definition of the dynamic view i need to create....The problem is that i cannot set global variables "v_an" and "v_luna" i need to pass them from my application....Is there any way to do this??? Please help

CREATE OR REPLACE VIEW V_SOLD_INI AS
SELECT I.CODSOLDINI, I.CODPART, P.DEN_PART,
(SELECT SUM(SOLDLEI)
FROM
NPARTSOLDLUNA NS
WHERE
NS.CODPART = I.CODPART AND NS.AN = v_an AND NS.LUNA = v_luna
) AS SOLDREAL

FROM
SOLDINI I
LEFT OUTER JOIN NPART P ON I.CODPART = P.CODPART
Re: dynamic view [message #207358 is a reply to message #207346] Tue, 05 December 2006 04:26 Go to previous message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
You can do it either with SYS_CONTEXT or packaged function.

HTH
Previous Topic: What is createdynaset(sql,4)
Next Topic: Problem with trigger and NULLS
Goto Forum:
  


Current Time: Sun Dec 11 00:34:34 CST 2016

Total time taken to generate the page: 0.18637 seconds