Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2003
    Location
    Dhaka,Bangladesh
    Posts
    86

    Unanswered: Default Where Problem in Set_Block_Property

    Hello Experts,


    I m running a form with datablock 'DEPT' i used a find operation using-

    Set_Block_Property('DEPT','DEFAULT_WHERE','Deptno = 10');
    Which is valid.

    But my problem is finding with varchar type data

    Set_Block_Property('DEPT','DEFAULT_WHERE','Dname = SALES');
    Which is not working showing a error.

    please help me..

    mahfuz
    hello

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    But of course it won't compile ... what you're trying to say is
    SELECT * FROM dept
    WHERE dname = SALES;
    It WOULD compile if there was 'sales' column in the 'dept' table.

    What you really wanted was
    SELECT * FROM dept
    WHERE dname = 'SALES';

    Therefore, enclose your string into single quotes:
    Set_Block_Property('DEPT', DEFAULT_WHERE, 'dname = ''SALES''');
    As you can see, you'll need two single quotes (not double quotes!) in front and three singles after SALES.
    Also, omit single quotes around block's property.

  3. #3
    Join Date
    Nov 2003
    Location
    Dhaka,Bangladesh
    Posts
    86

    Thnak You

    Littlefoot

    I m greatfull to you. Many many Thnaks.

    mahfuz
    hello

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I'm glad it helped

  5. #5
    Join Date
    Nov 2003
    Location
    Dhaka,Bangladesh
    Posts
    86

    Thanks but now i want more plz help Littlefoot

    Hello Littlefoot...

    I want little more help. ya i did as u helped me ..now
    i wanna a make a find from user input text filed ..named "Text_Dname"
    at DEPT Block

    i declare a text box

    my code is in Find button--

    Declare

    v_dname varchar2(10);

    Begin

    v_dname := : DEPT.Text_Dname

    Set_Block_Property('DEPT',DEFAULT_WHERE,"??????");

    /* My question is here how can i concatt this Questin part to use v_dname variable */

    End;


    Plz help me gaian..I m already Greatfull to You...
    Last edited by Mahfuz; 09-05-04 at 14:13.
    hello

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    You don't need such a pl/sql block ... it would be enough to have this statement:

    set_block_property('dept', default_where, 'DNAME = :dept.text_dname');

  7. #7
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Just because you make a block item, doesn't mean that it can be used in the where. Just like any select, the columns specified in the where MJST be columns in the table or view being referenced.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If I may add to this, Bill, the columns specified on the LEFT SIDE of the "=" sign in WHERE clause must be columns in the table or view

  9. #9
    Join Date
    Apr 2004
    Posts
    246
    oracle doesn't care about the side of the equal sign - never has
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  10. #10
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    True ... I apologize, it was my state-of-mind. I'm just used to write (and think) as "where dname = 'SALES'" rather than "where 'SALES' = dname".
    Last edited by Littlefoot; 09-08-04 at 03:50.

  11. #11
    Join Date
    Nov 2015
    Posts
    1

    Two inputes

    Hello Experts,


    I m trying a form with
    SET_BLOCK_PROPERTY ('emp', DEFAULT_WHERE, 'job = :control.tjob' and 'DEPTNO = ' ||:control.tdep);


    please help me..

    RASHID
    Last edited by rashid_minhas; 11-17-15 at 02:50.

  12. #12
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    The same problem on OraFAQ.

  13. #13
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    It should be

    SET_BLOCK_PROPERTY ('emp', DEFAULT_WHERE, 'job = :control.tjob and DEPTNO = :control.tdep');

    The colon before the block name tells forms that it is a block object.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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