Home » Developer & Programmer » Forms » Selecting data from tables dynamically
Selecting data from tables dynamically [message #306486] Fri, 14 March 2008 08:44 Go to next message
satish_dba
Messages: 9
Registered: February 2008
Location: BANGALORE
Junior Member

Hi experts,

I Want to populate the data from a table, which is given by the user at runtime.

I have a block to populate the data. I have been trying to display the records based on table name (from a text field) like lexical parameter.
but i was failed...


please somebody help me....


regards,
SATISH

[Updated on: Fri, 14 March 2008 08:53] by Moderator

Report message to a moderator

Re: Selecting data from tables dynamically [message #306495 is a reply to message #306486] Fri, 14 March 2008 08:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68745
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This is NOT an PL/SQL expert question.

And why making it a poll?

Regards
Michel

[Updated on: Fri, 14 March 2008 08:53]

Report message to a moderator

Re: Selecting data from tables dynamically [message #306537 is a reply to message #306486] Fri, 14 March 2008 10:44 Go to previous message
solisdeveloper
Messages: 48
Registered: March 2008
Location: Mexico
Member
Hi:

You can use the "Set_Block_Property" Built-In with the property "Query Data Source Name" to set programaticaly wich table you are going to popullate the block from, Personally i've never used it, but you can find this in the "Form Builder Help" Just push Ctrl+H or F1.

You can also use the same built-in to programatically set the default-where property of the block, this option I've actually used it and it's worked great for me.

for example this is what i use to popullate my block with data from my table "users" with all the valid users contained in it:

In the Trigger Key-Next-Item of my text field "It_user" i wrote the following code:

DECLARE
  vWhere  VARCHAR2(500);
BEGIN
  vWhere := 'usernumber  = ' || :blk_control.it_user || ' AND userstatus <> ' ||chr(39) || 'INVALID' || chr(39);
  SET_BLOCK_PROPERTY('blk_displayblock',DEFAULT_WHERE,vWhere);
END;

[Updated on: Fri, 14 March 2008 10:46]

Report message to a moderator

Previous Topic: What is this message?
Next Topic: 12545: target host or object does not exist
Goto Forum:
  


Current Time: Mon Mar 10 22:14:33 CDT 2025