How to validate a Query without executing it?

How to validate a Query without executing it?
For example if I have:
ReadAllQuery myQuery = new ReadAllQuery(myClass);
myQuery.setSelectionCriteria(myExpression);
What can I do to have must validation as possible been done before executing the query?
Validation that could be done are:
- Expression reference fields that really exist in TopLink mapping
- Literal provided to expression are of compatible type
- Parameter setting set against the query are all compatible

Your could prepare the query.
query.prepareCall(session, record);
This will do all query validation and generate the SQL for the query.

Similar Messages

  • CPU Cost of a Query without executing it?

    Is there any mathematical formula to find CPU cost of a query without executing it? Thanks

    902181 wrote:
    Is there any mathematical formula to find CPU cost of a query without executing it? ThanksAny why do you want the cost? What do you expect it to tell you? How are you planning to apply this in your code? Make sure you understand what cost tells you and what it does not tell you. And use that value in a sane fashion.
    As for an alternative to using EXPLAIN PLAN, you can simply parse a SQL into a cursor without executing it. Then determine the SQL cursor id and address and use DBMS_XPLAN to display its execution plan.
    E.g.
    SQL> create or replace procedure ParseSQL( sqlStatement varchar2 ) is
      2          c       integer;
      3  begin
      4          c := DBMS_SQL.open_cursor;
      5 
      6          DBMS_SQL.parse(
      7                  c,
      8                  sqlStatement,
      9                  DBMS_SQL.native
    10          );
    11 
    12          DBMS_SQL.close_cursor( c );
    13  end;
    14  /
    Procedure created.
    SQL>
    SQL> var sqlID varchar2(100)
    SQL> var childNumber number
    SQL> var sqlText varchar2(4000)
    SQL> begin
      2          ParseSQL( 'select /* TEST1 */  * from emp' );
      3 
      4          select
      5                  sql_text, sql_id, child_number into :sqlText, :sqlID, :childNumber
      6          from    v$sql
      7          where   sql_text like 'select /* TEST1 */%';
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> col PLAN_TABLE_OUTPUT format a50
    SQL> select
      2          rownum, p.plan_table_output
      3  from       TABLE( DBMS_XPLAN.Display_Cursor( :sqlID, :childNumber, 'BASIC,COST' ) ) p;
        ROWNUM PLAN_TABLE_OUTPUT
             1 EXPLAINED SQL STATEMENT:
             2 ------------------------
             3 select /* TEST1 */  * from emp
             4
             5 Plan hash value: 3956160932
             6
             7 -----------------------------------------------
             8 | Id  | Operation         | Name | Cost (%CPU)|
             9 -----------------------------------------------
            10 |   0 | SELECT STATEMENT  |      |     3 (100)|
            11 |   1 |  TABLE ACCESS FULL| EMP  |     3   (0)|
            12 -----------------------------------------------
            13
    13 rows selected.
    SQL> The problem is extracting intelligence from the output as it is raw text. Perhaps not that complex as a where clause can be added to only display line id 0 and then extract the cost value from that line. Regular expressions (not my forte) will likely do this easily.

  • How to rewrite this query without sub query please help me

    Hello All Good Evening,
    Could you please help me with this query, how can i write this query without sub query, or how can write this query another ways
    please help me
    select planno, status1, count(*) Counts from
    select a.ValetNO PlanNo  ,
    case 
         when JoinCode in ('00', '01', '02') then 'Actcess'
         when JoinCode in ('20', '21', '22', '23','38', '39') then
         'Secured' else 'Other' end Status1 ---, COUNT (*)
       from  dbo.ppt a(NOLOCK)  left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO  = b.ValetNO
    --group by a.ValetNO
      a group by planno, status1
    order by 2
    Thank you in Advance
    Milan

    Whats your objective here? Sorry, am not able to understand the reason for this change. 
    Try the below:(Not tested)
    ;With cte
    As
    select a.ValetNO PlanNo ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end Status1 ---, COUNT (*)
    from dbo.ppt a(NOLOCK) left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO = b.ValetNO
    select planno, status1, count(*) Counts from cte
    a group by planno, status1
    order by 2
    Even below:
    select a.ValetNO PlanNo ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end Status1 , COUNT (1)
    from dbo.ppt a(NOLOCK) left join dbo.acts b on a.P_ID = b.P_ID and a.ValetNO = b.ValetNO
    Group by a.ValetNO ,
    case
    when JoinCode in ('00', '01', '02') then 'Actcess'
    when JoinCode in ('20', '21', '22', '23','38', '39') then
    'Secured' else 'Other' end

  • How to link from query to executable program (38)

    Hi Experts,
    I develop one sq01 query and that I want link to my executable program which is created by from se38 to display the interactive report .
    The basic list is coming from the  query and secondary list is displaying from the program.
    please explain how to link the query and program to store the values TRSTI table.
    Please help me,its critical

    Kindly search on the net with the keyword "Report assignment in SAP Query", you will get lot of links.

  • How to design a query without using Net Weaver Query Designer

    Does anyone know if any alternative way to <b>design an query without using Net weaver GUI</b>? in order to reduce the time consuming, I am wondering if there have any method which can define/modify a stack of cells, characteristics and structures without work through the GUI.
    Deeply thank for any of your advices.

    Can you give an example?
    Just from what you write, I would assume that you talk about something like a mass-property-changer. As far as I know the BEx this is not really possible, but what I do normally is building one query and then either using query-views (saving more or less the navigation state) or by copying and changing the properties of the few characteristics and key figures.
    But without a specific example it's difficult to exactly understand what you exactly need.
    Mario

  • How to cancel a query when execute query builtin fire and No Records found.

    Hi,
    I am unable to cancel a query when i make query (fire enter-query) then fire (execute-query) and no records found then the form status is enter-query mode. Plz help me that how can i back to normal mode of form.
    here i use the code for coming back to enter-query to normal mode but no results.
         if :system.mode = 'ENTER-QUERY' THEN
    ABORT_QUERY;
         clear_form;          
         END IF;
    thanks in advance....

    Hello,
    I would test the record status of the first record in the block. If this status is 'NEW', then there is no record retrieved, so that you can exit the query mode with exit_form()
    Francois

  • How to precalculate a Query without using a  fixed variable in I Broad C?

    Hello,
    The query should be precalculate with dynamic values of a variable which are investigated during runtime. The broadcaster forces fixed values of a variable.
    Does anybody knows, how to avoid the using of a fixed variable in the Information Broadcaster?
    Thank you in advance.
    Best Regards

    Hi,
    Can you tell me where in the system have you changed this setting. I searched in SPRO but there is nothing about the language. I am also facing similar situation. And if you have worked with PDF files in the broadcaster can you tell me how to change the PDF file names when I run the broadcaster for 6 to 7 variables(I mean VAR1,VAR2,...) The main folder where these PDF files get stored I can define but dont know how to change the PDF file names which fall into this folder.
    Thanks,
    Kal

  • Captivate 6 How to validate user input without using keyboard shortcuts

    I've been using Adobe Captivate 6 for about 4 months now.  Completely new to the program.  The number one function of Captivate for me will to create many software simulations for verifiable training.  This means that I will be utilizing the training and assessment modes A LOT.  I have run into many hurdles throughout the process, but one of my biggies right now is this:
    In the training and assessment modes, I have times where the user must input data such as an address or number.  In the actual software they will be utilizing it is not always required to use TAB or ENTER in order to move to the next field.  In some instances, it will be necessary to actually click into a field after entering data.  My problem is that it seems as if Captivate will not allow this,  as a keyboard shortcut is automatically entered even if a TAB or ENTER is not required after input.  I assume this is so that the inputted information can be verified.  If you decide you do not want to use a keyboard shortcut to validate the inputted information, you must have a submit button.  Is there any way to change this??  All I want is for the user to enter information and then click into another field WITHOUT having to press ENTER, TAB, or hit a submit button.  Is this even possible if you need user input to be validated??  Any ideas or suggestions would be much appreciated!!

    Hello,
    A while ago I explained the work flow I’m using often in that case, only for the last field you need to have either a shortcut or a submit button AND the sequence has to be imposed. The idea is that you make the Submit button for the first field transparent, delete the  ‘Submit’ text and put it over the second field. So if the user clicks on the second field, he also submits the value of the first field.
    Here is the blog post I’m referring to:
    http://lilybiri.posterous.com/one-submit-button-for-multiple-text-entry-box
    Although it was written for previous versions, the idea will still be functional.
    Lilybiri

  • How to validate required fields before executing menu item ("Save As") using cutom Javascript?

    Hi,
    Sorry, I am new to PDF Development. I tried creating PDF using Acrobat XI Pro. During creation, I have encountered issues in running custom JavaScript. The requirement is to validate all the required fields before saving the PDF. I tried using the following scripts to validate the said required fields. But, it's not working.
    Option 1: If the field is null, a message box will appear.
    if(this.getfield("textbox") = null){
    app.alert("required");
    else {app.execMenuItem("SaveAs");}
    Option 2: If the field is required, a message box will appear.
    var f = this.getField("textbox");
    f.required = true;
    if(f = true)
    app.alert('required');
    else
    app.execMenuItem("SaveAs");
    The scripts mentioned above are not working. I wanted to validate the required fields before saving the PDF.
    In addition, I tried validating each field using the following script:
    f = getField(event.target.name)
    if (f.value.length == 0)
        f.setFocus()
        //Optional Message - Comment out the next line to remove
        app.alert("This field is required. Please enter a value.")
    When I open the PDF, the script is working. However, when the message box pops out, the "OK" button is not working as expected. The message box is not closing. I tried opening the form in a site in different Java versions (like 7-11 and 7-67). It's working in version 7-67. I tried upgrading the Java version from 7-11 to 7-67. Still, it doesn't work.
    I would appreciate your feedback on this matter.

    If you set the fields as required, then when the user hits the print button you could run this script:
    var txt = form1.execValidate();
    if (txt == true){
    print command
    This code assumes that the root node of your form is form1. Also ensure you put a message into the Empty Message parameter for each field that you want to mark s required.

  • How to validate Combobox items without expanding the combobox.

    Hi,
    I want to select the combobox item.
    before selecting an item I want to validate whether the item is present in the combobox list.
    while validating the item at for loop the combobox get expanded. 
    I don't want to expand it.
    if (children[index].Name == entryToSelect)
    isExists =
    true;
    break;
    Please share your thoughts.....

    Hi Rosy D,
    I also try to test it in my side.
    As far as I know we could collect all items with ComboBox.ObjectCollection class:
    http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.objectcollection(v=vs.110).aspx
    http://stackoverflow.com/questions/17709363/check-if-user-input-are-in-the-combobox-items
    But it seems that I'm failed to use this method in coded UI tests, so I’m afraid that it has this limitation for this issue.
    We would use the
    GetChildren method,
    but as far as I know, we would expand this control.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/6f71fed3-777f-433a-87b0-e4190ff06632/telerik-combobox-returned-as-an-editbox-vs-combobox?forum=vsautotest
    http://stackoverflow.com/questions/18079008/get-all-values-from-a-listbox-using-coded-ui-test-and-select-it
    Best Regards,
    Jack 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Finding query access frequency or how many times a query has been executed?

    Dear Experts
    I need to find the total number of access frequency of individual queries that are requested by the users say at a particular time.
    Say there are 20 distinct queries requested in the time difference of 3 hours. All of the 20 queries or some of the queries may be requested for more than 2/3 times at that time by other users. By the way say query Q1 is requested 5 times at that so its query access frequency or how many times this query is executed is 5.
    From where and how can I can find this counting of query access frequency or how many times a query has been executed at particular time or a session?
    Normally we know the there SQL history dynamic performance views or if it can be possible to query the Shared pool library cache for SQL area it may be possible to find the total number of execution time for a query. But how to find that if anyone knows, please help me about this.
    Regards-
    Engr. A.N.M. Bazlur Rashid
    OCP DBA

    That's one of the stats reported by statspack - assuming that your query does sufficient work to meet the thresholds for the standard report. Executions is of course one of the columns of v$sql so you might just wish to sample that yourself. Finally if you are on 11g and the sql you are interested is relatively low resource intensive and you are licensed for AWR then you can use the slightly madly named "colored sql" feature that ensures that a specific statement will always be sampled for AWR.
    Niall Litchfield
    http://www.orawin.info/

  • How to Automate the Query Search Upon Return to the Calling Form?

    Greetings Ya’ll Gurus,
    Could you please share with me how to make the Query Search executed automatically each time, when database table is updated, upon return to the “Calling Form” (i.e. FormA in this posting) from the “Called Form” (i.e. FormB from here on)?
    I have FormA call_form to FormB. FormB may return to FormA. FormA allows users to enter the Query parameters and perform query Search to the database table with a list of search results afterward; whereas FormB allows users to add or delete the same database table records. Both form images are as follows:
    FormA:
    !http://dot.state.ak.us/nreg/jtomasic/FormA_DWR_SEL.GIF!
    FormA call_form to FormB by clicking PB “Daily Work Report” (see circled PB "Daily Work Report" in the above image.)
    FormB Image (FormB allows users to add and delete database records):
    !http://dot.state.ak.us/nreg/jtomasic/FormB_DWR.GIF!
    FormB EXIT_FORM and returns to FormA (see circled PB "DWR Selection" in above image).
    Currently, our users must press the PB “Search” on FormA each time to refresh the Query “Search” results after returning to FormA, and they request to have the "Search" done automatically/programmatically upon return to FormA each time when the database table is updated.
    If you have programming code on this and are willing to share or if you have any suggestion or thoughts on this, it would be most greatly appreciated.
    Thanks a lot & Happy Holidays!

    Thanks so much Andreas, and yes, your link for calling a form and passing a context is very helpful. I believe, your suggested use of the global variable for the saved database table will work for the automation of the Query Search. I am, however, not sure how to make the code and the trigger to automatically perform Query PB "Search". The code for our current "WHEN-BUTTON-PRESSED" Trigger for the PB-Search of FormA is as following:
    DECLARE
         alert_button     NUMBER;
         alert_id               ALERT;
      MY_WHERE VARCHAR2(2500);
      MY_DIST_ID         DIST.DIST_ID%TYPE     := :BLK_UPDATE.DIST_ID;
      MY_ORG_ID          DWR.ORG_ID%TYPE       := :BLK_UPDATE.ORG_ID;
      MY_ACTY_ID         DWR.ACTY_ID%TYPE      := :BLK_UPDATE.ACTY_ID;
      MY_ACTY_WORK_ID    DWR.ACTY_WORK_ID%TYPE := :BLK_UPDATE.ACTY_WORK_ID;
      MY_CNTY_ID         DWR.CNTY_ID%TYPE      := :BLK_UPDATE.CNTY_ID;
      MY_ASSET_GRP_ID    DWR.ASSET_GRP_ID%TYPE := :BLK_UPDATE.ASSET_GRP_ID;
      MY_ASSET_ID        DWR.ASSET_ID%TYPE     := :BLK_UPDATE.ASSET_ID;
      MY_RTE             DWR.RTE%TYPE          := :BLK_UPDATE.RTE;
      MY_BEG_MP          DWR.BEG_MP%TYPE       := :BLK_UPDATE.BEG_MP;
      MY_END_MP          DWR.END_MP%TYPE       := :BLK_UPDATE.END_MP;
      MY_FROM_DATE       DWR.DWR_DATE%TYPE     := :BLK_CONTROL.FROM_DATE;
      MY_TO_DATE         DWR.DWR_DATE%TYPE     := :BLK_CONTROL.TO_DATE;
      MY_FLAG_OFFSYS     VARCHAR2(11)          := :BLK_UPDATE.FLAG_OFFSYS;
      MY_FLAG_COMMENTS   VARCHAR2(11)          := :BLK_UPDATE.FLAG_COMMENTS;
      MY_SPECIAL_EVENT_SEQ_NO SPECIAL_EVENT.SPECIAL_EVENT_SEQ_NO%TYPE  := :BLK_UPDATE.SPECIAL_EVENT_DESCR;
      MY_FLAG_ACCDT      VARCHAR2(11)          := :BLK_UPDATE.FLAG_ACCDT;
    BEGIN
    :blk_control.dummy_flag := 1 ;
    :BLK_CONTROL.DUMMY_ERR_FLAG := 'N';
    VALIDATION_SELECTION;     -- Program Unit VALIDATES DWR SELECTION PARAMETERS PRIOR TO
                                                    -- PERFORMING THE SEARCH AND POPULATING THE DISPLAY BLOCK
    if :blk_control.dummy_flag = 1 then
      IF :BLK_CONTROL.DUMMY_ERR_FLAG = 'N' THEN
        MY_WHERE := BUILD_WHERE_CLAUSE(MY_DIST_ID,
                                       MY_ORG_ID,
                                       MY_ACTY_ID,
                                       MY_ACTY_WORK_ID,
                                       MY_CNTY_ID,
                                       MY_ASSET_GRP_ID,
                                       MY_ASSET_ID,
                                       MY_RTE,
                                       MY_BEG_MP,
                                       MY_END_MP,
                                       MY_FROM_DATE,
                                       MY_TO_DATE,
                                       MY_FLAG_OFFSYS,
                                       MY_SPECIAL_EVENT_SEQ_NO,
                                       MY_FLAG_ACCDT,
                                       MY_FLAG_COMMENTS);
        SET_BLOCK_PROPERTY('BLK_DISPLAY', DEFAULT_WHERE, MY_WHERE);
        GO_BLOCK('BLK_DISPLAY');
        CLEAR_BLOCK(NO_VALIDATE);
        EXECUTE_QUERY(ALL_RECORDS);
        IF :BLK_DISPLAY.DWR_SEQ_NO IS NOT NULL THEN
                   SET_ITEM_ON_OR_OFF('BLK_CONTROL.PB_PRINT', TRUE);
        ELSE
                   SET_ITEM_ON_OR_OFF('BLK_CONTROL.PB_PRINT', FALSE);
                   alert_id := FIND_ALERT('no_data_query');
                   IF ID_NULL(alert_id) THEN
                        error_msg(1000);
                   ELSE
                        set_alert_message(alert_id, 1040);
                        alert_button := SHOW_ALERT(alert_id);
                   END IF;
              END IF;
              GO_BLOCK('BLK_UPDATE');
              GO_ITEM('BLK_CONTROL.PB_SEARCH');
         END IF;
    end if;
    END;My questions are:
    After initializing, set and/or reset the global variable for the saved database table,
    do I copy the above code (i.e. the "entire" code in the "WHEN-BUTTON-PRESSED" Trigger for the PB-Search) to the WHEN-NEW-FORM-INSTANCE-trigger, or other trigger(s), of FormA to automate the Query Search whenever there is a successful database commit/save? Or
    is there a simple way to activate the code in the "WHEN-BUTTON-PRESSED" Trigger for the PB-Search of FormA? Or
    is there a simple way to activate the EXECUTE_QUERY(ALL_RECORDS) command in the WHEN-NEW-FORM-INSTANCE-trigger or other trigger(s) of FormA ?
    Thanks and always.

  • Stuck on how to improve very slow query without any admin rights

    Hello All,
    I am using the code below to query a very large data table (RH) and a few other joined tables. I am trying to improve the query but I do not have any admin rights and have no idea how to get diagnostic info on how the query is being executed. Apologies for the system specific and probably not easy to read code but I do not have a generic version that anyone could run, and no admin rights so I can not create tables.
    The main part of the code below (subquery R) takes about 10 minutes to run (3 minutes without the date parameters) and the full code (with the two analytic functions on top) below takes an eye watering 30 minutes to run and this is only a subquery of a much larger query so I really need to get this running more quickly. All I want to do is place a cap on the dates, get partitioned row numbers and a lead row value on one of the fields. I really am stuck on how to get this query more efficient. Am I counting things multiple times unnecessarily? How can I make this quicker? Am I committing some cardinal programming sin in using analytic functions on subqueries?
    Apologies for the vaugueness of this code and my questions but I am totally clueless about diagnostics and basically have very limited system access so I'm stuck as to where to go or to look.
    Very grateful for any advice,
    Jon
    SELECT R.*
    , ROW_NUMBER( ) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RN
    , LEAD(R.RTNG_CD,1,0) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RTNG_CD_PREV
    FROM ( SELECT RH.RTNG_ID
    , RH.RTBLE_ID
    , RA.RTNG_ACTN_DESC
    , TYP.RTNG_TYP_DESC
    , RH.RTNG_CD_ID
    , RC.RTNG_CD
    , RH.EFF_DT
    , RH.CHG_DT
    , RAL.RTNG_ALRT_TYP_ID
    , RAL.EFF_DT ALRT_EFF_DT
    , RAL.CHG_DT ALRT_CHG_DT
    , RH.PRV_FLG
    FROM FTCH_RTNG.RTNG_HIST RH
    , FTCH_RTNG.RTNG_ALRT_HIST RAL
    , FII_CORE.RTNG_ACTN RA
    , FTCH_RTNG.RTNG_TYP TYP
    , FII_CORE.RTNG_CD RC
    WHERE RH.RTNG_ACTN_ID = RA.RTNG_ACTN_ID
    AND RH.RTNG_TYP_ID = TYP.RTNG_TYP_ID
    AND RH.RTNG_TYP_ID = RC.RTNG_TYP_ID
    AND RH.RTNG_CD_ID = RC.RTNG_CD_ID
    AND RH.RTNG_ID = RAL.RTNG_ID (+)
    AND RH.DELETE_FLG = 'N'
    AND RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')
    AND RAL.EFF_DT < TRUNC(CURRENT_DATE,'MM')
    )R
    -----

    Thanks so much for replying blueforg, and for pointing out the code markup.
    Our server is in the US and we run our code from London, so it is the local time I am interested in, CURRENT_DATE is merely there to get that and as you suggest is not a column. I want my cap to the first of whatever month I run the code on so I'm happy with that bit of the code (so 1 Oct if I run it today). I'm just surprised at how slow my code becomes when I try and restrict the dates and get the row numbers and next row values.
    This code is actually a subquery used in a much bigger query that I am trying to tidy up and make more efficient. The RN is important as I will eventually be filtering for RN = 1. I didn't post the full query as it is huge,badly written (by me) and and particular to our databases so I'm tackling bits one at a time to cut down on confusion. I'll repost with the RN=1 and the code markup ;)
    I also restricting the RH table directly (SELECT * FROM FTCH_RTNG.RTNG_HIST RH WHERE RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')) and moving the analytic functions into the R subquery but that is very slow as well. I heard that temporary tables are efficient? I'm assuming that with my rubbish priveleges I will not be able to do that. I don't want to take any chances of messing anything up either!
    Jon
    SELECT RT.* FROM
      ( SELECT  R.*
              , ROW_NUMBER( ) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RN    
              , LEAD(R.RTNG_CD,1,0) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RTNG_CD_PREV
        FROM  ( SELECT  RH.RTNG_ID    
                      , RH.RTBLE_ID    
                      , RA.RTNG_ACTN_DESC    
                      , TYP.RTNG_TYP_DESC    
                      , RH.RTNG_CD_ID    
                      , RC.RTNG_CD    
                      , RH.EFF_DT  
                      , RH.CHG_DT 
                      , RAL.RTNG_ALRT_TYP_ID    
                      , RAL.EFF_DT ALRT_EFF_DT    
                      , RAL.CHG_DT ALRT_CHG_DT
                      , RH.PRV_FLG    
                FROM    FTCH_RTNG.RTNG_HIST RH
                      , FTCH_RTNG.RTNG_ALRT_HIST RAL
                      , FII_CORE.RTNG_ACTN RA    
                      , FTCH_RTNG.RTNG_TYP TYP    
                      , FII_CORE.RTNG_CD RC    
                WHERE RH.RTNG_ACTN_ID = RA.RTNG_ACTN_ID    
                AND RH.RTNG_TYP_ID = TYP.RTNG_TYP_ID    
                AND RH.RTNG_TYP_ID = RC.RTNG_TYP_ID    
                AND RH.RTNG_CD_ID = RC.RTNG_CD_ID    
                AND RH.RTNG_ID = RAL.RTNG_ID (+)    
                AND RH.DELETE_FLG = 'N'
                AND RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')
                AND RAL.EFF_DT < TRUNC(CURRENT_DATE,'MM')
                                                          )R  )RT
    WHERE RT.RN = 1-----

  • How to pull only column names from a SELECT query without running it

    How to pull only column names from a SELECT statement without executing it? It seems there is getMetaData() in Java to pull the column names while sql is being prepared and before it gets executed. I need to get the columns whether we run the sql or not.

    Maybe something like this is what you are looking for or at least will give you some ideas.
            public static DataSet MaterializeDataSet(string _connectionString, string _sqlSelect, bool _returnProviderSpecificTypes, bool _includeSchema, bool _fillTable)
                DataSet ds = null;
                using (OracleConnection _oraconn = new OracleConnection(_connectionString))
                    try
                        _oraconn.Open();
                        using (OracleCommand cmd = new OracleCommand(_sqlSelect, _oraconn))
                            cmd.CommandType = CommandType.Text;
                            using (OracleDataAdapter da = new OracleDataAdapter(cmd))
                                da.ReturnProviderSpecificTypes = _returnProviderSpecificTypes;
                                //da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
                                if (_includeSchema == true)
                                    ds = new DataSet("SCHEMASUPPLIED");
                                    da.FillSchema(ds, SchemaType.Source);
                                    if (_fillTable == true)
                                        da.Fill(ds.Tables[0]);
                                else
                                    ds = new DataSet("SCHEMANOTSUPPLIED");
                                    if (_fillTable == true)
                                        da.Fill(ds);
                                ds.Tables[0].TableName = "Table";
                            }//using da
                        } //using cmd
                    catch (OracleException _oraEx)
                        throw (_oraEx); // Actually rethrow
                    catch (System.Exception _sysEx)
                        throw (_sysEx); // Actually rethrow
                    finally
                        if (_oraconn.State == ConnectionState.Broken || _oraconn.State == ConnectionState.Open)
                            _oraconn.Close();
                }//using oraconn
                if (ds != null)
                    if (ds.Tables != null && ds.Tables[0] != null)
                        return ds;
                    else
                        return null;
                else
                    return null;
            }r,
    dennis

  • How to delete confirmed schedule lines, without executing the ATP check?

    Sales and Distribution: Concerning ATP (product allocation)
    Situation:
    Step 1: An order is created with priority low. Quantities are confirmed for line items.
    Step 2: A second order is created with a higher priority. No confirmed quantities.
    Rescheduling program (SDV03V02) is then executed. This selects and sorts the orders in the correct order.
    The confirmed quantities for the first (low priority) order should now be freed up, to be able to allocate those quantities to the second (high priority) order.
    The problem I am facing is that the confirmed quantities are NOT released.
    We cannot use BAPI_SALESORDER_CHANGE or SD_SALESDOCUMENT_CHANGE to delete or modify the schedule lines, because these function modules execute the ATP check again. And when that happens, quantities are again confirmed and assigned.
    How can we get rid of the confirmed schedule lines, without executing the ATP check?
    Thanks,
    Edwin.

    Found a solution to the problem:
    In the Rescheduling program we export a parameter to the memory, to make it possible to delete schedule lines without executing the ATP check.
    Deleting of the schedule lines is done with a BAPI, which will call the ATP check automatically for ATP relevant materials. This we want to stop from happening (only when calling the BAPI).
    After the BAPI has been called we FREE the MEMORY ID.
    The parameter is imported again in Customer-Exit EXIT_SAPLATPC_001.
    Transaction.. SMOD
    Enhancement.. ATP00001
    Component.... EXIT_SAPLATPC_001,
    Include...... ZXATPU01.
    The customer exit is used in function AVAILABILITY_CHECK_CONTROLLER, just before calling function 'AVAILABILITY_CHECK'.
    Simply refreshing the ATP tables in the customer-exit, will prevent the ATP check from being executed (because we removed the list containing the materials for which the ATP check needs to be done). As a result, the function 'AVAILABILITY_CHECK' will not be processed.

Maybe you are looking for

  • Default table scripts in ORACLE 9i

    Hi, Is there an sql script which is available to create and populate the default tables in the SCOTT user. At the moment it has the EMP, DEPT, SALGRADE tables. But there is an another version of these tables and data: EMPLOYEES DEPARTMENTS JOB_GRADES

  • PSE 11 sharing option

    Hi I have adobe photoshop elements 11 installed on my macbook pro. Im using iphoto as the default image viewer and now I connect it with PSE 11 as my image editor, its cool software for users. however, there is no option to share images edited with P

  • Selection criteria at delta initialization

    hi, I want to initialize delta extraction for given time period but extractor keeps sending me all table data from source system. Does somebody know what is going on? Regards, Andrzej

  • How come this sound only plays once?

    Here is a program that illustrates what I am doing: import java.io.*; import javax.swing.*; import java.awt.event.*; import javax.sound.sampled.*; public class soundApp extends JFrame     JButton button;                     Clip clip;     public soun

  • Create a red text button

    I have a requirement to sometimes create a red button so have implemented two buttons on the region that are mutually exclusive. I have created a css (below) for the button that needs to be red and created a new template - all works fine but the butt