Home » Developer & Programmer » Forms » how to populate one column from database to list item
how to populate one column from database to list item [message #291700] Sun, 06 January 2008 02:24 Go to next message
karunakar_adepu84
Messages: 43
Registered: January 2008
Member
When I am adding one table column to list item
WHAT OR THE PROPERTY VALUES I HAVE TO SET
AND WHICH TRIGGER I HAVE TO SET?
Re: how to populate one column from database to list item [message #291833 is a reply to message #291700] Mon, 07 January 2008 00:32 Go to previous messageGo to next message
mintomohan
Messages: 104
Registered: November 2006
Location: India
Senior Member
hi,

You can create a record group using a query of the format:

SELECT column_name, column_name
FROM table_name


Now you can use the POPULATE-LIST built-in to populate the list item.

POPULATE_LIST ('LIST_ITEM','RECORD_GROUP');


Minto
Re: how to populate one column from database to list item [message #292322 is a reply to message #291833] Tue, 08 January 2008 09:39 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
where is Populate built in ? there is no trigger available
can you please little bit elaorate?
thanks
ilango
Re: how to populate one column from database to list item [message #292326 is a reply to message #291833] Tue, 08 January 2008 09:44 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Where I have to execute the command?
key event trigger for a particular list item?
Re: how to populate one column from database to list item [message #292331 is a reply to message #292322] Tue, 08 January 2008 09:52 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
You can do it at Design Time.
1. Create a Record Group.
2. Create a LOV and attach the Record Group.
3. Attach the LOV to the item.

I don't know why do you want to create it dynamically.
Anyway
Quote:

where is Populate built in ?
POPULATE_LIST ('LIST_ITEM','RECORD_GROUP');
Quote:

key event trigger for a particular list item?
It depends when you want to populate the item.

WHEN-NEW-FORM-INSTANCE?
WHEN-NEW-BLOCK-INSTANCE?
WHEN-NEW-RECORD-INSTANCE?


By
Vamsi
Re: how to populate one column from database to list item [message #302641 is a reply to message #291833] Tue, 26 February 2008 07:29 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Hi,

I created the item called "TEST" with item type as list item.

created the record group called "listrec" with selecting one column from the base table.

In when-new-block-instance trigger, I gave the following

POPULATE_list(:TEST,'listrec');


When I execute the form, I did not find any values in the list item. (The table have more than 200 records)

Any help please?

Ilango


Re: how to populate one column from database to list item [message #302646 is a reply to message #302641] Tue, 26 February 2008 08:01 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
As my knowledge, The record group should have two varchar2 columns to use it in populate_list.

You can select the same column twice by giving the alias so that it can show one column in the UI and the other to store.

By
Vamsi
Re: how to populate one column from database to list item [message #302652 is a reply to message #302646] Tue, 26 February 2008 08:18 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Mr.Vamsi,

I selected the same column twice in the record group but still did not displayed.

Ilango
Re: how to populate one column from database to list item [message #302656 is a reply to message #302652] Tue, 26 February 2008 08:27 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
If I'm not wrong, it should raise any error. Cross check the message line.
Check the link.
Try
POPULATE_list('<block_name>.TEST','LISTREC');
By
vamsi
Re: how to populate one column from database to list item [message #302659 is a reply to message #302656] Tue, 26 February 2008 08:37 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Mr.Vamsi,

Your syntax is correct. The link you provided, it is the same built in help in forms.

I am really wonder what must be the problem.
I did not any error. Just it showing blank list.



Ilango
Re: how to populate one column from database to list item [message #302663 is a reply to message #302659] Tue, 26 February 2008 08:54 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Do you face the problem still?
You may post your code snippet.

By
Vamsi
Re: how to populate one column from database to list item [message #302669 is a reply to message #302659] Tue, 26 February 2008 09:00 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Yes Mr.Vamsi,

Still I could not resolve it..

The record group query is (recone) :

SELECT DESIG_CODE, DESIG_CODE DUPLI FROM S_DESIG


List item is : item9
Block name : Block2

In when-new-block-instance,
I issued the following :

CLEAR_LIST('BLOCK2.ITEM9');
POPULATE_list('BLOCK2.ITEM9','RECONE');


I tried all the possibilities, still yet to find right solution

Ilango

[Updated on: Tue, 26 February 2008 09:02]

Report message to a moderator

Re: how to populate one column from database to list item [message #302784 is a reply to message #302669] Wed, 27 February 2008 00:39 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Mr.Vamsi,

Did you find any wrong in the syntax?

expecting your feedback

Ilango
Re: how to populate one column from database to list item [message #303253 is a reply to message #302784] Thu, 28 February 2008 09:28 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Ilango,
I didn't find any clue. But why you are populating the list dynamically?
Can't you do the following at design time?
1. Attach an LOV to the list item.
2. Attache a Record Group to the LOV.

By
Vamsi
Re: how to populate one column from database to list item [message #304683 is a reply to message #303253] Thu, 06 March 2008 02:46 Go to previous messageGo to next message
karunakar_adepu84
Messages: 43
Registered: January 2008
Member
this is the answer

first take record group with the same column twice

the conditions are
1) the columns we are selected they must be in char or varchar2 type.
2) there should be only two columns only.


ex: select to_char(empno) empno1,to_char(empno) empno2 from emp;


now we want to attach this record group for a list item
1) take empno as listitem.
2) take the when-new-form-instance trigger at form level:
3) the code is
declare
n number;
begin
n:=populate_group('groupname');
populate_list('list_itemname','recordgrname');
end;
Re: how to populate one column from database to list item [message #304689 is a reply to message #303253] Thu, 06 March 2008 03:32 Go to previous message
dillango
Messages: 145
Registered: January 2008
Senior Member
It is perfectly working now

Ilango
Previous Topic: Linking table with Hierarchical Tree
Next Topic: Migration 6i to 10g WIN_API_DIRECTORY_LIST
Goto Forum:
  


Current Time: Thu Feb 13 07:24:49 CST 2025