我必须将FlightDate
,FlightNumbers
作为参数传递给 Oracle 存储过程,如下所示。
CREATE OR REPLACE PROCEDURE GetPaxDetails(
FlyingDate IN PAX_DETAILS.FlightDate%TYPE,
FlightNumbers IN VARCHAR(300))
IS
BEGIN
-- Assume that we've received **FlightNumbers** as '0620,0712,0154'
-- Basically I am trying to select all passenger details (PAX_DETAILS)
-- for those flights passed in as a parameter(**FlightNumbers**)
-- for the specified dates
-- In this procedure the query should be generated something like below:
SELECT *
FROM PAX_DETAILS
WHERE TO_DATE(FlightDate,'DDMONYY') BETWEEN TO_DATE(FlyingDate,'DDMONYY')
AND TO_DATE(FlyingDate,'DDMONYY') + 1
AND FlightNo IN ('0620,0712,0154')
END
我不明白如何将参数转换为查询内部的FlightNumbers
东西。AND FlightNo IN ('0620,0712,0154')