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: May 16, 2022 - 2:35 am UTC

Version: 12c

Viewed 10K+ times! This question is

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

  (2 ratings)

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

Faisal, May 11, 2022 - 1:29 pm UTC

Select is working but how we can use same logic to update the multiple records for the given list
Connor McDonald
May 16, 2022 - 2:35 am UTC

Not sure what you mean. Can you give us a full test case with some notes on what you want to achieve?

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.