the analysis of a field in the CFQUERY WHERE clause

I have a fairly large database that I need to execute queries.  I have a field that represents where store items are stored by aisle, section and bin. This field is concatenated with delimiters to underscore: aisle_section_bin.  An example of location can be 3_25_17.

I need to execute queries where I analyze this location concatenated field and essentially ask:

SELECT *.

OF MyData

Driveway WHERE = '3', section ' 25 "AND bin = '1'

Could someone help me please with home, what would that be?

My database is quite large, so I need my queries to be efficient enough so my server has no time-out.

Thank you

couldn't you just concatenate the values together as a string of CF and pass in your where clause:

WHERE aisle_section_bin =

Tags: ColdFusion

Similar Questions

  • NVL selection list does not not on the place where clause in query

    Ok. APEX 4.2...

    Im having problems with my selection lists and NULL values... I see that it has come time and time again...

    I have a tabular presentation, with a query based on a selection list.  The selection list has the ability to '- Show All -'... The value of the selection list is a number, and the display is words...  (for reference the LOV query is: select status, batch from pmt_stat_lookup by 1)

    Initially I had problems with null and invalid numbers like ' display Null = 'Yes' and the problem of null % ', so have used the code in this blog to remove the NULL values... Display Null = & amp; #34; Yes & amp; #34; and the problem of null % | Inside Oracle APEX by Patrick Wolf

    Then in the application of my report, I have a where clause clause that checks the value of the selection list... WHERE batch = nvl(:P11_STATUS_SELECT,STATUS_ID)

    everything works almost fine, and I can choose a status, or I choose - see the All-, but the query will not include the lines where the State is null.

    (I also see that maybe I should be, use the case statement instead of the NVL on where clause, but not sure of the syntax. In addition, NVL was used somewhat in the different reports in the application...)

    For reference, the code of the old blog that I as a process page is:

    BEGIN

    FOR rItem IN

    (SELECT NOM_ELEMENT

    OF APEX_APPLICATION_PAGE_ITEMS

    WHERE APPLICATION_ID = TO_NUMBER(:APP_ID)

    AND PAGE_ID IN (TO_NUMBER(:APP_PAGE_ID), 0)

    AND LOV_DISPLAY_NULL = 'Yes'

    AND LOV_DEFINITION IS NOT NULL

    -change here

    AND LOV_NULL_VALUE = '% null | '%'

    )

    LOOP

    IF V (rItem.ITEM_NAME) = "% null | '%'

    THEN

    Apex_Util.set_session_state (rItem.ITEM_NAME, NULL);

    END IF;

    END LOOP;

    END;

    Thank you very much

    Richard

    Richard,

    Perhaps this example can help you solve your problem.

    https://Apex.Oracle.com/pls/Apex/f?p=63838:2

    Jeff

  • Programmatic setting of the place where clause does not.

    Hello

    I use Jdeveloper 11.1.2.2.

    I'm trying to interview some lines of the VO by placing the VO in the programmatic way as it appears in this documentation: http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcquerying.htm#CHDEBEAF

    But it returns no rows. While I was trying to interview through the SQL command line he questions the lines.

    Are there conditions that only bind the variables declared in the VO can be queried in the programmatic way? I tried also. It is not always all the lines.

    Thank you

    Nigel.

    I meant turn on diagnostics.

    http://jdeveloperfaq.blogspot.com/2009/12/FAQ-6-How-to-fine-tune-ADF-Diagnostics.html

    Published by: in the line of fire on July 25, 2012 11:54

  • Where clause in the "default_where" of get_block_property is not cancelled...

    Hello

    I developed a form with two blocks.

    The first - block of non - database contains the criteria.

    Database of the other - block-displays the records according to the inserted.

    Also, there is a button that executes the query criteria.

    The code of the BUTTON WHEN PRESSED is as follows:

    declare

    v_where varchar2 (3000);

    Start

    v_where: = null;

    go_block ('EKKREMOTHTES_AIT_TSG');

    clear_block (no_validate);

    v_where: = get_block_property ('EKKREMOTHTES_AIT_TSG', default_where);

    If: blk_criteria.site_id is not null then

    v_where: = v_where |' and site_id = "'|: blk_criteria.site_id | ''';

    end if;

    If: blk_criteria.yphr_klimakio is not null then

    v_where: = v_where |' and yphr_klimakio = "'|: blk_criteria.yphr_klimakio | ''';

    end if;

    If: blk_criteria.send_date_from is not null and: blk_criteria.send_date_to is not null then

    v_where: = v_where |' and send_date between to_date('''|| to_char(:blk_criteria.send_date_from,'dd/mm/yyyy')||''',''dd/mm/yyyy'') and

    to_date('''|| to_char(:blk_criteria.send_date_to,'dd/mm/yyyy') | " (', "dd/mm/yyyy)";

    end if;

    If: blk_criteria.eq_group1 is not null then

    v_where: = v_where |' and eq_group1 = "' | : blk_criteria.eq_group1 | " ' ;

    end if;

    If: blk_criteria.eq_type1 is not null then

    v_where: = v_where |' and eq_type1 = "' | : blk_criteria.eq_type1 | " ' ;

    end if;

    If: blk_criteria.eq_group2 is not null then

    v_where: = v_where |' and eq_group2 = "' | : blk_criteria.eq_group2 | " ' ;

    end if;

    If: blk_criteria.eq_type2 is not null then

    v_where: = v_where |' and eq_type2 = "' | : blk_criteria.eq_type2 | " ' ;

    end if;

    blk_def_where ('EKKREMOTHTES_AIT_TSG', v_where);                                    / * a form routine that makes the set_block_property(<block>,default_where) * /.

    do_key ('execute_query');

    end;

    The above code works when the user inserts the criteria for the first time. Later when the user deletes certain criteria - clear criteria in the block of criteria-

    and he pushed the button of the query results are exactly the same...

    After have debugged the problem, clause v_where is not nullied (do not get the value zero) in order to get the new criteria.

    Can you identify the error?

    Note: I use Oracle Forms 10 g Db 11 g v.2

    Thank you very much

    SIM

    SIM,

    The procedure "blk_def_where" sets the block where clause by using the DEFAULT_WHERE or the ONETIME_WHERE constanct?  Gets it to the user that the same results as the DEFAULT_WHERE sets the property WHERE permanently so the second time through, the 'v_where' is NOT null.  Check your BLK_DEF_WHERE procedure and if it does not use the ONETIME_WHERE constanct, change isn't.  The alternative would be to put DEFAULT_WHERE = NULL after the call to the built-in EXECUTE_QUERY.

    Craig...

  • DECODE inside the WHERE clause

    Hi all:

    I can't get the DECODE statement to work inside my WHERE clause. I have read the information on
    Tahiti.Oracle.com
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/functions049.htm#i1017437

    But still can not get it to work. Initially, I had he works as dynamic SQL and then run that string, but I am not allowed to use dynamic SQL statements and to do 'Real' PL/SQL.

    I have the following WHERE clause (more info after the WHERE clause)
    WHERE 
         a.ebiz_asn_no(+) = te.ebiz_cntrl_no
         AND w.ebiz_work_no(+) = te.ebiz_cntrl_no
         AND o.ebiz_ord_no(+) = ebiz_cntrl_no
         AND t.ebiz_trailer_no(+) = te.ebiz_trailer_no
         AND ms.ebiz_sku_no(+) = te.ebiz_sku_no 
         AND NVL(ms.ebiz_sku_no, -1) = NVL(p_SKU, nvl(ms.ebiz_sku_no, -1))
         AND tl.ebiz_lp_no(+) = te.ebiz_lp_no 
         AND NVL(te.ebiz_lp_no, -1) = NVL(p_LP, nvl(te.ebiz_lp_no, -1))
         AND eu.ebiz_user_no(+) = te.act_ebiz_user_no 
         AND NVL(te.act_ebiz_user_no, -1) = NVL(p_UserID, NVL(te.act_ebiz_user_no, -1))
         AND NVL(te.begin_location, '~') = NVL(p_BeginLocation, NVL(te.begin_location, '~')) 
         AND NVL(te.end_location, '~') = NVL(p_EndLocation, NVL(te.end_location, '~')) 
         AND te.comp_id = p_CompID 
         AND te.site_id = p_SiteID 
         AND INSTR('' || p_TaskType || '', te.task_type) > 0 
         AND NVL(task_priority, -1) = NVL(p_Priority, NVL(task_priority, -1)) 
         AND NVL(te.ebiz_cntrl_no, -1) = DECODE(te.task_type, 'IULD', DECODE(p_Order, null, te.ebiz_cntrl_no, ebiz_po2asn.get_ebiz_po_no(p_Order)), NVL(p_Order, NVL
                           (te.ebiz_cntrl_no,-1)))
         AND NVL(te.batch_no,'~') = NVL(p_Batch, NVL(te.batch_no, '~'))
         AND NVL(te.ebiz_wave_no, -1) = NVL(p_Wave, NVL(te.ebiz_wave_no, -1)) 
         || whereClauseStatus 
         || whereClauseFromDate 
         || whereClauseToDate;
    As you can see, initially I was adding values of "whereClauseStatus, whereClauseFromDate, whereClauseToDate" and it has been defined with the following PL/SQL code:
         IF(p_TaskStatus = 'C') THEN
              -------------------------------------------------------------------------------------------
              --     Set From Date Clause
              -------------------------------------------------------------------------------------------
              IF(p_FromShipDate IS NOT NULL) THEN
                   whereClauseFromDate := ' AND TRUNC(te.act_end_date) >= TO_DATE(''' || p_FromShipDate || ''',''MM/dd/yyyy'') ';
              END IF;
              -------------------------------------------------------------------------------------------
              --     Set To Date Clause
              -------------------------------------------------------------------------------------------
              IF (p_ToShipDate IS NOT NULL) THEN
                   whereClauseToDate := ' AND TRUNC(te.act_end_date) <= TO_DATE(''' || p_ToShipDate || ''',''MM/dd/yyyy'') ';
              END IF;
         ELSE
              -------------------------------------------------------------------------------------------
              --     Incomplete and All statuses are filtered on the currdate
              -------------------------------------------------------------------------------------------
              -------------------------------------------------------------------------------------------
              --     Set From Date Clause
              -------------------------------------------------------------------------------------------
              IF(p_FromShipDate IS NOT NULL) THEN
                   whereClauseFromDate := ' AND TRUNC(te.currdate) >= TO_DATE(''' || p_FromShipDate || ''',''MM/dd/yyyy'') ';
              END IF;
              -------------------------------------------------------------------------------------------
              --     Set To Date Clause
              -------------------------------------------------------------------------------------------
              IF (p_ToShipDate IS NOT NULL) THEN
                   whereClauseToDate := ' AND TRUNC(te.currdate) <= TO_DATE(''' || p_ToShipDate || ''',''MM/dd/yyyy'') ';
              END IF;
         END IF;
         
    
         IF (p_TaskStatus = 'I') THEN
              whereClauseStatus := ' AND act_end_date IS NULL ';
         ELSIF (p_TaskStatus = 'C') THEN
              whereClauseStatus := ' AND act_end_date IS NOT NULL ';
         ELSE
              whereClauseStatus := '';
         END IF;
    I have serious problems getting the DECODE statement to replace the three variables in the annex.

    Any help would be greatly appreciated.

    Thank you
    Andy

    Published by: BluShadow on August 2, 2011 15:11
    addition of {noformat}
    {noformat} tags for clarity. Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    I'll take a wild shot in the dark, and suggests that it is perhaps what you are looking for...

    WHERE
         a.ebiz_asn_no(+) = te.ebiz_cntrl_no
         AND w.ebiz_work_no(+) = te.ebiz_cntrl_no
         AND o.ebiz_ord_no(+) = ebiz_cntrl_no
         AND t.ebiz_trailer_no(+) = te.ebiz_trailer_no
         AND ms.ebiz_sku_no(+) = te.ebiz_sku_no
         AND NVL(ms.ebiz_sku_no, -1) = NVL(p_SKU, nvl(ms.ebiz_sku_no, -1))
         AND tl.ebiz_lp_no(+) = te.ebiz_lp_no
         AND NVL(te.ebiz_lp_no, -1) = NVL(p_LP, nvl(te.ebiz_lp_no, -1))
         AND eu.ebiz_user_no(+) = te.act_ebiz_user_no
         AND NVL(te.act_ebiz_user_no, -1) = NVL(p_UserID, NVL(te.act_ebiz_user_no, -1))
         AND NVL(te.begin_location, '~') = NVL(p_BeginLocation, NVL(te.begin_location, '~'))
         AND NVL(te.end_location, '~') = NVL(p_EndLocation, NVL(te.end_location, '~'))
         AND te.comp_id = p_CompID
         AND te.site_id = p_SiteID
         AND INSTR('' || p_TaskType || '', te.task_type) > 0
         AND NVL(task_priority, -1) = NVL(p_Priority, NVL(task_priority, -1))
         AND NVL(te.ebiz_cntrl_no, -1) = DECODE(te.task_type, 'IULD', DECODE(p_Order, null, te.ebiz_cntrl_no, ebiz_po2asn.get_ebiz_po_no(p_Order)), NVL(p_Order, NVL
                           (te.ebiz_cntrl_no,-1)))
         AND NVL(te.batch_no,'~') = NVL(p_Batch, NVL(te.batch_no, '~'))
         AND NVL(te.ebiz_wave_no, -1) = NVL(p_Wave, NVL(te.ebiz_wave_no, -1))
         AND TRUNC(te.act_end_date) >= NVL(TO_DATE(p_FromShipDate,'MM/dd/yyyy'),TRUNC(te.act_end_date))
            AND TRUNC(te.act_end_date) <= NVL(TO_DATE(p_ToShipDate,'MM/dd/yyyy'),TRUNC(tw.act_end_date))
            AND TRUNC(te.currdate) >= NVL(TO_DATE(p_FromShipDate,'MM/dd/yyyy'),TRUNC(te.currdate))
         AND TRUNC(te.currdate) <= NVL(TO_DATE(p_ToShipDate,'MM/dd/yyyy'),TRUNC(te.currdate))
            AND (  (act_end_date IS NULL AND p_TaskStatus = 'I')
                OR (act_end_date IS NOT NULL AND p_TaskStatus = 'C')
                OR p_TaskStatus NOT IN ('I','C')
                )
    

    Published by: BluShadow on August 2, 2011 16:27
    spleen the last clause. Oops.

  • How to define a WHERE clause of the subquery in a bean managed?

    Hi people,

    is it possible to define the place where clause of a subquery in a bean managed?
    For example, it is more SQL charly:

    SELECT * FROM
    (SELECT Person.Name
    OF the person)

    To change or add a WHERE clause, I use following code for the 'viewObject: view

    String whereClause = "ROWNUM < =: numberOfRows;
    viewObject.setWhereClause (whereClause);

    viewObject.defineNamedWhereClauseParam ("numberOfRows", null, null);
    viewObject.setNamedWhereClauseParam ("numberOfRows", new Number (100));

    AttributeList myattr = this.getNamedWhereClauseParams ();
    viewObject.setNamedWhereClauseParams (myattr);

    For example, this code works well for the first SELECT statement limit the output to the first 100 results. But how do I add a WHERE clause of the subquery in a managed bean? For example, when I want to limit the names of people that begin with the letter "A"?
    The query should look like this:

    SELECT * FROM
    (SELECT Person.Name
    OF the person
    WHERE Person.Name LIKE 'A %')

    Anyone know more?

    Thank you!

    Put a variable binding in your query, something like:

    where (: bv is null) or (xxx love: bv)

    John

  • loop over a list with &amp; quot; Insert &amp; quot; in the cfquery tag valid?

    looping over a list with 'insert' in the cfquery tag valid? He
    throws any errors and inserted into the table without any
    problems, but just wonder if it is possible to use since when I tried
    Select article twice in a cfquery, it executes only the first.

    < cfquery >
    Select the test in testdata

    Select othertest from differentdata
    < / cfquery >

    If it works, it is valid. Different from the db support different syntaxes on this issue. A way that would work for all db's

    insert into sometable
    (fields)

    Select somevalues
    from somewhere

    Union
    closing tags.

  • How many fields we can add to the inside on the partition by clause?

    Hello world

    My version of DB is

    BANNER                                                         
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi 
    PL/SQL Release 10.2.0.1.0 - Production                           
    CORE 10.2.0.1.0 Production                                         
    TNS for Linux: Version 10.2.0.1.0 - Production                   
    NLSRTL Version 10.2.0.1.0 - Production                           
    

    How many fields we can add to the inside on the partition by clause? I have added two and tried it works. So how can we add?

    Please, share your ideas.

    Kind regards

    BS2012.

    What is the purpose of this question? You can add as many as you have in the table.

    ----

    Ramin Hashimzade

  • Dialogue boxes not hide all fields, not just those where the value is passed to true

    I hope someone can help me do what I want to happen, to occur if certain boxes are checked in the dialog box

    for now I see on the impression that the checkbox activates the value from false to true, but the OK button is also non-masquage console all my fields, not just those where he transformed the true value. What I'm missing here

    Create a dialog box for the staff to indicate how many of the account owners are in the branch so that the names of show in the signature section
    var Signors =
    {

    result: "Cancel."
    DoDialog: function() {return app.execDialog (this);};
    bChk2:false,
    bChk3:false,
    bChk4:false,
    bChk5:false,
    initialize: function (dialog)
    {
    var dlgInit =
    {
    "Chk2": this.bChk2.
    'Chk3': this.bChk3,
    'Chk4': this.bChk4,
    };
    Dialog.Load (dlgInit);
    },
    commit: function (dialog)
    {
    var oRslt = dialog.store ();
    this.bChk2 = oRslt ["Chk2"];
    this.bChk3 = oRslt ["Chk3"];
    this.bChk4 = oRslt ["Chk4"];
    },
    Description:
    {
    name: "Signors."
    elements:
    [
    {
    type: "display."
    elements:
    [
    {
    type: "display."
    char_height: 10,.
    elements:
    [
    {
    type: 'static_text. "
    item_id: "stat."
    name: "who is there to sign,:
    char_width: 15,.
    alignment: "align_fill",.
    Police: 'dialogue ',.
    },
    {
    type: "display."
    char_width: 8.
    char_height: 8.
    align_children: "align_top."
    elements:
    [
    {
    type: "display."
    char_width: 8.
    char_height: 8.
    elements:
    [
    {
    type: 'check_box. "
    item_id: "Chk2."
    name: "first to file."
    },
    {
    type: 'check_box. "
    item_id: "Chk3."
    name: "Team 1"
    },
    {
    type: 'check_box. "
    item_id: "Chk4."
    name: 'team 2 ',.
    },
    ]
    },

    ]
    },
    ]
    },
    {
    type: "ok_cancel."
    },
    ]
    },
    ]
    }
    };

    made the change of value when checked - allows you to check
    Signors.bChk2 = false;
    Signors.bChk3 = false;
    Signors.bChk4 = false;
    If ("ok" == Signors.DoDialog ())
    {
    If (Signors.bChk2 = true)
    getField("Signor1").hidden = false;
    getField("Staff1").hidden = false;
    getField("Date1").hidden = false;
    getField("Date2").hidden = false;

    If (Signors.bChk3 = true)
    getField("Signor2").hidden = false;
    getField("Staff2").hidden = false;
    getField("Date3").hidden = false;
    getField("Date4").hidden = false;

    If (Signors.bChk4 = true)
    getField("Signor3").hidden = false;
    getField("Staff3").hidden = false;
    getField("Date5").hidden = false;
    getField("Date6").hidden = false;

    Console.println ("Chk2:" + Signors.bChk2);
    Console.println ("Chk3:" + Signors.bChk3);
    Console.println ("Chk4:" + Signors.bChk4);
    Console.println ("Chk5:" + Signors.bChk5);
    console.println if shows bChk... is true or false
    }
    Console.println ("Chk2:" + Signors.bChk2);
    Console.println ("Chk3:" + Signors.bChk3);
    Console.println ("Chk4:" + Signors.bChk4);
    Console.println ("Chk5:" + Signors.bChk5);
    }

    Yes, confirmed values have changed, now show fields based on staff

    principal applicant has been selected


    doWhatIWant: {function (results)}
    If (results [Signors.bChk2] = true)
    getField("Signor1").hidden = false;
    getField("Staff1").hidden = false;
    getField("Date1").hidden = false;
    getField("Date2").hidden = false;

    1 associate has been checked
    If (results [Signors.bChk3] = true)
    getField("Signor2").hidden = false;
    getField("Staff2").hidden = false;
    getField("Date3").hidden = false;
    getField("Date4").hidden = false;

    Associate 2 has been selected
    If (Signors.bChk4 = true)
    getField("Signor3").hidden = false;

    If (Signors.bChk4 = true)
    . Hidden ("surete3") = false;

    If (Signors.bChk4 = true)
    . Hidden ('date.5") = false;

    If (Signors.bChk4 = true)
    . Hidden ('Date6") = false;

    I had to just add a hug to bChk3 database and it worked perfectly. Thank you very much!

  • Validation of attribute of the CFQUERY tag error

    I have a CF app that works well on a shared hosting. I have now a VPS running the version of CF 9. When I try to use it on the VPS, I get the following error:

    Validation of attribute of the CFQUERY tag error.

    The value of the datasource attribute, which is currently ", is not valid.

    The data source is defined in application.cfc and again works very well in the shared environment.

    The only differences is the shared is running on Windows, and the VPS is Linux. In addition, Windows running the 9,0,1,274733 version and Linux is 9,0,0,251028

    Any help would be greatly appreciated.

    If the file in question is really called "application.cfc" then that's your problem.  This is supposed to be 'Application.cfc '.

    --

    Adam

  • How to recover the CFQuery which was passed to DB

    Hello

    I wrote a complex query to retrieve data from the database using the form variables. Now, for purposes of debugging, I wanted to display the generation of SQL on the CFM itself queries, form for developers only.
    You can help me pls. I had used the 'result' for the CFquery tag. But no luck. Need your help.

    Thank you
    CHMS



    Select * from table where column = #varibale#

    Simply insert the select together within the cfoutput tag, remove is using it. This will display the select statement with the CFM template variable crossing

  • "Invalid column" on the place where several clauses with subqueries and cfqueryparam

    I see a behavior in the cfquery coldfusion I would like to find an exmplanation for.  I have a query that performs a subquery in the select part and if I have several where lines, I get a message 'invalid column name' to find out where my second article, but only when I'm with cfqueryparam

    For example, on what follows, I get "invalid column name «position_id»»

    SELECT department_staff_tbl.*,
    (SELECT max (bookmark_id)
    OF bookmarked_items_tbl
    WHERE item_id = department_staff_tbl.staff_id

    ) AS bookmark_id
    OF department_staff_tbl
    WHERE department_id = < cfqueryparam value = "" #arguments.deptid # "cfsqltype ="cf_sql_integer">"
    AND position_id = < cfqueryparam value = "" #arguments.posid # "cfsqltype ="cf_sql_integer">"
    AND staff_id = < cfqueryparam value = "" #arguments.staffid # "cfsqltype ="cf_sql_integer">"

    If I change the order of my where clause staff_id is first, and then he said "department_id" is an invalid column.

    If I don't have a where clause, it works.  (i.e. WHERE position_id = < cfqueryparam value = "" #arguments.posid # "cfsqltype =" cf_sql_integer">).

    If I remove the where clause of my subquery (WHERE item_id = department_staff_tbl.staff_id) it works.

    This also works if I remove the cfqueryparam where my article so that my query looks like this:

    SELECT department_staff_tbl.*,
    (SELECT max (bookmark_id)
    OF bookmarked_items_tbl
    WHERE item_id = department_staff_tbl.staff_id

    ) AS bookmark_id
    OF department_staff_tbl
    WHERE department_id = #arguments.deptid #.
    AND position_id = #arguments.posid #.
    AND staff_id = #arguments.staffid #.

    Any thoughts?

    A more conventional way to enter your data is without the subquery.  Something like that

    Select fields, the bookmarkid max (bookmark_id)

    from bookmarked_items__tbl join department_staff_tbl on staff_id = bookmark_id

    When etc.

    Some field group

  • How to remove the Order By clause

    How can I get rid of the Order By clause in the underlying SQL query? I created a simple hierarchy, but when I use the hierarchy in the analysis and then come down, the results show multiple occurrences of each child. For some reason, I was able to reduce the number of occurrences of each child by adding a saved filter.

    I was expecting this:

    Expected.jpg

    Instead, I got this:

    Actual.jpg

    The generated physical query looks like this:

    SET VARIABLE QUERY_SRC_CD = "report"; SELECT s_0, s_1, s_2, s_3, s_4 s_5, (FROM s_6)

    SELECT

    s_0 0,.

    CAST (NULL AS VARCHAR s_1 (1)).

    "Registration - College". «Dimensions of the inscription '.» "' Exercise ' s_2,.

    'All the colleges' s_3,.

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_4 all Colleges").

    MOUNT s_5 (NULL AS DOUBLE),

    "Registration - College". "" Counties of schooling. "" Full-time student "s_6

    "REGISTRATION - College".

    UNION ALL

    SELECT

    1 s_0

    "Registration - College". «Dimensions of the inscription '.» "" Name of College "s_1,.

    "Registration - College". «Dimensions of the inscription '.» "' Exercise ' s_2,.

    'All the colleges' s_3,.

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_4 all Colleges").

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_5 College ').

    "Registration - College". "" Counties of schooling. "" Full-time student "s_6

    "REGISTRATION - College".

    WHERE

    ("Registration - College". «Dimensions of the inscription '.» ("' Exercise ' IN ('201213')) AND (IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". (("' Colleges ') (1))

    ) djm ORDER OF 1, 3 ASC NULLS LAST, 4 ASC NULLS FIRST, 5 ASC NULLS FIRST, 2 ASC NULLS FIRST, NULLS FIRST CSA 6

    EXTRACT FIRST 10000000 LINES ONLY

    HI mbengue,.

    Check the report you are running any column presentation sorted in the user interface (in which case the order by clause will creep into generated sqls Physics). Also, I think that its worth it to check the settings of the hierarchy you have configured and if the installation program for the calculation of the measured column (number of students in this case), has been done correctly.

    Kind regards

    Arko

  • Implementation of subqueries in the WHERE clause

    Hi all

    First of all, here are the technical info:

    Oracle JDeveloper 12 c 12.1.3.0.0

    Studio Edition Version 12.1.3.0.0

    Build JDEVADF_12.1.3.0.0_GENERIC_140521.1008.S

    Version of the component

    ========= =======

    Oracle IDE 12.1.3.0.41.140521.1008

    Java (TM) Platform 1.7.0_51

    Support versioning 12.1.3.0.41.140521.1008

    Secondly, the issue I'm facing is I'm trying to implement a query with three sous-sélections them in the (see image below) WHERE clause. I don't know what is the best way to implement something like this.

    I have implemented this by creating a display object and add a view criteria. I put the whole SQL fragment in the view as a literal value criteria. Is there a better (or best?) approach to implement something like this?

    This implementation is a problem is because as well as query tests out fine when I click on explain Plan even recognized that there is no bind variables in subqueries and allows me to.

    When I run this test by the tester of AM, that it fails to recognize and define the binding (projCategory) variable that appears only in subqueries. All your comments and/or help is very appreciated.

    Query.JPG

    Thank you

    Vladimir

    Vladimir, there is something wrong in the view Definition of criteria dialog box. The button "explain plan...". "running the whole statement generated (as a string) and returns the result. The entire statement is valid and returns the correct result. However, the view criteria, when it is running in the application work differently. Here the literal that you entered is not passed as a string, but the framework does something internally with her (it is necessary to do things as in the research of memory and other things). If you run the criteria to view in the app Tester I get

    SQL error in the preparation of the statement.  Instruction: SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER, Employees.HIRE_DATE, Employees.JOB_ID, Employees.SALARY, Employees.COMMISSION_PCT, Employees.MANAGER_ID, Employees.DEPARTMENT_ID from employees WHERE (((Employees.SALARY< :vc_temp_1="" )="" )="" )="" ):="" ora-01722:="" invalid="">

    Accordingly, for the display criteria

    employes.salaire< (select="" max(e2.salary)="" from="" employees="" e2="" where="" e2.department_id="">

    As you can see the literal is passed as: vc_temp_1 and my binding variable is not visible at all. You can open an SR and ask for the support of working on it. I guess that they do not see a bug here as help for the dialog box says:

    Literal

    Select when you want to provide a value for the attribute, or when you want to set a default value for a lookup field specified by the user for a search query-by-example form.

    When the criteria of view defines a search query for the user interface form, you can leave the field blank. In this case, the user will provide the value. Alternatively, you can provide a value that will act as a default value to the field search that the user will be able to substitute. This entry can include wildcards * or %.

    When the attribute is of type Date, specify the value of the date in the format YYYY-MM-DD; for example, to December 16, 2010, enter 2010-12-16.

    Here, it tells you that a value is expected. Your sub query is not interpreted, but is simply converted to the appropriate data type. In my example, I get an invalid number as expected.

    So I guess my suggestion to use a custom sql statement stands.

    Timo

  • [JDev ADF] How is made the ' where clause ' default display criteria "all searchable attributes?

    Hallo,


    on a view object, I create my view of the criteria customized; I'm going to use it to create a "query with the table panel.

    I wish that his beahviour, when I use it to create a "query with the table panel", corresponds to that of "attributes searchable all.

    Unfortunately I'm having some trouble in his creation and I would like to see how is made the "object view where Clause" CV "all searchable attributes.

    My VO motion is:

    Select the username, name, RegisteringDate

    I would like to create my VC in a way that is the result "query with table Panel:

    UserId | ___ |

    Name | ___ |

    RegisteringDate of | ___ | to |_________|

    For each search field, I set a variable binding (PName, PUserId, PRegisteringDateTo, PRegisteringDateFrom).

    Each field must be used in the "query with table Panel" only if it is filled with a value.

    You kindly help me?

    Thank you very much

    F.

    The criteria to view all searchable attributes is implied all the attributes of a vo. Each attribute is used unless you specify a value for it. The problem with this IS, is that you can not change it.

    However, you can build your own RESUME that works in the same way, but allows you to change certain attributes. To do this, you create a new business card and add each attribute, select the operation you want to test the attribute against (equals, start by,...). You do not bind variables for attributes specify. The framework will add them for you automatically.

    The only thing that can not this vc is check varies as you want to do when you check "RegisteringDate." To do this you must use bind variables.

    Once you have create this EGG and it makes you drag onto the page you can use it as the "all attributes searchable.

    Timo

Maybe you are looking for

  • helping you choose an imac of 2015

    Hi all I looking for a new or slightly used imac 27 "and trying to do a good price by value of choice. My main uses are Photoshop, video editing, and AE. NOT a gamer. I need this machine to last at least 5-6 years to justify the expense. My options:

  • Ntoskrnl.exe causing blue screen saying "DRIVER_POWER_STATE_FAILURE" in Windows Vista

    At random intervals (and I mean, it may happen by week or 1This 2This every 2 months) I get a blue screen.  I said "DRIVER_POWER_STATE_FAILURE" and made a dump.  It doesn't happen ever if I'm doing something important, like writing a paper for school

  • Palm Z22 and GPS?

    My son just got this Palm Z22 for me for Christmas! I've never owned a Palm before, so I'm a "Newbie Uber" . I tried to search positions, but so many returns and not quite good questions. I want to know if this Z22 has the ability to organize the win

  • Copies are generating losses?

    Adobe Photoshop is the most advanced software in the world, therefore.I have in mind that has it, the loss of quality is low, for example:Open a photo (original) < save < close.Re-open the same image (copy) < re-record < close.Repeat the foregoing sa

  • image in a decorative box

    HelloI have a page template, containing panelStretchLayout with facets top and CenterTop of page height property panelStretchLayout is set to 50pxInside of the superior facet of PanelStretchLayout, I have a decorative box with only the Center facets