Skip to Main Content
  • Questions
  • How to pass multiple value to my parameter in SQL query

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, RAVI.

Asked: May 14, 2020 - 7:05 pm UTC

Last updated: November 18, 2021 - 3:13 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi Tom,

I have a query ,I want to pass multiple values to pbd_prod_code is this possible ,as I am getting null v after passing 1001,1002 values to the parameter

SELECT field_key,
field_lable,
FROM json_table(
(SELECT PBD_BLOCK_INFO
FROM PIIM_PROD_BLOCK_DEFN_TEST
WHERE PBD_PROD_CODE in (:PBD_PROD_CODE)
AND PBD_BLOCK_ID = :PBD_BLOCK_ID ),
'$[*]' COLUMNS(field_lable path '$.fieldlabel',
field_key path '$.fieldkeyid'));

and Connor said...

Here's a video walk through on the technique


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

APEX

Alex, November 18, 2021 - 1:35 am UTC

What should the syntax be for a passing a multiple values from an APEX LOV into a Page report SQL statement
Connor McDonald
November 18, 2021 - 3:13 am UTC

A multi-select will return the selected values as a colon delimited string, eg

CONNOR:CHRIS:TOM

You can use the technique as per the video to convert that into rows

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.