Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    34

    Red face Unanswered: problem in set block property

    hi all great dbforums members
    my problem is that
    select ename,deptno from emp where ename="smith" and deptno=10
    how to set the default_where for this
    i have use this set_block_property('emp',default_where,"smith" and 10 )
    but it not working
    plz help me thank you

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    It should be more like:

    Code:
    set_block_property('emp',default_where,'ename=''smith'' and deptno=10')

  3. #3
    Join Date
    Sep 2009
    Posts
    34
    thanks andrewst
    i use the query but the problem is not solve
    the complete query is
    declare
    a varchar2(100);
    b varchar2(100);
    begin
    a:="smith";
    b:="10";
    set_block_property('emp',default_where,'ename='||a || 'and deptno='||B);
    end;

    but it is not working
    plz help me

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    1) This:
    Code:
    a:="smith";
    won't work, it should use single quotes:
    Code:
    a:='smith';
    2) Your final WHERE clause becomes, once concatenations have been done:
    Code:
    ename=smith and deptno=10
    It should be:
    Code:
    ename='smith' and deptno=10
    Better would be to use a couple of items in a control block:
    Code:
    begin
    :control.name :='smith';
    :control.deptno := 10;
    set_block_property ('emp', default_where, 'ename=:control.ename and deptno=:control.deptno');
    end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •