I'm new to Oracle SQL and I'm currently working on an Oracle SQL view in Oracle SQL Developer.
I need two parameters in my View
- fruitType (string)
- fruitNumber (int)
I tried the following (simplified) statement in Oracle SQL Developer:
CREATE VIEW FRUITSRESULT (fruitType, fruitNumber) AS
SELECT
fruit_col1 as FruitType,
fruit_col2 as FruitNumber
fruit_col3 as FruitInfo
FROM
FRUITGARDEN
WHERE
fruit_col1 = fruitType
fruit_col2 = fruitNumber
;
Unfortunately this does not work, I always get the following error:
Error starting at line : 1 in command -
...
ORA-00904: "FRUITNUMBER": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Do you know how to solve this error?
Is it actually possible to create a parameterized View in Oracle SQL?
whereclause on top of it, because predicates are pushed into view.