3 Replies Latest reply: Apr 11, 2013 8:36 AM by CraigB RSS

    QUERY_DATA_SOURCE_NAME

    884176
      Hi Everyone. I have to change the data source name of a block at runtime, ive placed this code in one of the button on when_button_pressed trigger.

      sql_string:= '(select a.cust_id
      , a.booking_date
      , a.claiming_code
      , a.appointment_id
      , b.first_name
      , b.middle_name
      , b.last_name
      , c.first_name||' '||c.last_name booking_agent
      , d.off_short_desc ffi_office
      , e.description appointment_outcome
      , f.off_short_desc appointment_where
      from tbl_appointment a
      , customer_external_data b
      , agent c
      , tbl_ffi_office d
      , tbl_appointment_outcome_ref e
      , tbl_ffi_office f
      where a.cust_id = b.cust_id
      and a.booking_agent = c.agent_id
      and a.ffi_office = d.off_id
      and a.appointment_outcome = e.appointment_outcome_id
      and a.appointment_where = f.off_id
      and a.appointment_outcome = 10)';

      set_block_property('tele_appointments',QUERY_DATA_SOURCE_NAME,sql_string);
      go_block('tele_appointments');
      clear_block;
      execute_query;

      But i'm getting this error.. please help me experts.. Thanks in advance.

      FRM-40505:Oracle error: Unable to perform query.
        • 1. Re: QUERY_DATA_SOURCE_NAME
          O.Developer
          Hi

          Do you have specific reason to use this query source -I strongly suggest to redesign your form style such way that you can use view instead of query.


          However please refer below link :
          http://www.orafaq.com/forum/t/31910/2/
          • 2. Re: QUERY_DATA_SOURCE_NAME
            François Degrelle
            Hello,

            Check out your block columns match in name/type those of the dynamic select.

            Francois
            • 3. Re: QUERY_DATA_SOURCE_NAME
              CraigB
              This error is commonly caused when you have items in your block that don't match the list of columns in your query. Either make these items "non-database" items or move them to a Control Block. If all of the items in your block match your query columns, then check the Block property Query Data Source Columns and make sure the columns in this property are correct and their data types.

              It sounds like you are basing your block on a From Clause Query. If this is true, I recommend you look at the following: Oracle Forms From Clause Query

              Hope this helps,
              Craig...