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')
クエリ内のようなものに変換する方法がわかりません。