Help asked for a sql request - thanks

Hello,
I'm not a sql Guru... Who can help for this sql request ?
First I have this:
SELECT ADDINFO_ID, INFO, LANGUAGE_FK, ENGLISH_NAME
FROM V_ADDINFOS
WHERE LANGUAGE_FK = 'EN' (which is very simple...-)
But now complicated... I have to add this in the same request:
select sum(val) as nbrInfo
from(
select count(*) val from eccgis where addinfo1_fk = ADDINFO_ID
union all
select count(*) val from eccgis where addinfo2_fk = ADDINFO_ID
union all
select count(*) val from eccgis where addinfo3_fk = ADDINFO_ID
union all
select count(*) val from thirdgis where addinfo1_fk = ADDINFO_ID
union all
select count(*) val from thirdgis where addinfo2_fk = ADDINFO_ID
In other words, for each row of the first select, I need to know how much it is linked in the tables eccgis and thirdgis...
Hope is is clear... -)
Thank you very very much,
Michel

Hi, Michel,
Almost anywhere that SQL allows an expression (such as a column name, literal or function call) it also allows a scalar sub-query, a SELECT statement based on any table (or tables) that returns one column and (at most) one row. Like other sub-queries, scalar sub-queries can be corellated to the main query.
To get the grand total you want on each row of your output:
SELECT ADDINFO_ID, INFO, LANGUAGE_FK, ENGLISH_NAME
, (select count(*) from eccgis where addinfo1_fk = ADDINFO_ID)
+ (select count(*) from eccgis where addinfo2_fk = ADDINFO_ID)
+ (select count(*) from eccgis where addinfo3_fk = ADDINFO_ID)
+ (select count(*) from thirdgis where addinfo1_fk = ADDINFO_ID)
+ (select count(*) from thirdgis where addinfo2_fk = ADDINFO_ID)
AS nrbInfo
FROM V_ADDINFOS
WHERE LANGUAGE_FK = 'EN';VERY IMPORTANT: Each sub-query must be in parentheses. You'll get a run-time error if any scalar sub-query returns more than one row. (Returning no rows is okay: the value will be NULL).
By the way, this looks like a bad table design. If each row in eccgis or thirdgis can be associated with more than one foreign key, they should be kept in a separate table. That's the standard way to handle many-to-many relationships.

