Rehman Khan
Rehman Khan

Reputation: 45

How to populate specific data from database into list item?

I created ListItem1 with List Style (Poplist) for department no (10,20,30) and other ListItem2 with List Style (Tlist) for employees name. Record group for employees name

When i click on department no.10 then populate all employees name data into ListItem2. I want to populate data only employees names who falls under department no.10 or 20 or 30

CODE:

DECLARE

a VARCHAR2(100);
num NUMBER := 10;

BEGIN

a := populate_group ('R1');
    populate_list ('LIST1','R1');

END;

"LIST1" for populate employees name data "R1" is a group record name

Upvotes: 1

Views: 544

Answers (2)

AndyDan
AndyDan

Reputation: 759

Sounds like you just need to add where department_no = :List1 to the R1 record group.

Upvotes: 1

ColdSurgeon25
ColdSurgeon25

Reputation: 66

In PL/SQL lists are called collections.

Try something like it:

DECLARE
  TYPE population_type IS TABLE OF NUMBER INDEX BY VARCHAR2(64);
  country_population population_type;
  continent_population population_type;
  howmany NUMBER;
  which VARCHAR2(64)

BEGIN
  country_population('Greenland') := 100000;
  country_population('Iceland') := 750000;
  howmany := country_population('Greenland');

  continent_population('Australia') := 30000000;
  continent_population('Antarctica') := 1000; -- Creates new entry
  continent_population('Antarctica') := 1001; -- Replaces previous 
value
  which := continent_population.FIRST; -- Returns 'Antarctica'
-- as that comes first alphabetically.
  which := continent_population.LAST; -- Returns 'Australia'
  howmany := continent_population(continent_population.LAST);
-- Returns the value corresponding to the last key, in this
-- case the population of Australia.
END;

Upvotes: 0

Related Questions