Forum Stats

  • 3,767,858 Users
  • 2,252,726 Discussions
  • 7,874,366 Comments

Discussions

SELECT based on values in Popup LOV

Baonerges
Baonerges Member Posts: 106 Blue Ribbon
edited Sep 7, 2021 7:45PM in APEX Discussions

Hi Everyone,

My users select multiple values in a Popup LOV field P3_EXTRA_COSTS. For example, they select 'ZIPPER','HELIX', and 'OUTSIDE'. I need a select statement which gets the total costs for all the items selected from table ESTEXTCOST like below. The following queries do not work.

SELECT NVL(SUM(EXT_COST),0) FROM ESTEXTCOST WHERE EXT_ITEM IN :P3_EXTRA_COSTS;
SELECT NVL(SUM(EXT_COST),0) FROM ESTEXTCOST WHERE EXT_ITEM IN '('''||replace(:P3_EXTRA_COSTS,',',''',''')||''')';

This is what I am trying to get to.

SELECT NVL(SUM(EXT_COST),0) FROM ESTEXTCOST WHERE EXT_ITEM EXT_ITEM IN ('ZIPPER','HELIX','OUTSIDE') 

How do I write a select query based on the values which are chosen in a Popup LOV?


EDIT: Spelling

Tagged:

Best Answer

Answers