Similar Messages

  • System ask for a transport request while maintain IT0002

    I'm getting strange message while maintaining IT0002 i.e system ask for a transport request. But while maintaining IT0008 or IT0009 etc it's not asking transport request. So while Diagnosis it is giving
    Active integration to Organizational Management means that when a link to Organizational Management is created, it is saved automatically.
    When saving organizational data, the data must be written to a transport request because, for example, the automatic transport recording is active. Without a correction request, the relevant changes in Organizational Management cannot be saved.

    Check the Tcode OOCR how the swich is active or not
    later check with ur basis Guy once

  • How do I move files from my iMac to my Airport without getting 'AirPort can not be modified' message. File sharing is enabled and I'm not getting asked for a password. Thanks

    How do I move files from my iMac to my Airport without getting 'AirPort can not be modified' message. File sharing is enabled and I'm not getting asked for a password. Thanks

    What OS are you running.. this is usually only a problem in Mavericks.
    If so I recommend you mount the hard disk manually..
    Use Go, Connect to server.
    Type in the IP address if static.. eg
    AFP://10.0.1.1
    Or the name.. but you will have issues unless the name is short, no spaces and pure alphanumeric.. if you are using bad names.. fix it by a full factory reset in airport utility and give it all names that comply to the above.
    Type in
    AFP://TCname.local Where TCname is replaced with the actual name.
    You will be asked for the password the first time which is public unless you changed it.. please remember to save this in the keychain.
    Copy files then to a new directory you create on the TC.. do not place files inside the TM sparsebundle. Nor directly under the main directory.

  • Help need  for  PL/SQL  collections

    Hi All,
    Please help me to solve the following Error.
    Error # ORA-06533: Subscript beyond count.
    I am using Oracle 10g.
    I have data in the Test_table
    id_col stat_col reason_col
    101 A          HPQ
    101 A NULL
    101 NULL EDU
    101 P NULL
    102 P NULL
    102 NULL HEN
    103 R NULL
    103 Q NULL
    Ny requirement is like:
    id_col stat_col_ reason_col
    101 A|P HPQ|EDU
    102 P HEN
    103 R|Q NULL
    step1- Type tab_type as table of varchar2(32767);
    step2 - I have written a function which returns the pl/sql table type
    create or replace function fn_get_val(id in VARCHAR2)
    return tab_type
    cursor my_cur is
    select id_col,stat_col,reason_col
    from test_table WHERE ID_COL = ID;
    lv_status VARCHAR2(100);
    LV_reason varchar2(200);
    lv_sep CHAR(1);
    lv_disp_stat varchar2(200);
    lv_disp_reason varchar2(200);
    LN_STR NUMBER;
    BEGIN
    lv_tab_data:= tab_type();
    lv_tab_data.extend;
    open my_cur;
    loop
    fetch my_cur into lv_status,lv_reason;
    exit when my_cur%notfound;
    --dbms_output.put_line('my_curr.rowcount'|| my_curr.rowcount);
    lv_disp_stat:= lv_disp_stat||lv_sep||lv_status;
    lv_disp_reason:= lv_disp_reason||lv_sep||lv_reason;
    lv_sep:= '|';
    end loop;
    -- To remove first occurance of (|) pipeline in the string.
    LN_STR := INSTR(lv_str1,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_stat := SUBSTR(lv_disp_stat ,2 );
    END IF;
    LN_STR := INSTR(lv_str2,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_reason := SUBSTR(lv_disp_reason ,2 );
    END IF;
    lv_tab_data(1) := lv_disp_stat;
    lv_tab_data.extend;
    lv_tab_data(2) := lv_disp_reason;
    return lv_tab_data;
    EXCEPTION
    DBMS_OUTPUT.PUT_LINE('Error in function fn_get_val # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END fn_get_val;
    STEP-3
    I have created one procedure where the above function is called
    CREATE OR REPLACE PROCEDURE my_proc (p_emp_id in Varchar2)
    AS
    lv_tab_ty tab_type;
    CURSOR DET_CUR IS
    SELECT EMP_ID_C,NAME_C,LOCATION
    FROM DETAILS_TABLE
    WHERE EMP_ID_C = p_emp_id;
    type det_tab_ty is table of det_cur%type index by pls_integer;
    lv_det_rec det_tab_ty;
    BEGIN
         lv_tab_ty := fn_get_val(p_emp_id);
         dbms_output.put_line('lv_tab_ty.count is : '||lv_tab_ty.count);
         OPEN DET_CUR;
         LOOP
         FETCH DET_CUR BULK COLLECT INTO lv_det_rec;
         EXIT WHEN DET_CUR%NOTFOUND;
         END LOOP;
         CLOSE DET_CUR;
         IF lv_det_rec.COUNT > 0 THEN
         FOR i IN lv_det_rec.FIRST .. lv_det_rec.LAST
         LOOP
         INSERT INTO other_tab (emp_id_c,name_c,Loc_c,status_c,reason_c) values(lv_det_rec(i).emp_id_c,lv_det_rec(i).NAME_C,lv_det_rec(i).LOCATION,lv_tab_ty(1),lv_tab_ty(2) );
         END LOOP;
         END IF;
    COMMIT;
    EXCEPTIONS
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error in procedure my_proc # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END my_proc ;
    After exucting the above procedure i am getting the following error.
    lv_tab_ty.count is : 1
    Error # ORA-06533: Subscript beyond count.
    This error is occured when my_curr.rowcount is equal to 0 (cursor defined in the function fn_get_val() ).
    The function fn_get_val() does return null to the pl/sql table variable (lv_tab_ty).
    AND another schenario:
    If
    lv_tab_data.count = 1
    Then how can i handle this situation in the above procedure,because i need both
    lv_tab_data(1)
    and lv_tab_data(2)
    to insert to the OTHER_TABLE in the procedure.
    Please help me to solve this issue.
    Thanks in Advance!!!
    PKM

    You can do it with one query with Tom Kyte's stragg function:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3431223221768118::::P11_QUESTION_ID:15637744429336
    with test_table(id_col,stat_col,reason_col) as (
    select 101,'A','PQ' from dual union all
    select 101,'A',NULL from dual union all
    select 101,NULL,'EDU' from dual union all
    select 101,'P',NULL from dual union all
    select 102,'P',NULL from dual union all
    select 102,NULL,'HEN' from dual union all
    select 103,'R',NULL from dual union all
    select 103,'Q',NULL from dual
    select id_col,replace(stragg(stat_col),',','|'),replace(stragg(reason_col),',','|')
    from test_table tt
    group by id_colRegards,
    Sayan M.

  • Help needed for SCCM SQL query

    Hello.
    I have the below query to extract the workstations build date as well as the hardware info. This works fine. 
    Select distinct
    v_R_System.Name0,
    v_GS_COMPUTER_SYSTEM.Manufacturer0,
    v_GS_COMPUTER_SYSTEM.Model0,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
    v_GS_OPERATING_SYSTEM.Caption0,
    v_GS_OPERATING_SYSTEM.CSDVersion0,
    v_GS_OPERATING_SYSTEM.InstallDate0
    From v_R_System
    LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM ON v_GS_COMPUTER_SYSTEM.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_SYSTEM_CONSOLE_USAGE ON v_R_System.ResourceID=v_GS_SYSTEM_CONSOLE_USAGE.ResourceID
    Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' and v_R_System.Is_Virtual_Machine0 =0
    order by v_GS_OPERATING_SYSTEM.InstallDate0 desc
    Now, I want a report of count of machines built based on "v_GS_COMPUTER_SYSTEM_PRODUCT.Version0" against every month and year of "v_GS_OPERATING_SYSTEM.InstallDate0".
    For example, I want to know the number of machines under a particular model (which appears under  v_GS_COMPUTER_SYSTEM_PRODUCT.Version0) built in June 2014. In this fashion I want a report for every model count for every month and year available under
    InstallDate0 column)
    Example:
    Jan 2013 ->  ThinkCentre M92p -> 55
    Jan 2013 ->  ThinkCentre M93 -> 40
    Feb 2013 ->  ThinkCentre M92p -> 10
    Feb 2013 ->  ThinkCentre M93 -> 39
    Jan 2014 ->  ThinkCentre M92p -> 20
    Jan 2014 ->  ThinkCentre M93 -> 25
    Feb 2014 ->  ThinkCentre M92p -> 12
    Feb 2014 ->  ThinkCentre M93 -> 35
    Can anyone help?

    After scratching my head a bit, I came up with the below. Do you find any flaw in it?
    Select
    v_GS_COMPUTER_SYSTEM.Manufacturer0 as Manufacturer,
    v_GS_COMPUTER_SYSTEM.Model0 as Model,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 as "Model Info",
    COUNT(*) as "No. of machines built",
    CASE WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '1' THEN 'January'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '2' THEN 'February'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '3' THEN 'March'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '4' THEN 'April'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '5' THEN 'May'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '6' THEN 'June'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '7' THEN 'July'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '8' THEN 'August'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '9' THEN 'September'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '10' THEN 'October'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '11' THEN 'November'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '12' THEN 'December'END as "Month",
    YEAR(v_GS_OPERATING_SYSTEM.InstallDate0) as "Year"
    From v_GS_COMPUTER_SYSTEM
    LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
    Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' Group By v_GS_COMPUTER_SYSTEM.Manufacturer0,
    v_GS_COMPUTER_SYSTEM.Model0,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
    Month(v_GS_OPERATING_SYSTEM.InstallDate0),
    YEAR(v_GS_OPERATING_SYSTEM.InstallDate0)
    Order by v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 desc

  • Help required for update SQL

    Hi Guys,
    I am looking for some help to frame the update query.
    I have two tables temp_1 and temp_2.
    I want to update temp_2 based on data from temp_1. However i do not want to make an update where temp_1 has null value.
    One approach i can think of is creating two different update statements but is there any chance to get it done through
    only one statement. Also i would like to add here that temP_1 has 250K data and i going to make update on approx 500K
    rows from temp_2. So i need to look from performance point of view as well.
    Temp_1                       temp_2
    Col1   Col2  Col3        col1     col2    col3
    1 abc   abc                  1        null    null
    2 abc   null                  2         xyz     xyz
    3 null  null                   3          xyz     null
    After update i am looking forward to get data in below format.
    temp_2
    col1     col2    col3
    1        abc     abc
    2        abc     xyz
    3        xyz     null  

    USE TESTdb
    go
    create table express (col1 int, col2 varchar(25), col3 varchar(25))
    go
    create table express2 (col1 int, col2 varchar(25), col3 varchar(25))
    go
    insert into express values (1,'abc','abc'),(2,'abc',null),(3,null,null)
    insert into express2 values (1,null,null),(2,'xyz','xyz'),(3,'xyz',null)
    select * from express
    select * from express2
    update express2
    set col2= case when x.col2 is null and e.col2 is not null then e.col2
    else x.col2
    end ,
    col3= case when x.col3 is null and e.col3 is not null then e.col3
    else x.col3
    end
    from express e inner join express2 x on e.col1=x.col1
    --drop table express, express2
    ebro

  • HT201269 i have a problem of my iphone5 it usually restarting itself and 1 time i saw it in a blue screen death then it restarted itself.what can i do, please help me for this problem..thank you

    please hep me for my problem..it usually restarting itself and i saw it a blu screen death..pls any suggestion..thank you....

    Jailbroken?  Dropped?  Got wet?
    What troubleshooting steps did you already try?  Restore the iOS?

  • Help need for PL/SQL procedure

    Hi guys,
    I have scenario like this
    Schema     T     LOGTABLENAME          TDIRECTORY
    DEV          DEV.ABC_LOG                    import-abc
    DEV          DEV.GBTSLOG          import-gbts
    DEV          DEV.CLSSBOG     import-cls
    QA          QA.TransactionlOG          import-transaction
    QA1 QA1.tlog import-ess
    QA2 QA2.translog import-trnals
    I have to write a procedure to get the log table data from schema Dev.I have to take Shcema dev and go to DEv.abc_log table and get the record from the dev.abc_logtable. The same way for other schema also with respective logtables .
    I would appreciate your help or suggestions.
    Reards,
    User
    Edited by: user1758353 on Dec 5, 2008 11:43 AM

    hello,
    im also not sure if i get the point but maybe you need sth. like that...
    create table schema_logtable as
    select 'dev' schema, 'dev.abc_log' tlogtable, 'import-abc' tdirectory from dual union all
    select 'dev', 'dev.gbtslog', 'import-gpts' from dual union all
    select 'dev', 'dev.clssbog', 'import-cls' from dual );
    declare
       v_slt_row schema_logtable%rowtype;
       type log_description_table is table of varchar2(1000char);
       v_log_description log_description_table := log_description_table();
    begin
       for v_slt_row in ( select * from schema_logtable )
       loop
          execute immediate 'select log_description from ' || v_slt_row.tlogtable bulk collect into v_log_description;
          for i in v_log_description.first .. v_log_description.last
          loop
             dbms_output.put_Line( 'log_desc: ' || v_log_description(i) );
          end loop;
       end loop;
    end;
    /this reads for every schema in table schema_logtable the name of the logtable.
    for each logtable you fetch all rows of that table into a variable and you can do what-ever you want with that...
    -mario

  • Please help me for the Sql Loader???

    Hi,
    I have a control file in c:\txt_to_DB_EDI.ctl
    insight that it is written that
    LOAD DATA
    INFILE 'D:\WING FAT\EDI_Sample.TXT'
    APPEND INTO TABLE TEMP_DATA_WINGFAT
    fields terminated by ' '
    TRAILING NULLCOLS
    (COMANY_CODE,SENDER_CODE,SENDER_TYPE,SUPPLIER_CODE,BYER_CODE,PO_NO,QC_DATE,INSPECTED_BY,
    CARGO_DELV_DATE,STYLE,COLOUR,,CAR_SIZE,ORDER_QTY_PCS,SHPPED_QTY_PCS,TOTAL_CARTON,GOODS_DESC,
    TAR_MODE,FILE_CREATION_TIME,FILE_NAME)
    actually I have a table that has the following fields
    CREATE TABLE TEMP_DATA_WINGFAT
    COMANY_CODE VARCHAR2(100),
    SENDER_CODE VARCHAR2(100),
    SENDER_TYPE VARCHAR2(100),
    SUPPLIER_CODE VARCHAR2(100),
    BYER_CODE VARCHAR2(100),
    PO_NO VARCHAR2(100),
    QC_DATE VARCHAR2(100),
    INSPECTED_BY VARCHAR2(100),
    CARGO_DELV_DATE VARCHAR2(100),
    STYLE VARCHAR2(100),
    COLOUR VARCHAR2(100),
    CAR_SIZE VARCHAR2(100),
    ORDER_QTY_PCS VARCHAR2(100),
    SHPPED_QTY_PCS VARCHAR2(100),
    TOTAL_CARTON VARCHAR2(100),
    GOODS_DESC VARCHAR2(100),
    TAR_MODE VARCHAR2(100),
    FILE_CREATION_TIME VARCHAR2(100),
    FILE_NAME VARCHAR2(100)
    I need to insert all data in the text file to the database.
    The contains of the text file is just like the below
    05 11 L 16 84 77538-445-12-106-102 20040907 SANJOY 20040820 1606 1606 Sea 20040907 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-112-001 20040907 SANJOY 20040905 4116 4116 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-111-001 20040907 SANJOY 20040905 4800 4800 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-110-001 20040907 SANJOY 20040905 4116 4116 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-109-001 20040907 SANJOY 20040905 4800 4800 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-209-001 20040907 SANJOY 20040901 4356 4356 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-209-102 20040907 SANJOY 20040901 4979 4979 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-214-001 20040907 SANJOY 20040901 1452 1452 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-214-102 20040907 SANJOY 20040901 670 670 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 16 84 77538-346-01-203-001 20040907 SANJOY 20040915 1210 1210 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-669-61-204-001 20040907 SANJOY 20040901 8220 8220 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-669-61-203-001 20040907 SANJOY 20040901 6000 6000 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-750-60-116-001 20040907 SANJOY 20040901 12240 12240 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-130-001 20040907 SANJOY 20040901 3200 3200 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-133-001 20040907 SANJOY 20040901 2000 2000 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-132-001 20040907 SANJOY 20040901 3200 3200 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-131-001 20040907 SANJOY 20040901 2000 2000 Sea 20040908 12:09 QC_EDI_1.TXT
    Askings are :
    1. Please check the control file text.
    2. then Please say how do I run this control file. Please write the code to run in the sql prompt.
    Please treat this at an urgent basis.
    FARHAD

    The cmd is: sqlldr aa/bb@cc control=c:\txt_to_DB_EDI.ctl, before that you need to make sure sqlldr is available.
    you may run it on server command line, sure you in your user's profile set the $SQLLDRCMD to the sqlldr executable.

  • Ask for a sql sentence(procedure) for copy data to themselves' table

    two tables
    order and orderitem,there are relationship table;
    order's id is PK
    orderitem's id is PK,and parentId is FK.
    and all id are created by sequences:order_id_seq and orderitem_id_seq.
    order
    id name
    1 aaa
    2 bbb
    orderitem
    id parentId num
    1 1 100
    2 1 150
    3 2 200
    4 2 300
    now I want to copy these data to themselves table.how to code the sql or the procedure??the main problem i encoutered is how to update the parentId of the orderitem table?
    Message was edited by:
    user577067
    Message was edited by:
    user577067

    now i want to copy order table's data to order,and copy data of orderitem table to orderitem.and after that the table data should be
    order
    id name
    1 aaa
    2 bbb
    3 aaa
    4 bbb
    orderitem
    id parentId num
    1 1 100
    2 1 150
    3 2 200
    4 2 300
    5 3 100
    6 3 150
    7 4 200
    8 4 300
    Message was edited by:
    user577067

  • Where is apple support for iCloud.  All online help asks for hardware number.  iCloud does NOT have a hardwdare number

    Are there live people to help with iCloud?  Or is Apple too cheap to have phone support or iClouds after taking your money on a product that does not do as promised: play music you put on the cloud should be accessed across several devices.  Nada on iPhone, nada on brand new PC with Windows 7.  Nada to any Apple support unless I pay more money.
    Used to buy exclusive Apple products.  Won't any more and I know why lots of others won't now.  Expensive and difficult to get real, live help once money is spend.  Before you put down money, Apple is ALL sales:  we'll help you, there is lots of Apple Support, we have Geniuses that will teach you, blah, blah, blah.

    Agreed... we can only hope that they're using happily pounding away numbers on that on-screen keyboard

  • Help to tun this sql please thanks

    SELECT ORG.NAME ORGNAME,ORG.ORGANIZATIONUNITID
    ,ACC.NAME ACCNAME,ACC.ACCOUNTID
    ,INVOICEDEF.BILLDAY
    ,CSM.FIRSTNAME||' '||CSM.LASTNAME CSMNAME,SALES.FIRSTNAME||' '||SALES.LASTNAME SALESNAME
    ,SUM(MRC.BOOKINGVALUE) MRCVALUE ,SUM(PORTS.BOOKINGVALUE) PORTSVALUE,'' EXPDAYS
    FROM BLIS_ORGANIZATIONUNIT ORG
    ,BLIS_ACCOUNT ACC
    ,BLIS_CUSTOMER CUS
    ,BLIS_SERVICESNAPSHOT SNAPSHOT
    ,BLIS_ORDERBOOKING MRC
    ,BLIS_ORDERBOOKING PORTS
    ,BLIS_INVOICEDEFINITION INVOICEDEF
    ,BLIS_PORTFOLIOSNAPSHOTREF PORREF
    ,BLIS_AGENT CSM
    ,BLIS_AGENTASSIGNMENT CSMASSIGN
    ,BLIS_AGENT SALES
    ,BLIS_AGENTASSIGNMENT SALESASSIGN
    WHERE
    ORG.ULTIMATEPARENTID =130169
    OR ORG.ORGANIZATIONUNITID IN
    (SELECT ORGANIZATIONUNITID FROM BLIS_ORGANIZATIONUNIT start with ORGANIZATIONUNITID=130169 connect by PARENTID=Prior ORGANIZATIONUNITID)
    AND CUS.ORGANIZATIONUNITID = ORG.ORGANIZATIONUNITID
    AND ACC.CUSTOMERID = CUS.CUSTOMERID
    AND ACC.SERVICEPORTFOLIOID = PORREF.SERVICEPORTFOLIOID(+)
    AND PORREF.SERVICESNAPSHOTID = SNAPSHOT.SERVICESNAPSHOTID(+)
    AND INVOICEDEF.ACCOUNTID(+) = ACC.ACCOUNTID
    AND INVOICEDEF.ISDEFAULT(+) = 1
    AND MRC.ORDERSERVICEID(+) = SNAPSHOT.ORDERSERVICEID
    AND MRC.BOOKINGTYPEID(+) = 115
    AND PORTS.ORDERSERVICEID(+) = SNAPSHOT.ORDERSERVICEID
    AND PORTS.BOOKINGTYPEID(+) = 117
    AND CSMASSIGN.ENTITYID(+)=3
    AND CSMASSIGN.ASSIGNMENTTYPEID(+)=2
    AND CSMASSIGN.STATUS(+) = 'Active'
    AND CSMASSIGN.AGENTID = CSM.AGENTID(+)
    AND CSMASSIGN.KEYID(+) = ACC.ACCOUNTID
    AND SALESASSIGN.ENTITYID=3
    AND SALESASSIGN.ASSIGNMENTTYPEID=1
    AND SALESASSIGN.STATUS = 'Active'
    AND SALESASSIGN.AGENTID = SALES.AGENTID
    AND SALESASSIGN.KEYID = ACC.ACCOUNTID
    GROUP BY INVOICEDEF.BILLDAY
    ,ACC.NAME, ACC.ACCOUNTID
    ,ORG.NAME,ORG.ORGANIZATIONUNITID
    ,CSM.FIRSTNAME,CSM.LASTNAME,SALES.FIRSTNAME,SALES.LASTNAME
    ORDER BY ORG.NAME, ACC.ACCOUNTID
    1 row selected.
    Elapsed: 00:01:49.16

    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 18618 | 4090K| 54266 |
    | 1 | SORT GROUP BY | | 18618 | 4090K| 54266 |
    | 2 | FILTER | | | | |
    | 3 | HASH JOIN | | 372K| 79M| 36070 |
    | 4 | VIEW | index$_join$_011 | 4219 | 84380 | 8 |
    | 5 | HASH JOIN | | | | |
    | 6 | HASH JOIN | | | | |
    | 7 | INDEX FAST FULL SCAN | XPKBLIS_AGENT | 4219 | 84380 | 2 |
    | 8 | INDEX FAST FULL SCAN | INXBLIS_AGENT_1 | 4219 | 84380 | 2 |
    | 9 | INDEX FAST FULL SCAN | INXBLIS_AGENT_2 | 4219 | 84380 | 2 |
    | 10 | HASH JOIN RIGHT OUTER | | 372K| 72M| 36057 |
    | 11 | VIEW | index$_join$_009 | 4219 | 84380 | 8 |
    | 12 | HASH JOIN | | | | |
    | 13 | HASH JOIN | | | | |
    | 14 | INDEX FAST FULL SCAN | XPKBLIS_AGENT | 4219 | 84380 | 2 |
    | 15 | INDEX FAST FULL SCAN | INXBLIS_AGENT_1 | 4219 | 84380 | 2 |
    | 16 | INDEX FAST FULL SCAN | INXBLIS_AGENT_2 | 4219 | 84380 | 2 |
    | 17 | HASH JOIN | | 372K| 65M| 36045 |
    | 18 | INDEX FULL SCAN | INXBLIS_AGENTASSIGNMENT_4 | 345K| 8446K| 6444 |
    | 19 | HASH JOIN RIGHT OUTER | | 210K| 32M| 27268 |
    | 20 | TABLE ACCESS BY INDEX ROWID | BLIS_ORDERBOOKING | 339K| 3974K| 15334 |
    | 21 | INDEX RANGE SCAN | INXBLIS_ORDERBOOKING_3 | 339K| | 105 |
    | 22 | HASH JOIN RIGHT OUTER | | 169K| 23M| 10252 |
    | 23 | TABLE ACCESS BY INDEX ROWID | BLIS_ORDERBOOKING | 22612 | 264K| 1023 |
    | 24 | INDEX RANGE SCAN | INXBLIS_ORDERBOOKING_3 | 22612 | | 7 |
    | 25 | HASH JOIN RIGHT OUTER | | 169K| 22M| 9227 |
    | 26 | TABLE ACCESS FULL | BLIS_SERVICESNAPSHOT | 228K| 2234K| 1196 |
    | 27 | HASH JOIN RIGHT OUTER | | 169K| 20M| 6675 |
    | 28 | TABLE ACCESS FULL | BLIS_PORTFOLIOSNAPSHOTREF | 278K| 2718K| 269 |
    | 29 | HASH JOIN RIGHT OUTER | | 165K| 18M| 5103 |
    | 30 | TABLE ACCESS FULL | BLIS_INVOICEDEFINITION | 156K| 1681K| 664 |
    | 31 | HASH JOIN RIGHT OUTER | | 165K| 16M| 3343 |
    | 32 | INDEX SKIP SCAN | INXBLIS_AGENTASSIGNMENT_4 | 16010 | 390K| 534 |
    | 33 | HASH JOIN | | 165K| 12M| 2807 |
    | 34 | MERGE JOIN | | 143K| 5873K| 1334 |
    | 35 | TABLE ACCESS BY INDEX ROWID| BLIS_ORGANIZATIONUNIT | 143K| 4475K| 481 |
    | 36 | INDEX FULL SCAN | XPKBLIS_ORGANIZATIONUNIT | 143K| | 30 |
    | 37 | SORT JOIN | | 143K| 1398K| 852 |
    | 38 | TABLE ACCESS FULL | BLIS_CUSTOMER | 143K| 1398K| 267 |
    | 39 | TABLE ACCESS FULL | BLIS_ACCOUNT | 156K| 5801K| 730 |
    | 40 | FILTER | | | | |
    | 41 | CONNECT BY WITH FILTERING | | | | |
    | 42 | TABLE ACCESS BY INDEX ROWID | BLIS_ORGANIZATIONUNIT | 1 | 17 | 1 |
    | 43 | INDEX UNIQUE SCAN | XPKBLIS_ORGANIZATIONUNIT | 1 | | 1 |
    | 44 | NESTED LOOPS | | | | |
    | 45 | CONNECT BY PUMP | | | | |
    | 46 | TABLE ACCESS BY INDEX ROWID | BLIS_ORGANIZATIONUNIT | 314 | 2198 | 1 |
    | 47 | INDEX RANGE SCAN | INXBLIS_ORGANIZATIONUNIT_1 | 1 | | 1 |
    -------------------------------------------------------------------------------------------------------

  • Customer table with delivery class 'A' asking for a request

    Hello.
    I've built an customer table and defined the delivery class 'A' ... Application table (master and transaction data).
    Data Browser/Table View Maint. 'X' ... Display/Maintenance Allowed.
    Why is this type of table definition asking for a change request to store table entries?
    Please, provide some help.
    Mário Semedo

    Thanks ... how did i let it pass?
    Thanks alot!

  • Asking for transport request while table data updation

    Hi All,
    I am trying to update a table TCJ04 using transaction OPS6. When ever I am adding a new entry or edit the existing entry and click SAVE, the table is asking for Transport request number.
    This table carries a master data and should not be asking for transport request. Rather its access has to be controlled by user authorisation.
    Please tell me as to what is the reason of asking for transport request.
    regards,
    Gaurav.

    Hi There,
    It is asking for the transport request for each new entry in the table since the Delivery class in the attributes is set to C( Customizing table, maintenance only by cust., not SAP import ), If it is set to "A" it will not ask for the transport request..
    Try creating a custom table and play around with the Delivery class, A and C, you will come to know the difference.
    Let me know if you need further help in this regard.
    don't 4get to rward pionts if found helpful.
    Thanks-

  • Customizing tables not asking for Customizing Request while saving data

    Hi,
    I have some customizing tables in my development server (Delivery Class = 'C').
    These always used to ask for a Customizing Request whenever data was saved in them.
    Suddenly, I have noticed they are no more asking for any Customizing Request. I cross-checked in the Transport Organizer and confirmed that there are no customizing requests of mine which may be already holding any data entries of these tables.
    I wonder why this may be happening (believe it to be some basis configuration issue. also asked my basis guy but he has no clue).
    Kindly suggest.
    Thanks,
    Z

    Thanks Navneet and Gautham.
    My problem is now solved. Let me summarize the problem and the solution now.
    -> The customization tables suddenly stopped asking for a request while saving data.
        Somehow the settings had been reset, and as Gautham pointed out, it was corrected in the tcode SCC4
    -> Most of the tables now worked fine, but still few of them didnt ask for requests
        Here, I found out that the developers had chosen "no, or user, recording routine" instead of  "standard recording routine". For such tables, when i check in the tcode SE54, menu path Environment -> Maintenance Objects -> Change, I find the Transport category 'No Transport'. Regenerating the maintenance generator choosing "standard recording routine" fixes this and the tables now ask for a customizing request.
    Thanks, both, for the quick response.

Maybe you are looking for

  • Satellite P20-771: Blue screen error message after OS reinstalling

    I have a laptop Satellite P20-771 / Pentium 4 3.40GHz (800/HTT) / XP Home/ 17' with nVidia Geo5700 driver. As I had some problems with software, and I reinstalled everything using the provided CDs. Unfortunately the computer keeps malfunctioning givi

  • How do I check if my external is Fat 32

    Hello all, I have an external that I have had for some time. I thought it was fat32 since I knew at some point I would like to use it with a windows a mcahine and that time has come. I tried mounting it on my Dell and it didn't see it, so before I go

  • Target=_blank is not working in XML code

    Hi Experts, I have very basic question I am passing an extenal URL in XML code but target=_blank is getting ignored. <a href="http://localhost:8080/VikasSSO/Test.jsp" target="_blank">Click vikas</a> I done some research on it and found we can achieve

  • I accidentally opened a back up and now I can't find all of the pictures I have added since then

    Help! I don't know how to get back to my working catalog.

  • Windows opening problem.

    i bought a nootbook, from italy by the name of compaq. VISION AMD, WINDOWS 7,  HP PREMIER EXPERIENCE, DUAL CORE AND AMD RADEONtm GRAPHICS. BUT problem is when i m trying to on my laptop. is showing is opening but few seccend later is coming blank. no