Where clause in Forms

Hi All
i have used a where where clause in my forms after that i need to check the data from same form but it was not executed the data and giving a error no data retrived after that i remove the where clause it works fine
please guide me the way so without removing the where clause i can check the data from database through forms.
operating system Win-Xp
Forms AND Database 9i
Thanks And regards
Vikas Singhal

When you call this form, you pass a parameter list to your form?
If so, in when new form instance trigger, assign value of this parameter to another parameter and then use this last parameter in your where condition; doing so you will able to display your data.
Hope it helps you,
Fabrizio
If this answer is helpful or correct, please mark it. Thanks.

Similar Messages

  • Where clause on forms component

    Q- Security - We are creating a form application using the wizards, but only want the user to see their records, we are using portal30.wwctx_api.get_user to get the username (lightweight). Using the forms component wizard how do we specify a where clause ?

    I have 2 solutions to this problem:
    1. Create a view on the base table with a WHERE condition and base your form on that view.
    2. For that field in you form, let's say MY_USER, you specify a default value as
    portal30.wwctx_api.get_user
    and from the "default value type" list you select "function returning varchar", and after that you make that field hidden.
    Hope this will help

  • How can we use  form variable in where clause while personalization

    Dear,
    I have a requirment for using select in personalization, actully we have created temporary table, now we want to get data from select satatement on event"when-new-record-instance' trigger, now in action tab i have selected action which is property and message, in message column showing value "${item.q_res.transaction_id.value}" it shows on validate button but when this form variable use in action type(property) which is consist on select statement "=SELECT to_char(QTY) FROM TEST_TABLE where transaction_id = ${item.q_res.transaction_id.value}" system didn't get value pressing validate button although there is a single record in customize table while without where cluase was getting data perfectly.
    please advice.

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • How to set the where clause of a value set on the basis of a form field

    I am using a DFF(Descriptive FlexField), which needs to display the value of a certain column(say columnA) on the basis of the value of another column(say columnB).
    So i have created a value set which points to the table which has both these columns, and the DFF uses this value set. However, the problem is that I have not put any where clause in the value set, because of which i cannot handle the exact fetch returns more than one rows error.
    The query has to be as follows:
    select ColumnA from tbl where ColumnB = [ a form value ];
    What I want to know is how can i get the value of a certain field of a certain block of the form in the above query.
    Edited by: 981615 on Jan 14, 2013 12:48 AM
    Edited by: 981615 on Jan 14, 2013 12:48 AM

    Just have a look over these two statements if it solves your problem
    one time where clause
    Set_Block_Property('BLOCK_NAME',ONETIME_WHERE,your form item);
    dynamic where clause
    set_block_property('BLOCK_NAME'default_where, your form itme)
    you can where clause at run time from any procedure or some triggers

  • Where clause problem with sub-queries in forms 6i

    where is the best place to put a sub query?? I have been using the set block property, however when running a sub query an alternative method must be used. what are some other options?? I have tried to have the query directly in the data block property palette but to no avail...
    There are 2 tables project and assignment
    maximum resources cannot be exceeded therefore a count of employees
    on the assignment table establishes that there are open spaces on the project.
    This code Here is my code for my where clause on the data block
    project.resources_maximum >
    (Select Count(assignment.employee_ID)
    From assignment
    Where assignment.project_ID = project.project_ID
    group by assignment.project_ID
    and project.end_date>sysdate;
    I was reading that the project table must be defined in the from clause
    to have the query go row by row, otherwise multiple rows are returned
    however I cannot define the project in the from,
    could this be why this doesn't work???
    original SQL that does work
    Need to migrate this to forms
    Select project.project_ID
    from project
    Where project.resources_maximum >
    (Select Count(assignment.employee_ID)
    From assignment
    Where assignment.project_ID = project.project_ID
    group by assignment.project_ID
    and project.end_date>sysdate;

    Looking at your query that works at the bottom, I do not see any reason that you would need to include the Assignment table in the From list. Just use the same where clause in the form:
      Where project.resources_maximum
        > (Select Count(assignment.employee_ID)
           From assignment
           Where assignment.project_ID = project.project_ID
           group by assignment.project_ID  )

  • On success of form save I want to go to another for with a detail where clause

    I have the follow code snippet which is intented to go to a form on a successfull save. I query some data based on the save then build a url to navigate to a new form. I want the form to show only data that is lacking in one column not being populated (column is null). The url works, but the form detail where clause is ignored. Does anyone have any experience with passing detail where clauses to a form? Did I miss something in the code below?
    begin
    select count(rl_id) into n_rl_id_cnt
    from rfq_lines
    where part_part_id is null and rh_rh_id=n_rh_id;
    exception
    when others then
    null;
    end;
    htp.p('cnt '||to_char(n_rl_id_cnt));
    if n_rl_id_cnt>0 then
    htp.p('cnt >1');
    my_url := 'PORTAL30.wwa_app_module.link?' ||
    'p_arg_names=_moduleid&p_arg_values=3677858481' ||
    '&p_arg_names=_show_header&p_arg_values=YES' ||
    '&p_arg_names=rh_id&p_arg_values=' || LTRIM(TO_CHAR(n_rh_id)) ||
    '&p_arg_names=_rh_id_cond&p_arg_values=%3D'||
    '&p_arg_names=_detail_where_clause&p_arg_values=part_part_id%20is%20null'; -- <this is not working right. where clause is ignored.
    htp.p(my_url);
    go (my_url);

    Hi Jeffrey ,
    You need to use a custom Format script for the field.
    Regards
    Sukrit Dhingra

  • How to establish a where clause dinamically in a form?

    I've a form with a table activities that must call (with a custom button) to a form with (only) the documents associated to this activity.
    In the BD i have the table Activities (pk=codi_acti), the table documents (pk=codi_docu) and one more table for associate both called activities_documents (pk=codi_acti, codi_docu).
    The user editing the activity X after click the button must see all the documents of X but nothing else.
    My first attempt was a MD Form with the table activities_documents as master and the table documents as detail, but documents have a blob column and then this is not possible.
    Now I'm trying to establish the where clause to perform this but I can't get it. I pass codi_acti to this (documents) form and then I should show all the documents that have codi_docu in the table activities_documents, otherwise SELECT * FROM documents WHERE codi_docu IN (SELECT codi_docu FROM activities_documents WHERE codi_docu=:codi_acti).
    How can I achieve this?
    Please Help!!!
    Sincerely
    David Montejo

    Forms can autoquery data based on the URL used to call the form. You can build the URL
    and call the form with the required query, on successfull form submission you can do the following
    begin
    declare
    my_url varchar2(2000);
    n_rl_id number;
    begin
    n_rh_id:=p_session.get_value_as_NUMBER(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_RH_ID',
    p_index => 1
    my_url := 'PORTAL30.wwa_app_module.link?' ||
    'p_arg_names=_moduleid&p_arg_values=<your form id>' ||
    '&p_arg_names=_show_header&p_arg_values=YES' ||
    '&p_arg_names=rh_id&p_arg_values=' || LTRIM(TO_CHAR(n_rh_id)) ||
    '&p_arg_names=_rh_id_cond&p_arg_values=%3D';
    -- %3d means "="
    go (my_url);
    end;
    end;

  • Where clause at my Portal Form

    Hi,
    I would like to know how can i put a where clause at my Portal Form without using a view.
    Thanks,
    David Oliveira

    One way of it is call your form using link like e.g.
    ''||'ref1 Candidate '||''
    will display candidate form with entry ref1.
    Hope this help you.

  • Where Clause at Portal Forms

    Hi,
    I would like to know how can i put a where clause at my Portal Form without using a view.
    Thanks,
    David Oliveira

    At present there is no such provision. You have to create a view in database for this purpose.

  • Use value from tabular form column in the LOV where clause of another column

    Hi
    Using APEX 4.2 on 11g
    In a tabular form I want to filter the values in a Popup Key LOV based on the value of another column (same row).
    i.e. I want to get the value of one column and use it in the where clause for the Popup LOV on the same row.
    e.g. where COL 2 is a popup LOV
    COL 1
    COL 2
    1
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    2
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    3
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    The value in COL 1 does not change once the row is created. It is a hidden ID field.
    Is this possible?
    Nick

    Anyone have any ideas?
    I thought getting the value from one column and using it in another column would be commonly used functionality... I just can't seem to work it out.

  • How to write WHERE clause in dynamic record group in oracle forms

    hi this is s.v.eswar,PLZ HELP ME
    i am new to oracle forms
    i want to write where clause in dynamic recordgroup
    this is the code i have written
    DECLARE
         MGR_ITEM ITEM:=FIND_ITEM('MGR');
         RG_ID_MGR RECORDGROUP:=NULL;
         MGR_DUMMY NUMBER;
    BEGIN
         RG_ID_MGR:=FIND_GROUP('MGRNUMBER');
         IF ID_NULL(RG_ID_MGR) THEN
              RG_ID_MGR:=CREATE_GROUP_FROM_QUERY('MGRNUMBER','SELECT DISTINCT TO_CHAR(EMPNO),TO_CHAR(EMPNO) FROM EMP WHERE JOB='MANAGER''); --THIS IS THE LINE I AM GETTING ERROR
         END IF;
         IF NOT ID_NULL(RG_ID_MGR) THEN
              MGR_DUMMY:=POPULATE_GROUP('MGRNUMBER');
              IF MGR_DUMMY=0 THEN
                   POPULATE_LIST(MGR_ITEM,'MGRNUMBER');
              END IF;          
         END IF;     
    END;
    COMPILE TIME ERROR
    1)I have written where clause like this WHERE JOB='MANAGER'
    then oracle compiler has given error like
    ENCOUNTERED THE SYMBOL 'MANAGER' WHEN EXPECTING ONE OF THE FOLLOWING .,().........etc
    (FOR THE ABOVE ERROR I JUST REMOVED SINGLE CODES AND WRITE LIKE THIS ----->WHERE JOB=MANAHER)------>THEN COMPILED SUCESSFULLY)
    AND I RUN THE FORM
    RUN TIME ERROR
    FRM-41072: CAN NOT CREATE GROUP 'MGRNUMBER'

    Hi there
    pls have a look here
    Dependent drop down lists in forms 6i
    hope this helps...
    regards,
    Amatu Allah

  • Passing where clause with spaces from forms to reports

    Hi,
    Has anybody passed where clause as lexical parameter with spaces from forms to preports..
    I have seen people mention that, we can replace the spaces with special characters and then replace it again in the before trigger report..does anyone have a working example of that??
    Thanks.

    i solved the issue..
    i had written the procedure in the before report
    trigger instead of writing it in the before parameter
    form trigger..
    it works perfecto now..
    Thanks.We had removed the spaces and used commas to delimit each item.
    So you are saying spaces are not a problem in 10g?

  • Form on Table - Where is Where Clause?

    I am a newbie so sorry if this is a easy question.
    I created a form on a table. Each user will have one record on the table for them. When they access this page, I want the form to either allow them to create their record for the first time or update their record or delete it.
    Where do you put the WHERE clause that says something like
    record_userid = :APP_USER? I was able to do this on a Tabular Form but can't get it to work on the Regular Form.
    I suspect it has something to do with Conditional Processing and the Fetch Row processing but the documenation is not much help. I have tried different condition types and get either invalid or no results.
    Can anyone explain how to add this?

    No - this isn't the problem. The records already have a unique primary key (not userid). I just want to retrieve the record that a user worked on (one to a user) by the userid. We have another similar issue with a form that is one per department. Department is also not the primary key but each department can enter only one. Department is an alternate key, if you will.
    Besides, simply declaring the userid as the primary key does not seem to cause it to bring back that particular record? Unless I am not setting some property somewhere?
    While HTML DB has a selection for a second primary key, nowhere do I see a place to enter a comparison value (for first or second primary keys). I am thinking I will have to do some kind of master-detail combination where the record is master to itself so I can display them on the same screen and restrict it with a where clause.
    Unless someone has another idea. . .

  • Where Clause in the Forms doesn't work

    Hi,
    I am trying to execute a query in base table block. The block property 'Query allowed' is TRUE and WHere clause is null;
    I used 'SET_BLOCK_PROPERTY' and set the where clause. Did a GO_BLOCK and EXECUTE_QUERY;
    The block brings all records as if there is no where clause. TO make sure I put up a message 'GET_BLOCK_PROPERTY' to see the where clause. It showed correct where clause.
    null

    Setting the where clause the way you did usually works, and it worked fine for me several times.
    Yet, a couple of days ago I ran into something that defies my logic:
    1) when using the "=" operator, it fetched me several records that satisfied the condition
    2) when using the "<=" or ">=" operator it fetched only one of the records that satisfied the condition: the one that is strictly equal.
    I tried using the pre-query trigger, but to no avail.
    I'm looking forward for your succes.
    null

  • Can we use where clause in Update on Merge statement?

    Hi All,
    I tried to execute the following Merge Query:
    When this query is executed without ‘Where clause’ in Update statement its working fine. When executed with ‘Where clause’ it throwing the following error:
    ORA-00905: missing keyword.
    Following is the sample query which I tried to execute:
    MERGE INTO TABLE_NAME
    USING (SELECT COLUMN FORM TABLES)
    ON (CONDITION)
    WHEN MATCHED THEN
    UPDATE SET
         COLUMN UPATES
    WHERE CONDITION -- Can we use where clause here?
    WHEN NOT MATCHED THEN
    INSERT
    INSERT VALUES;
    Can some one help on this?
    Thanks in advance.
    Darius

    Yes:
    SQL> drop table emp1;
    Table dropped.
    SQL> create table emp1 as select * from emp where deptno = 30;
    Table created.
    SQL> update emp1 set sal = sal*2;
    6 rows updated.
    SQL> commit;
    Commit complete.
    SQL> select ename,sal from emp1;
    ENAME             SAL
    ALLEN            3200
    WARD             2500
    MARTIN           2500
    BLAKE            5700
    TURNER           3000
    JAMES            1900
    6 rows selected.
    SQL> MERGE INTO emp1
      2  USING(select * from emp) emp
      3  ON (emp1.empno = emp.empno)
      4  WHEN MATCHED THEN
      5  UPDATE SET sal = emp.sal WHERE ename = 'TURNER'
      6  WHEN NOT MATCHED THEN
      7  INSERT(ename,sal) VALUES(emp.ename,emp.sal);
    9 rows merged.
    SQL> select ename,sal from emp1;
    ENAME             SAL
    ALLEN            3200
    WARD             2500
    MARTIN           2500
    BLAKE            5700
    TURNER 1500
    JAMES            1900
    SMITH             800
    JONES            2975
    CLARK            2450
    SCOTT            3000
    KING             5000
    ENAME             SAL
    ADAMS            1100
    FORD             3000
    MILLER           1300
    14 rows selected.
    SQL> SY.

Maybe you are looking for