SQL Query (not OMBPlus) to get Join- and Filter-Conditions

Hallo,
I allready used the Views ALL_IV_XFORM_... to get serveral informations on my mappings using SQL-Queries,
but how can I retrieve the Conditions of an Join- or Filter-Transformation using SQL and not OMBPLUS?
Thanks in advance
Frank

but how can I retrieve the Conditions of an Join- or Filter-Transformation using SQL and not OMBPLUS?if i understood the question correctlly then
join will be written as
select * from table_1 , table_2  where table_1.col1=table_2.col2;filter will be written as
select * from table_1  where table_1.col1='A';

Similar Messages

  • SQL query not calculating

    SQL query not calculating
    gross_amount is giving the value of extended_amount and the gross_price_rc is giving the value of unit_selling_price
    select customer_trx_line_id,
    ( extended_amount / 1- (decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) GROSS_AMOUNT,
    ( unit_selling_price /1-(decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) gross_price_rc
    from ra_customer_trx_lines_all
    where attribute6 is not null or attribute7 is not null or attribute8 is not null or attribute9 is not null
    whats the isuue here??
    Thanks

    decode(attribute7,null,0)Looking at it again, this always returns 0 or NULL, so it not really surprising
    DECODE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions040.htm#i1017437
    CASE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm#i1033392

  • Get-messagtrackinglog and filter by RemoteIpRanges

    Hello,
    Exchange 2010 sp3
    Is it possible to perform a get-messagtrackinglog and filter by RemoteIpRanges? I want to know whether a specific ip address is sending mail messages to the send connector?

    Hi,
    Agree with Amit. We can use ConnectorID to specify the destination Send connector or Receive connector. You can refer to this article below.
    http://technet.microsoft.com/en-us/library/bb124375(v=exchg.141).aspx
    Best regards,
    Belinda
    Belinda Ma
    TechNet Community Support

  • SQL query returning error in 1 db and not in other db

    database1
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl
    WHERE (deal_no, site_no, seq_no) IN
    (select deal_no, site_no, seq_no
    from deal_sku
    where sku_no = 29747
    and apply_site_no = 1201
    and deal_no = dealdtl.deal_no
    and site_no = dealdtl.site_no
    and seq_no = dealdtl.seq_no)
    and min_qty <= decode(pack_type, 'P',1,'U',10)
    and (site_no, deal_no) IN
    (select site_no, deal_no
    from dealhdr
    where vendor_id = 'VNMIKE'
    --and site_no = dealdtl.site_no
    --and deal_no = dealdtl.deal_no 
    and start_dt <= to_date('12-SEP-08', tmxgbl.date_format)
    and stop_dt >= to_date('12-SEP-08', tmxgbl.date_format)
    query produces an error on to_date function ORA-01858 non numeric character found where numeric expected
    all the tables have no data in them
    i.e. if i do a
    select site_no, deal_no
    from dealhdr --0 rows
    select deal_no, site_no, seq_no
    from deal_sku--0 rows
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl--o rows
    However, when the same query is executed in a different database, it does not bring up an error, same data condition 0 rows on all three tables.
    On both databases tmxgbl.date_format returns the same 'mm/dd/rr' formaty mask
    can somebody explain the reason for this please?
    Thanks
    Vijay

    still no error on the database that doesn not throw an error
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl
    WHERE (deal_no, site_no, seq_no) IN
    (select deal_no, site_no, seq_no
    from deal_sku
    where sku_no = 29747
    and apply_site_no = 1201
    and deal_no = dealdtl.deal_no
    and site_no = dealdtl.site_no
    and seq_no = dealdtl.seq_no)
    and min_qty <= decode(pack_type, 'P',1,'U',10)
    and (site_no, deal_no) IN
    (select site_no, deal_no
    from dealhdr
    where vendor_id = 'VNMIKE'
    --and site_no = dealdtl.site_no
    --and deal_no = dealdtl.deal_no 
    and start_dt <= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
    and stop_dt >= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
    --and start_dt <= to_date('12-SEP-08', 'CRAP')
    --no error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using Parameters in SQL-Query not only in where clauses

    Hi,
    I try to use Publisher parameters in the SQL Query from a Data Set.
    All of them have default values.
    So far, this is no problem, unless I try to use such a parameter value as an ordinary attribute value:
    >
    select
         case when (:pv_Group = 'no') then "DM15D_BETRIEBSTEIL"."BETR_TEIL"
                                            else :pv_some_Text end                                                                  as Betr_Teil,
         case when (:pv_Group = 'no') then "DM15D_BETRIEBSTEIL"."SUVA_NR_FORM"
                                            else :pv_some_Text end                                                        as Suva_Nr,
         case when (:pv_Group = 'no') then "DM15K_RIS_FAKTEN_PRO_BTT_JHR"."RIS_VOLLBESCH"
                                            else sum("DM15K_RIS_FAKTEN_PRO_BTT_JHR"."RIS_VOLLBESCH") end      as Vollbesch
    from "GDWH05"
    where
         "DM15D_BETRIEBSTEIL"."SUVA_NR_FORM" in (:pv_nim100)
         fetch first 65001 rows ONLY
    >
    The parameters 'pv_Group' and 'pv_nim100' are working fine. (when or where clauses)
    The parameter 'pv_some_Text' unfortunately not. (simple literals)
    When I try to validate the above SQL, I get the following Error:
    <font color="red">
    java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS. [nQSError: 46033] Datatype: 25 is not supported.
    </font>
    After use a cast function:
    >
    else CAST(:pv_some_Text AS CHARACTER)
    >
    I get this ERROR:
    <font color="red">
    java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS. [nQSError: 19002] Incorrect use of parameters. The parameters used in CAST cannot be resolved without ambiguity.
    </font>
    We use OBIEE 11.1.1.6.4 on a Win64-System.
    Thank's for any help.

    Hi Alex,
    let's leave away any unnecessary details.
    This is the SQL, inserted in the window 'Edit Data Set' of BIP Data Model:
    >
    select
         '--1'     as Betr_Teil,
         '--2'      as Suva_Nr,
         sum("GDWH05"."DM15K_RIS_FAKTEN_PRO_BTT_JHR"."RIS_VOLLBESCH") as Vollbesch
    from "GDWH05"
    where
         "DM15D_BETRIEBSTEIL"."SUVA_NR_FORM" in ('122-4.4')
         fetch first 65001 rows ONLY
    >
    Everything is fine when I click OK, the script goes back to the metadata.
    Let's try this script with bind values in ORACLE SQL Developer.
    This SQL is the physical part, found in the OBIEE-Log (Log level 5), except the bind values. Therefore we find, in the where clause, the join. In the logical sql, we don't have to join, because it's handled in the Common Enterprise Information Model (CEIM)
    >
    with
    sawith0 as
    select
    sum(t39617.ris_vollbesch) as c1
    from
    dm15d_betriebsteil t39455,
    dm15k_ris_fakten_pro_btt_jhr t39617
    where
    t39455.id_betriebsteil = t39617.id_betriebsteil
    and t39455.suva_nr_form = '122-4.4'
    select
    d1.c1 as c1,
    d1.c2 as c2,
    d1.c3 as c3
    from
    select
    :pv_some_text as c1,
    :pv_some_text as c2,
    sum(d1.c1) as c3
    from
    sawith0 d1
    d1
    where
    rownum <= 65001
    >
    This SQL works fine, even with bind values for 'pv_some_text'.
    But, when using the following SQL in the BIP Data Model:
    >
    select
         :pv_Text as Betr_Teil,
         :pv_Text as Suva_Nr,
         sum("GDWH05"."DM15K_RIS_FAKTEN_PRO_BTT_JHR"."RIS_VOLLBESCH") as Vollbesch
    from "GDWH05"
    where
         "DM15D_BETRIEBSTEIL"."SUVA_NR_FORM" in ('122-4.4')
         fetch first 65001 rows ONLY
    >
    The following ERROR occurs:
    <font color="red">java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS. [nQSError: 46008] Internal error: File server\Query\Optimizer\ServiceInterfaceMgr\Utility\Src\SQOIUTypeVisitor.cpp, line 643.</font>
    In my opinion, either I use a wrong syntax, or BIP has a problem with parsing the script.
    Thank you for your most welcome help.

  • Sql query not executed using recordset

    Hi All,
    I am trying to first format and then execute SQL query statement using recordset object with DI API. the issue is with vb.net's string formatting. I want to use 'USE [DB_Name]' statement in SQL and then 'Alter Procedure ..' statement. as this has to be the first statement in sql , I am using 'GO' in between and seperating each sentence with following syntax.
      Dim AltProc  as string
      AltProc = " USE [DB_name]" & Environment.NewLine
      AltProc = AltProc & " GO " &  Environment.NewLine
      AltProc = AltProc & " ALTER proc [proc_name] " &  Environment.NewLine
    '---------------------and so on
    Orec.DoQuery(AltProc)
    this formatting does not recognize new line and gives 'incorrect syntax near 'Go'' error.  strange thing is, if I take this query in SQL, it runs perfectly and I can see it getting formatted with each new line created. I tried even VbcrLf but it didnt work.
    any one has any idea?
    thanks in advance,
    Binita

    HI Binita
    The reason:
    GO is the "command" delimiter of MS Query Editor.
    It is not working with RecordSet Object.
    In MS SQL 2008 version you can define the schema before the procedure name but in SQL server 2000/2005 it is not possible.
    IN SQL 2008 use the Fully Qualified name instead of GO:
    Dim AltProc  as string
      AltProc = " ALTER proc [DB_name].[dbo].[proc_name] "  + vbcrlf
    '---------------------and so on
    Orec.DoQuery(AltProc)
    it is not working on MS SQL 2008 i have tried.
    'CREATE/ALTER PROCEDURE' does not allow specifying the database name as a prefix to the object name.'
    Regards,
    J.
    Edited by: Janos  Nagy on Jun 22, 2009 2:55 PM

  • ORA-00904 ON A PLSQL QUERY RETURNING SQL QUERY ( NOT ALWAYS )

    Running a classic report , we sometimes face the error :
    <pre>failed to parse SQL query:
    ORA-00904: : invalid identifier
    Even when using the same parameters, sometimes the report runs and some others we get the error.
    The report is called by a url from a different page
    f?p=&APP_ID.:500:&APP_SESSION.:FLOW_EXCEL_OUTPUT_R&P503_RUN_REGION_ID._el:NO::P500_RUN_RG,P500_RG11_FILTER1:1,&P503_FILTER1.
    THE EVNVIRONMENT IS THE FOLLOWING
    ORACLE DATABASE 11g      Enterprise Edition Release 11.2.0.2.0 -64bit
    Apex                     Application Express 4.1.0.00.32
    In the apex on the same workspace we have 2 copies of the same application having different schema.
    We did not face this problem in Oracle 10g

    hello,
    I send you the function. rs_check_limit .
    In one case when i tried to debug in order to understand the error, the function was not fired.
    FUNCTION rs_check_limit ( p_trade_date_from date
    , p_trade_date_to date, p_session_id number , p_user_id varchar2
    , p_pct_sum_prcp_cd number
    ,p_rs_list_exclude varchar2 default ' '
    return rs_check_limit_tb PIPELINED
    is
    v_data rs_check_limit_tp :=rs_check_limit_tp ( null, null,null, null,null, null,null, null,null, null );
    CURSOR exec_trades_prcp_cur (vc_risk_date_from date
    , vc_risk_date_to date
    , vc_rs_list_exclude varchar2
    is
    select PRCP_CD
    , clr_sys_cd
    , clr_acc_cd
    ,avg( exec_trades_value_mkt ) avg_exec_trades_prcp
    ,SUM( exec_trades_value_mkt ) sum_exec_trades_prcp
    from
    select trd_dt, PRCP_CD , clr_sys_cd
    , clr_acc_cd , sum ( exec_trades_value_mkt ) exec_trades_value_mkt
    from
    select lst_cmpt_dt trd_dt , PRCP_CD , clr_sys_cd
    , clr_acc_cd
    ,SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
    from rs_mm_rsk_lmts_dtls
    where 1=1
    and lst_cmpt_dt > vc_risk_date_from -1
    and lst_cmpt_dt <= vc_risk_date_to
    and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
    group by lst_cmpt_dt , PRCP_CD , clr_sys_cd
    , clr_acc_cd
    UNION ALL
    select trunc ( apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt,- 1) ) trd_dt , PRCP_CD , clr_sys_cd
    , clr_acc_cd, SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
    from rs_mm_rsk_lmts_dtls
    where trd_dt = apx_rs_risk_info.get_d_n_cur ( lst_cmpt_dt , 2 )
    and lst_cmpt_dt > apx_rs_risk_info.get_d_n_cur (vc_risk_date_from ,1 )-1
    and lst_cmpt_dt < vc_risk_date_to
    and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
    group by apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt , -1 ) ,PRCP_CD , clr_sys_cd
    , clr_acc_cd
    group by trd_dt, PRCP_CD , clr_sys_cd
    , clr_acc_cd
    group by PRCP_CD , clr_sys_cd
    , clr_acc_cd
    CURSOR exec_trades_all_cur (vc_risk_date_from date
    , vc_risk_date_to date
    , vc_rs_list_exclude varchar2)
    is
    select SUM( exec_trades_value_mkt ) sum_exec_trades_all -- óõíïëéêÞ çìåñÞóéá áîßá óõíáëëáãùí áãïñÜò
    , avg( exec_trades_value_mkt ) avg_exec_trades_all
    from
    select trd_dt, sum( exec_trades_value_mkt ) exec_trades_value_mkt
    from
    --gia  T : T, T-1 ,  T-2
    select lst_cmpt_dt trd_dt , SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
    from rs_mm_rsk_lmts_dtls
    where 1=1
    and lst_cmpt_dt > vc_risk_date_from -1
    and lst_cmpt_dt <= vc_risk_date_to
    and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
    group by lst_cmpt_dt
    union all
    --gia  T EPIPLEON: T-3
    select apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt,-1) trd_dt , SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
    from rs_mm_rsk_lmts_dtls
    where trd_dt = apx_rs_risk_info.get_d_n_cur ( trunc ( lst_cmpt_dt ) , +2 )
    and lst_cmpt_dt > apx_rs_risk_info.get_d_n_cur (vc_risk_date_from ,1 )-1
    and lst_cmpt_dt < vc_risk_date_to
    and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
    group by apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt , -1 )
    group by trd_dt
    exec_trades_prcp_row exec_trades_prcp_cur%rowtype;
    exec_trades_all_row exec_trades_all_cur%rowtype;
    i number := 0;
    tmp varchar2(4) := null;
    procedure feed_table is
    BEGIN
    v_data.prcp_cd := exec_trades_prcp_row.prcp_cd;
    v_data.clr_sys_cd := exec_trades_prcp_row.clr_sys_cd;
    v_data.clr_acc_cd := trim(exec_trades_prcp_row.clr_acc_cd);
    v_data.member_id := RS_GET_PRCP_MEMBER_ID(exec_trades_prcp_row.prcp_cd);
    v_data.member_dsc := RS_GET_PRCP_DSC(exec_trades_prcp_row.prcp_cd);
    v_data.sumTRADES_VALUE_PRCP_CD_T := round( exec_trades_prcp_row.sum_exec_trades_prcp,2);
    v_data.mkt_sumTRADES_VALUE_PRCP_CD_T := round( exec_trades_all_row.sum_exec_trades_all,2) ;
    v_data.avgTRADES_VALUE_PRCP_CD_T := round( exec_trades_prcp_row.avg_exec_trades_prcp,2);
    v_data.mkt_avgTRADES_VALUE_PRCP_CD_T := round( exec_trades_all_row.avg_exec_trades_all,2) ;
    v_data.pct_sum_prcp_cd := round( 100* exec_trades_prcp_row.sum_exec_trades_prcp
    / exec_trades_all_row.sum_exec_trades_all , 2);
    end ;
    begin
    exec_trades_all_row := null;
    open exec_trades_all_cur (vc_risk_date_from => p_trade_date_from
    , vc_risk_date_to => p_trade_date_to
    ,vc_rs_list_exclude => NVL(p_rs_list_exclude ,'.' )
    fetch exec_trades_all_cur INTO exec_trades_all_row;
    close exec_trades_all_cur;
    for exec_trades_prcp_rec in exec_trades_prcp_cur (vc_risk_date_from => p_trade_date_from
    , vc_risk_date_to => p_trade_date_to
    ,vc_rs_list_exclude => NVL(p_rs_list_exclude ,'.' )
    loop
    exec_trades_prcp_row := exec_trades_prcp_rec;
    if exec_trades_all_row.sum_exec_trades_all <> 0 then
    if 100* exec_trades_prcp_row.sum_exec_trades_prcp
    / exec_trades_all_row.sum_exec_trades_all >= p_pct_sum_prcp_cd then
    i := i+1;
    v_data :=rs_check_limit_tp ( null, null,null, null,null, null,null, null,null, null );
    feed_table;
    pipe row ( v_data );
    end if;
    end if;
    end loop;
    end;
    I send you the dll for the type
    CREATE OR REPLACE
    TYPE rs_check_limit_tp as object
    prcp_cd varchar2(10)
    , member_id varchar2(4)
    , member_dsc varchar2(120)
    , clr_sys_cd varchar2(4)
    , clr_acc_cd varchar2(6)
    , avgTRADES_VALUE_PRCP_CD_T number
    , mkt_avgTRADES_VALUE_PRCP_CD_T number
    , sumTRADES_VALUE_PRCP_CD_T number
    , mkt_sumTRADES_VALUE_PRCP_CD_T number
    , pct_sum_prcp_cd number
    and the table dll
    CREATE TABLE rs_mm_rsk_lmts_dtls
    (trd_dt DATE NOT NULL,
    prcp_cd VARCHAR2(10 BYTE) NOT NULL,
    clr_sys_cd CHAR(4 BYTE),
    clr_acc_cd CHAR(10 BYTE),
    sec_isin_cd VARCHAR2(12 BYTE) NOT NULL,
    buys NUMBER(19,0),
    sells NUMBER(19,0),
    buys_value NUMBER(19,6),
    sells_value NUMBER(19,6),
    abs_b_minus_s NUMBER(19,2),
    rsk_prc NUMBER(13,6),
    net_value NUMBER(19,2) NOT NULL,
    sr NUMBER(19,2) NOT NULL,
    mm NUMBER(19,2) NOT NULL,
    lst_cmpt_dt DATE,
    usr_id VARCHAR2(8 BYTE) NOT NULL,
    cmt VARCHAR2(64 BYTE),
    chg_dt DATE,
    gr_b NUMBER(19,2) NOT NULL,
    gr_s NUMBER(19,2) NOT NULL)
    Thank you
    Tonia

  • It is possible to execute a SQL query from OMBPlus?

    We have some simple SQL scripts we'd like to be able to incorporate into our existing TCL scripts, instead of having to run them outside of OMBPlus in sqlplus. Is is possible to run a SQL SELECT query from OMBPlus and/or TCL? And get a result set back to iterate through?
    Thanks,
    Jim C.

    You can execute SQLPlus from OMB or just get down and use JDBC to execute the SQL, see others posts on forum such as below;
    How to run SQL from OMB+
    Cheers
    David

  • Sql query not execute

    Hi Forum
    i made an application which run on JRun server.
    In many of my jsps i used sql query like this:
    " select id, name, rollno from student where add = 'jj';"
    and retrieve the record from resultset like this:
    rs.getString("id");
    rs.getString("name");
    rs.getString("rollno");
    I got no error.
    BUT WHEN I RETRIEVE THE RECORDS LIKE THIS
    rs.getString("name");
    rs.getString("id");
    rs.getString("rollno");
    i got the error:
    java.sql.SQLException: [Oracle][ODBC]Invalid column number <1>.
    I can not understand what is the problem ?
    all the datatypes are correct.
    all coding is correct.
    and everything is correct.
    pls help me & suggest a solution.
    is there any problem of jdbc API OR of JRUN SERVER SETTINGS?
    thanks
    mail me at [email protected]
    Arvind Goel

    I would advise against ever using SELECT * - the order of the columns is undetermined so you're bound to hit this problem sooner or later. Besides, it assumes the column names and you know what happens when you assume things...
    I would recommend retrieving only the columns you need, in the order you want them and to call ResultSet.getXXX for each of the columns, in order.

  • SQL Query Not working

    Hi All,
    Please help with the error ORA-00923: FROM keyword not found where expected.
    I am trying to execute the following SQL query.
    SELECT
    CASE
    WHEN (Grouping("PRICECATEGORY"."PriceCategoryName")=1) THEN "PriceCatTotal"
    ELSE "PRICECATEGORY"."PriceCategoryName"
    END AS "PRICECATEGORY"."PriceCategoryName",
    CASE
    WHEN (Grouping("LINEITEM"."LineDescription")=1) THEN "LineTotal"
    ELSE "LINEITEM"."LineDescription"
    END AS "LINEITEM"."LineDescription" ,
    *"INVOICE"."InvoiceDate",*
    Sum("TRANSACTION"."TotalPrice") as "TotalPrice",
    Sum("INVOICE_CHILD"."QUANTITY") as "Quantity"
    FROM "LINEITEM","INVOICE","TRANSACTION","PRICECATEGORY", "INVOICE_CHILD"
    WHERE "TRANSACTION"."InvoiceID"="INVOICE"."InvoiceNumber"
    and      "TRANSACTION"."PriceCategoryID"="PRICECATEGORY"."PriceCategoryID"
    and      "INVOICE_CHILD"."INVOICEID"="INVOICE"."InvoiceID"
    and      "PRICECATEGORY"."PriceCategoryID"="TRANSACTION"."PriceCategoryID"
    and      "TRANSACTION"."PriceCategoryID"="PRICECATEGORY"."PriceCategoryID"
    and      "PRICECATEGORY"."PriceCategoryID"="TRANSACTION"."PriceCategoryID"
    and      "LINEITEM"."LINEITEMID"="TRANSACTION"."LineItemID"
    and      "LINEITEM"."PRICECATEGORYID"="PRICECATEGORY"."PriceCategoryID"
    and     "INVOICE"."InvoiceDate" >= :STARTDATE and "INVOICE"."InvoiceDate" <= to_date(:ENDDATE,'DD-MON-YY')+1
    GROUP BY "PRICECATEGORY"."PriceCategoryName", "LINEITEM"."LineDescription" WITH ROLLUP
    I am using a from keyword at the right place and all the aliases are properly used.
    Please advice.
    Regards,
    Sandeep Reddy

    Jaydip and Jeff are correct:
    <li>Jaydip points out that <tt>"PRICECATEGORY"."PriceCategoryName"</tt> and <tt>"LINEITEM"."LineDescription"</tt> are not valid column alias names. They must be unqualified, nonquoted/quoted identifiers.
    <li>Jeff indicates that <tt>WITH ROLLUP</tt> is not Oracle SQL syntax, and provides a sample of the required ROLLUP/CUBE clauseOracle SQL <tt>ROLLUP/CUBE clause</tt>.
    Additionally, <tt>TRANSACTION</tt> is an Oracle keyword and therefore a poor choice as a database identifier: change the name of this table as soon as possible.
    You're having this problem because not all "SQL" is created equal. Your OdeToCode source appears to be a site dealing with Microsoft technologies (SQL Server in this case). Unless you are very familiar with Oracle and SQL Server and the inherent differences between them you'd be advised to stick to purely Oracle resources (I know I do). There are plenty of good Oracle resources out there.
    You'll also find it a lot easier to write, read and spot problems in SQL and PL/SQL code if you avoid using quoted identifiers (please tell us the database objects don't have case-sensitive names?) and use short table aliases rather than full table names. And we'll find it easier to help you on this forum if you post code samples wrapped in \...\wrapped in <tt>\...\</tt> tags.

  • URGENT (sql query not execute)

    Hi Forum
    i made an application which run on JRun server.
    In many of my jsps i used sql query like this:
    " select id, name, rollno from student where add = 'jj';"
    and retrieve the record from resultset like this:
    rs.getString("id");
    rs.getString("name");
    rs.getString("rollno");
    I got no error.
    BUT WHEN I RETRIEVE THE RECORDS LIKE THIS
    rs.getString("name");
    rs.getString("id");
    rs.getString("rollno");
    i got the error:
    java.sql.SQLException: [Oracle][ODBC]Invalid column number <1>.
    I can not understand what is the problem ?
    all the datatypes are correct.
    all coding is correct.
    and everything is correct.
    pls help me & suggest a solution.
    is there any problem of jdbc API OR of JRUN SERVER SETTINGS?
    thanks
    mail me at [email protected]
    Arvind Goel

    " select id, name, rollno from student where add =
    'jj';"
    BUT WHEN I RETRIEVE THE RECORDS LIKE THIS
    rs.getString("name");
    rs.getString("id");
    rs.getString("rollno");
    You are retrieving the fields in a different order than what is specified in the select statement.
    Some drivers don't allow that (I don't believe it matters what version of the driver you have.)

  • Sql query to find activities between Login and Logout time

    Hi ,
    I have 2 tables as shown below
    User Table
    ActivityTable
    i have  a requirement in which i need to find all the activities done for a particular user inbetween login and logout time  can anybody help me how to write sql query for this .

    Is this what you looking for?
    DECLARE @User TABLE
    userid INT,
    date DATETIME,
    type VARCHAR(50),
    sessionid SMALLINT
    DECLARE @ActivityTable TABLE
    activityid SMALLINT,
    userid SMALLINT,
    activity VARCHAR(50),
    activitystarttime DATETIME,
    activityendtime DATETIME
    INSERT INTO @User
    (userid,
    [date],
    [type],
    sessionid)
    VALUES (1,
    '2002-08-25 16:51:25.107',
    'Logon',
    111),
    (1,
    '2002-08-25 17:52:25.107',
    'LOGOFF',
    111),
    (2,
    '2007-03-08 19:25:21.170',
    'Logon',
    222),
    (2,
    '2007-03-08 21:25:21.170',
    'LOGOFF',
    222),
    (3,
    '2007-03-08 19:25:21.170',
    'Logon',
    234);
    INSERT INTO @ActivityTable
    (activityid,
    userid,
    activity,
    activitystarttime,
    activityendtime)
    VALUES (234,
    1,
    'development',
    '2002-08-25 16:53:23.101',
    '2002-08-25 16:59:23.170'),
    (789,
    2,
    'Testing',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (789,
    2,
    'Lunch',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (456,
    3,
    'Testing',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (781,
    1,
    'Lunch',
    '2002-08-25 17:00:23.101',
    '2002-08-25 17:30:00.170'),
    (781,
    1,
    'Lunch',
    '2002-08-25 21:00:23.101',
    '2002-08-25 22:30:00.170');
    WITH logon
    AS (SELECT date,
    userid
    FROM @User
    WHERE type = 'Logon'),
    logoff
    AS (SELECT date,
    userid
    FROM @User
    WHERE type = 'LOGOFF')
    SELECT at.*
    FROM @ActivityTable AT
    INNER JOIN logon Lo
    ON at.userid = lo.userid
    INNER JOIN logoff LF
    ON at.userid = lf.userid
    WHERE At.activityendtime < LF.date
    AND AT.activitystarttime > LO.date
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • SQL Query (Migrating report from SMS 2003 and SCCM 2012R2)

    Hello everyone,
    I solicit you because I have to work on migrating reports from SMS 2003 and SCCM 2012 R2.
    The following SQL query causes me some problems:
    SELECT DISTINCT SYS.Netbios_Name0 AS Computer, (SELECT SUM(ProcAddtl.NumberOfLogicalProcessors0) FROM v_GS_Processor_Addtl0 ProcAddtl WHERE ProcAddtl.ResourceID=SYS.ResourceID) [Cores], CS.NumberOfProcessors0 AS CPU, CPU.MaxClockSpeed0 As Speed, CPU.Name0, MEMORY.TotalPhysicalMemory0/1024 AS [RAM Mb], (SELECT LDISKS.Name0 + '=' + CONVERT(varchar(15), LDISKS.Size0/1024) + ' | ' as 'data()' FROM v_GS_LOGICAL_DISK LDISKS WHERE LDISKS.ResourceID=SYS.ResourceID AND (LDISKS.Name0='C:' OR LDISKS.Name0='D:') ORDER BY LDISKS.Name0 FOR xml path('')) [Logical Disk (Gb)], (SELECT LDISKS.Name0 + '=' + CONVERT(varchar(15), LDISKS.FreeSpace0/1024) + ' | ' as 'data()' FROM v_GS_LOGICAL_DISK LDISKS WHERE LDISKS.ResourceID=SYS.ResourceID AND (LDISKS.Name0='C:' OR LDISKS.Name0='D:') ORDER BY LDISKS.Name0 FOR xml path('')) [Free Space(Gb)],CS.Manufacturer0 AS Manufacturer, CS.Model0, OS.Caption0 AS 'OS', (SELECT CONVERT(varchar(10), NIC.Index0) + '=' + NIC.IPAddress0 + ' | ' as 'data()' FROM v_GS_NETWORK_ADAPTER_CONFIGUR NIC WHERE NIC.ResourceID=SYS.ResourceID FOR xml path('')) [Network], (SELECT Count(Name0) FROM v_GS_SCSI_CONTROLLER SCSI WHERE SCSI.ResourceID=SYS.ResourceID AND SCSI.Name0 Like '%Qlogic%') [# FC HBA], INFONOYAU.RoleServeur0 AS Role, INFONOYAU.Zone0 AS Zone
    FROM v_R_System SYS
    LEFT JOIN v_GS_COMPUTER_SYSTEM CS ON CS.ResourceID = SYS.ResourceID
    LEFT JOIN v_GS_PROCESSOR CPU ON CPU.ResourceID = SYS.ResourceID
    LEFT JOIN v_GS_X86_PC_MEMORY MEMORY ON MEMORY.ResourceID = SYS.ResourceID
    LEFT JOIN v_GS_OPERATING_SYSTEM OS ON OS.ResourceID = SYS.ResourceID
    LEFT JOIN v_GS_Informations_Noyau0 INFONOYAU ON INFONOYAU.ResourceID = SYS.ResourceID
    LEFT JOIN v_FullCollectionMembership COL ON COL.ResourceID = SYS.ResourceID
    WHERE COL.CollectionID = @CollectionID ORDER BY SYS.Netbios_Name0
    Can a charitable soul help me to migrate this query to a SCCM 2012R2 report?

    The following SQL query causes me some problems:
    Why? What's happening?
    Torsten Meringer | http://www.mssccmfaq.de

  • Inline transform for Sql Query not working in SAP MII 12.1 Version 12.1.8 B

    Hi All,
    I applied an xslt for an sql query which returns an xml file.
    I used inline transform icon in sql query to load an xsl file which has to return me a string
    Any idea why is not working for me..?
    My Sample XML file:
                                     <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="/XMII/CM/BatchDisposition/BatchQueueManagement/StyleSheets/ProductXsl.xsl"?>
    <Rowsets DateCreated="2011-05-05T07:27:45" EndDate="2011-05-05T07:27:45" StartDate="2011-05-05T06:27:45" Version="12.1.8 Build(20)">
         <Rowset>
              <Columns>
                   <Column Description="ProductName" MaxRange="1" MinRange="0" Name="ProductName" SQLDataType="12" SourceColumn="ProductName"/>
              </Columns>
              <Row>
                   <ProductName>Asprin 100mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row>
                   <ProductName>Asprin 300mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row><ProductName>Ibprooven 200mg Tablets 12 x 10 strip</ProductName></Row>
              <Row><ProductName>RipTide 50mg Tablets 40 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 200mg Tablets 6 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 400mg Tablets 12 x10 strip</ProductName></Row>
         </Rowset>
    </Rowsets>
    My Sample XSl File:
                                    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <xsl:text>["</xsl:text>
         <xsl:for-each select="Rowsets/Rowset/Row">
              <xsl:value-of select="ProductName"/>
              <xsl:if test="position() &lt; last()">
                   <xsl:text>","</xsl:text>
                    </xsl:if>
              <xsl:if test="position()=last()">
                           <xsl:text>"]</xsl:text>
                    </xsl:if>
         </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Any Suggestions  are Welcome:
    Thanks

    Something like this should work...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
                   <xsl:copy-of select="/Rowsets/FatalError"/>
                   <xsl:copy-of select="/Rowsets/Messages"/>
                   <Rowset>
                   <Columns>
                        <Column Description="Mycol1" MaxRange="1" MinRange="0" Name="Mycol1" SQLDataType="12" SourceColumn="Mycol1" />
                   </Columns>
                   <Row>
                   <Mycol1>
                   <xsl:text>["</xsl:text>
                        <xsl:for-each select="/Rowsets/Rowset/Row">
                             <xsl:value-of select="." />
                             <xsl:choose>
                                  <xsl:when test="position() &lt; last()"><xsl:text>","</xsl:text></xsl:when>
                                  <xsl:otherwise><xsl:text>"]</xsl:text></xsl:otherwise>
                             </xsl:choose>
                        </xsl:for-each>
                   </Mycol1>
                   </Row>
                   </Rowset>
              </Rowsets>
         </xsl:template>
    </xsl:stylesheet>

  • Executing sql query(not through sqlfile) from batchfile

    Hi,
    I have written a batchfile below which should execute the sql query. Can someone please help me in modifying the below code. I know we can make use of sql file ,but wanted it to be more robust and hence everything in a single batch file instead of having combination of sqlfile and batchfile.
    @echo off
    set ORACLE_HOME=%RAMBOH%
    set ORACLE_SID=%RAMBSID%
    set path=%RAMBOH%\bin;%RAMBOH%\admin\Ramb_Scripts;%path%
    sqlplus sys/XXX as sysdba
    @echo SET SERVEROUTPUT ON;
    @echo DECLARE
    @echo     v1   DATE;
    @echo BEGIN
    @echo     SELECT SYSDATE INTO V1 FROM DUAL;
    @echo     DBMS_OUTPUT.PUT_LINE(v1);
    @echo END;
    @echo /

    I used the below syntax to execute a procedure
    set ORACLE_SID=orcl
    echo exec MyProcedure;
    echo exit
    )|sqlplus system/manager >MyProcedure.log
    Try making modifications to this and see if this helps you in executing the SQL from the batch file

Maybe you are looking for

  • My ipod touch 4th gen skips certain songs in my playlists.

    I have all the most recent software updates and I've looked this up in the support section.  It talked about this problem being related to music imported from CDs, but I'm having this problem with music downloaded form itunes.

  • How do I tell if a File is ANSI, unicode or UTF8?

    I have a jumble of file types - they should all be the same, but they are not. How do I tell which type a file has been saved in? (and how do I tell a file to save in a certain type?)

  • Problems with special characters like "u00F6" "u00E4" "u00FC"

    Hi, we currently face some major problems with special characters like "ö" "ä" "ü". First I thought it is a SP02 specific problem but it still doesn't work with SP03. When I start an import the import manager shows correct converted value. "ö"s "ä"s

  • How to play all?

    I'm trying to make a dvd with two movies and I was wondering how would I be able to make the dvd play all the contents at once rather than going back to the main menu after every movie.

  • Program for SAPScript

    Hi, I created a SAPscript for purchase order not using Medruck a customized one. And print program which has two entry fields for EBELN, EBELP, in which the output will be a single record, but now I need something like a purchase order can have many