Solved

How to populate list in oracle form using a dynamic recordgroup based on an Sql which has varibales to be parsed at run time.

Posted on 2009-04-07
3
4,652 Views
Last Modified: 2013-12-11
How to populate list in oracle form using a dynamic recordgroup based on an Sql which has varibales to be parsed at run time.
0
Comment
Question by:haf70
  • 2
3 Comments
 
LVL 20

Assisted Solution

by:flow01
flow01 earned 20 total points
ID: 24089643
to get the idea : can you give some examples of what should be dynamic and which variables are involved ?
In an record group you can refer to forms globals and block.items.
0
 

Author Comment

by:haf70
ID: 24093998
Please see the procedure below which I am using to populate the the record group.
I am facing problem with the variables used in the query string.


PROCEDURE populate_hr_list IS
rg_id   RECORDGROUP :=NULL;
V_RG_NAME VARCHAR2(100);
V_STATUS NUMBER;
v_query varchar2(1000) :=NULL;
BEGIN
      V_RG_NAME := 'hr';
      CLEAR_LIST(:VARS.L1);
      
     rg_id := FIND_GROUP(V_RG_NAME);
      IF NOT ID_NULL(rg_id) THEN
         DELETE_GROUP(rg_id);
     END IF;
     v_query := 'select '|| :vars.a||', '|| :vars.b||' from dual';
     rg_id :=CREATE_GROUP_FROM_QUERY(V_RG_NAME ,V_QUERY);
     IF NOT ID_NULL(rg_id) THEN
       V_STATUS := POPULATE_GROUP(rg_id);
       POPULATE_LIST(:VARS.L1,rg_id);
    END IF;
    DELETE_GROUP(rg_id);
end;
0
 

Accepted Solution

by:
haf70 earned 0 total points
ID: 24094411
Found solution

put 3 quotes in front and back of the variable within the query variable.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now