Fetching DBMS_OUTPUT statements in user objects

My procedure/s contains lot of dbms_output statments.I want to fetch all the dbms_output statments in a procedure.pls suggest.
for example:My procedure is
PROCEDURE TEST_PROC(VAR_TEAM_ID VARCHAR2)
AS
VAR_NUM NUMBER;
VAR_MAX NUMBER;
BEGIN
SELECT NVL(COUNT(*),0) INTO VAR_NUM FROM PROJ_INFO
WHERE TEAM_MEMBER_ID=VAR_TEAM_ID;
IF VAR_NUM > 0 THEN
SELECT MAX(PROJECT_ID) INTO VAR_MAX FROM PROJ_INFO
WHERE TEAM_MEMBER_ID=VAR_TEAM_ID;
DBMS_OUTPUT.PUT_LINE('1.WHEN VAR_NUM > 0');
ELSIF VAR_NUM = 0 THEN
DBMS_OUTPUT.PUT_LINE('1.WHEN VAR_NUM = 0'||' '||VAR_NUM='THIS IS A TEST LINE');
ELSE
DBMS_OUTPUT.PUT_LINE('1.LAST ELSE');
END IF;
IF VAR_NUM > 0 THEN
DBMS_OUTPUT.PUT_LINE('2.WHEN VAR_NUM > 0');
END IF;
IF VAR_NUM > 0 THEN
DBMS_OUTPUT.PUT_LINE('3.WHEN VAR_NUM > 0');
ELSE
DBMS_OUTPUT.PUT_LINE('3.WHEN VAR_NUM = 0');
END IF;
END;
and i want all the DBMS_OUTPUT statments from USER_SOURCE view.
Pls suggest
Regards
MS

How about:
SELECT * FROM user_source WHERE UPPER(text) LIKE '%DBMS_OUTPUT%';?
Cheers,
Colin

Similar Messages

  • Fetch Admin Roles from User Object

    Hi,
    I have user object from which I need to fetch name of all Admin roles a user is having.
    I tried this method - getExpandedAdminGroupRefs() but its returning me null.
    getAttribute method works fine with <s>firstname</s>
    <invoke ='getExpandedAdminGroupRefs'>
    <ref>userObj</ref>
    </invoke> --> null
    Along with this I also need all IDM capabilities that user is having and managed organizations.
    Can anyone help.
    Thanks in Advance :)

    Hi
    Not sure exactly where you are doing this from but there are reports in SIM that give you this information without writing any code.
    Admin role report
    Administrators report.
    If this doesn't suit you you could look at the code that runs these reports and maybe anser your code question there.
    Cheers

  • Replace the following open/fetch/close statements with a cursor FOR loop

    Hi anyone could you please help me,
    I would like to replace the following open/fetch/close statements with a cursor FOR loop.
    Codes are:
    CREATE OR REPLACE PROCEDURE COMOES.orchid_shipment_interface IS
      -- get the com shipment header records
      CURSOR c_com_shphdr ( p_dwn_end_dt DATE ) IS
      SELECT custno client_id
           , plheadno plheadno
           , DECODE(carr_no,'FEDX',lading_no,'UPS',lading_no,carrier_pro_no) tracking_no
           , carr_no||'/'||carr_method carrier_id
           , plantid plant_id
           , carr_no
           , lading_no
           , del_custaddr ship_to_id
           , ol_type cfm_order_type
           , del_custno
           , shipterm    freight_terms
           , del_custattn attn_line
           , custaddr
        FROM com_plhead@com_pricing.world
       WHERE status = '9'
         AND (mod_dat) > p_dwn_end_dt;
      -- get the com shipment address records
      CURSOR c_com_shpadr (p_custaddr VARCHAR2) IS
      SELECT name1 addr_name
           , street1 addr_line1
           , street2 addr_line2
           , city city
           , state state_cd
           , zip zip
           , country country_cd
           , phone work_phone
           , email email1
        FROM com_address@com_pricing.world
       WHERE addr_id = p_custaddr;
      -- get the com shipment detail records
      CURSOR c_com_shpdtl ( p_plheadno NUMBER) IS
      SELECT pll.plheadno pllheadno
           , pll.pllineno ord_line_no
           , pll.ol_no erp_line_no
           , pll.ol_segno
           , pll.fg_id sku
           , pll.qty_shipped ship_qty
           , pll.ordno erp_ord_no
           FROM com_plline@com_pricing.world pll
       WHERE pll.plheadno = p_plheadno
         AND NOT EXISTS (SELECT '1'
                           FROM com_pkg_int_interface@com_pricing.world  cpi
                          WHERE pll.ordno = cpi.ordno
                            AND pll.ol_no = cpi.ol_no);
      -- type declaration
      -- type declaration of com table.
      TYPE t_com_shphdr IS TABLE OF c_com_shphdr%ROWTYPE INDEX BY BINARY_INTEGER;
      TYPE t_orchid_shphdr IS TABLE OF orchid_shipment_hdr_intf%ROWTYPE INDEX BY BINARY_INTEGER;
      TYPE t_com_shpadr IS TABLE OF c_com_shpadr%ROWTYPE INDEX BY BINARY_INTEGER;
      TYPE t_orchid_shpadr IS TABLE OF orchid_shipment_address_intf%ROWTYPE INDEX BY BINARY_INTEGER;
      TYPE t_com_shpdtl IS TABLE OF c_com_shpdtl%ROWTYPE INDEX BY BINARY_INTEGER;
      TYPE t_orchid_shpdtl IS TABLE OF orchid_shipment_dtl_intf%ROWTYPE INDEX BY BINARY_INTEGER;
      lv_company_code       com_customer.business_unit%TYPE;
      lv_erp_ord_no         com_plline.ordno%TYPE;
      lv_actual_ship_date   com_plline.confirm_date%TYPE;
      lv_po_no              com_oline.po_no%TYPE;
      lv_ord_date           com_oline.entrydate%TYPE;
      lv_hdr_batch_ctrl_no  download_batch_info.batch_ctrl_no%TYPE;
      lv_adr_batch_ctrl_no  download_batch_info.batch_ctrl_no%TYPE;
      lv_dtl_batch_ctrl_no  download_batch_info.batch_ctrl_no%TYPE;
      lv_sku_desc           com_salesitem.title%TYPE;
      lv_ord_qty            com_oldelseg.qty%TYPE;
      lr_com_shphdr    t_com_shphdr;
      lr_orchid_shphdr t_orchid_shphdr;
      lr_com_shpadr    t_com_shpadr;
      lr_orchid_shpadr t_orchid_shpadr;
      lr_com_shpdtl    t_com_shpdtl;
      lr_orchid_shpdtl t_orchid_shpdtl;
      -- variable declaration
      ln_shphdr_seq    NUMBER(10):= 0;
      ln_shpadr_seg    NUMBER(10):= 0;
      ln_shpdtl_seq    NUMBER(10):= 0;
      cnt              NUMBER(10):= 0;
      cnt1             NUMBER(10):= 0;
      ld_hdr_dwn_end_dt           download_batch_info.download_end_tstamp%TYPE;
      lc_hdr_dwn_status           download_batch_info.dwn_status%TYPE;
      ld_hdr_download_end_tstamp  DATE;
      ln_hdr_running_seq          NUMBER(10) := 0;
      ld_adr_dwn_end_dt           download_batch_info.download_end_tstamp%TYPE;
      lc_adr_dwn_status           download_batch_info.dwn_status%TYPE;
      ld_adr_download_end_tstamp  DATE;
      ln_adr_running_seg          NUMBER(10) := 0;
      ld_dtl_dwn_end_dt           download_batch_info.download_end_tstamp%TYPE;
      lc_dtl_dwn_status           download_batch_info.dwn_status%TYPE;
      ld_dtl_download_end_tstamp  DATE;
      ln_dtl_running_seq          NUMBER(10) := 0;
    BEGIN
      -- get the batch control number details from batch information table for shipment header
      BEGIN
        SELECT batch_ctrl_no
             , NVL(download_end_tstamp,TO_DATE('01/01/1980','MM/DD/YYYY'))
             , dwn_status
          INTO lv_hdr_batch_ctrl_no
             , ld_hdr_dwn_end_dt
             , lc_hdr_dwn_status
          FROM comoes.download_batch_info
         WHERE download_id = 'ORCHID_SHIPMENT_HDR_INTF';
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          DBMS_OUTPUT.PUT_LINE (' No Data Found for ORCHID_SHIPMENT_HDR_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN TOO_MANY_ROWS THEN
          DBMS_OUTPUT.PUT_LINE (' Too Many Rows found for ORCHID_SHIPMENT_HDR_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE (' Following error occured while getting batch control number for ORCHID_SHIPMENT_HDR_INTF in Download Batch Info table...!!!'||SQLERRM);
          RAISE;
      END;
      -- get the batch control number details from batch information table for shipment address
      BEGIN
        SELECT batch_ctrl_no
             , NVL(download_end_tstamp,TO_DATE('01/01/1980','MM/DD/YYYY'))
             , dwn_status
          INTO lv_adr_batch_ctrl_no
             , ld_adr_dwn_end_dt
             , lc_adr_dwn_status
          FROM comoes.download_batch_info
         WHERE download_id = 'ORCHID_SHIPMENT_ADDRESS_INTF';
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          DBMS_OUTPUT.PUT_LINE (' No Data Found for ORCHID_SHIPMENT_ADDRESS_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN TOO_MANY_ROWS THEN
          DBMS_OUTPUT.PUT_LINE (' Too Many Rows found for ORCHID_SHIPMENT_ADDRESS_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE (' Following error occured while getting batch control number for ORCHID_SHIPMENT_ADDRESS_INTF in Download Batch Info table...!!!'||SQLERRM);
          RAISE;
      END;
      -- get the batch control number details from batch information table for shipment details
      BEGIN
        SELECT batch_ctrl_no
             , NVL(download_end_tstamp,TO_DATE('01/01/1980','MM/DD/YYYY'))
             , dwn_status
          INTO lv_dtl_batch_ctrl_no
             , ld_dtl_dwn_end_dt
             , lc_dtl_dwn_status
          FROM download_batch_info
         WHERE download_id = 'ORCHID_SHIPMENT_DTL_INTF';
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          DBMS_OUTPUT.PUT_LINE (' No Data Found for ORCHID_SHIPMENT_DTL_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN TOO_MANY_ROWS THEN
          DBMS_OUTPUT.PUT_LINE (' Too Many Rows found for ORCHID_SHIPMENT_DTL_INTF in Download Batch Info table...!!!');
          RAISE;
        WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE (' Following error occured while getting batch control number for ORCHID_SHIPMENT_DTL_INTF in Download Batch Info table...!!!'||SQLERRM);
          RAISE;
      END;
      -- if previous run is not sucess then do nothing and return.
      OPEN c_com_shphdr ( ld_hdr_dwn_end_dt ) ;
      LOOP
        -- delete the collection for every cycle
        lr_com_shphdr.DELETE;
        lr_orchid_shphdr.DELETE;
        lr_com_shpadr.DELETE;
        lr_orchid_shpadr.DELETE;
        lr_com_shpdtl.DELETE;
        lr_orchid_shpdtl.DELETE;
        -- fetch the order header records to collection
        FETCH c_com_shphdr BULK COLLECT INTO lr_com_shphdr LIMIT 500;
        -- where there is no record in the collection the exit from the loop
        EXIT WHEN lr_com_shphdr.COUNT = 0;
        -- build your logic there to populate the data into order header collection.
          FOR i IN 1..lr_com_shphdr.COUNT
          LOOP
            -- accumulate header running sequence number
            ln_hdr_running_seq := ln_hdr_running_seq + 1;
            ln_shphdr_seq      := ln_hdr_running_seq;
             -- Get the business unit for the customer from com_customer
            BEGIN
              SELECT business_unit
                INTO lv_company_code
                FROM com_customer@com_pricing.world
               WHERE custno = lr_com_shphdr(i).del_custno;
            EXCEPTION
            WHEN OTHERS THEN
              lv_company_code := NULL;
            END;
            -- Get the ordno, confirm_date from COM_PLLINE
            BEGIN
            SELECT ordno
                 , confirm_date
              INTO lv_erp_ord_no
                 , lv_actual_ship_date
              FROM com_plline@com_pricing.world cpl
             WHERE cpl.plheadno = lr_com_shphdr(i).plheadno
               AND ROWNUM = 1;
            EXCEPTION
            WHEN OTHERS THEN
              lv_erp_ord_no       := NULL;
              lv_actual_ship_date := NULL;
            END;
            -- Get the po_no, Entry_date from COM_OLINE
            BEGIN
              SELECT po_no
                   , entrydate
                INTO lv_po_no
                   , lv_ord_date
                FROM com_oline@com_pricing.world col
               WHERE col.ordno = lv_erp_ord_no
                 AND ROWNUM = 1;
            EXCEPTION
            WHEN OTHERS THEN
              lv_po_no    := NULL;
              lv_ord_date := NULL;
            END;
            -- To assign the Bol Number from Lading Number
            IF lr_com_shphdr(i).carr_no NOT IN ('FEDX','UPS') THEN
               lr_orchid_shphdr(i).bol_no     := lr_com_shphdr(i).lading_no;
            ELSE
               lr_orchid_shphdr(i).bol_no     := NULL;
            END IF;
            -- For each order header get the Shipment Delivery Adderss
            OPEN c_com_shpadr ( lr_com_shphdr(i).custaddr);
            FETCH c_com_shpadr BULK COLLECT INTO lr_com_shpadr;
            -- where there is no record in the collection the exit from the loop
            EXIT WHEN lr_com_shpadr.COUNT = 0;
            -- biuld your logic here to populate the del address collection.
              FOR j IN 1..lr_com_shpadr.COUNT
              LOOP
                -- accumulate the loop count into temp variable, so that will through tell each set of order header.
                cnt := cnt + 1;
                -- accumolate the header running sequence number.
                ln_adr_running_seg := ln_adr_running_seg + 1;
                ln_shpadr_seg := ln_adr_running_seg;
                -- move the order address data into collection.
                lr_orchid_shpadr(cnt).client_id       := lr_com_shphdr(i).del_custno;
                lr_orchid_shpadr(cnt).ord_no          := lr_com_shphdr(i).plheadno;
                lr_orchid_shpadr(cnt).tracking_no     := lr_com_shphdr(i).tracking_no;
                lr_orchid_shpadr(cnt).addr_name       := lr_com_shpadr(j).addr_name;
                lr_orchid_shpadr(cnt).attn_line       := lr_com_shphdr(i).attn_line;
                lr_orchid_shpadr(cnt).addr_line1      := lr_com_shpadr(j).addr_line1;
                lr_orchid_shpadr(cnt).addr_line2      := lr_com_shpadr(j).addr_line2;
                lr_orchid_shpadr(cnt).addr_line3      := NULL;
                lr_orchid_shpadr(cnt).addr_line4      := NULL;
                lr_orchid_shpadr(cnt).addr_line5      := NULL;
                lr_orchid_shpadr(cnt).city            := lr_com_shpadr(j).city;
                lr_orchid_shpadr(cnt).state_cd        := lr_com_shpadr(j).state_cd;
                lr_orchid_shpadr(cnt).zip             := lr_com_shpadr(j).zip;
                lr_orchid_shpadr(cnt).zip_ext         := NULL;
                lr_orchid_shpadr(cnt).country_cd      := lr_com_shpadr(j).country_cd;
                lr_orchid_shpadr(cnt).tax_geo_cd      := NULL;
                lr_orchid_shpadr(cnt).work_phone      := lr_com_shpadr(j).work_phone;
                lr_orchid_shpadr(cnt).email1          := lr_com_shpadr(j).email1;
                lr_orchid_shpadr(cnt).cre_dat         := SYSDATE;
                lr_orchid_shpadr(cnt).cre_usr         := USER;
                lr_orchid_shpadr(cnt).batch_ctrl_no   := lv_adr_batch_ctrl_no;
              END LOOP;
            CLOSE c_com_shpadr;
            -- For each order header get the order detail/delivery segment data
            OPEN c_com_shpdtl ( lr_com_shphdr(i).plheadno );
            FETCH c_com_shpdtl BULK COLLECT INTO lr_com_shpdtl;
            -- where there is no record in the collection the exit from the loop
            EXIT WHEN lr_com_shpdtl.COUNT = 0;
            -- build your logic here to populate the order detail collection
              FOR k IN 1..lr_com_shpdtl.COUNT
              LOOP
                -- accumulate the loop count into a temp variable, so that will through till each set of Order Header.
                cnt1 := cnt1 + 1;
                -- accumulate header running sequence number
                ln_dtl_running_seq := ln_dtl_running_seq + 1;
                ln_shpdtl_seq := ln_dtl_running_seq;
                -- Get Quantity for the delvery from delevery segment table.
                BEGIN
                  SELECT NVL(Qty,0)
                    INTO lv_ord_qty
                    FROM com_oldelseg@com_pricing.world cds
                   WHERE cds.ordno = lr_com_shpdtl(k).erp_ord_no
                     AND cds.ol_no = lr_com_shpdtl(k).erp_line_no
                     AND cds.ol_segno = lr_com_shpdtl(k).ol_segno;
                EXCEPTION
                  WHEN OTHERS THEN
                    lv_ord_qty := NULL;
                END;
                -- Get Title for the salesitem from the salesitem table.
                BEGIN
                  SELECT Title
                    INTO lv_sku_desc
                    FROM com_salesitem@com_pricing.world cs
                   WHERE cs.fg_id = lr_com_shpdtl(k).sku;
                EXCEPTION
                  WHEN OTHERS THEN
                    lv_sku_desc := NULL;
                END;
                -- move the Order detail data into collection
                lr_orchid_shpdtl(cnt1).client_id         := lr_com_shphdr(i).client_id;
                lr_orchid_shpdtl(cnt1).ord_no            := lr_com_shphdr(i).plheadno;
                lr_orchid_shpdtl(cnt1).ord_line_no       := lr_com_shpdtl(k).ord_line_no;
                lr_orchid_shpdtl(cnt1).erp_line_no       := lr_com_shpdtl(k).erp_line_no;
                lr_orchid_shpdtl(cnt1).sku               := lr_com_shpdtl(k).sku;
                lr_orchid_shpdtl(cnt1).tracking_no       := lr_com_shphdr(i).tracking_no;
                lr_orchid_shpdtl(cnt1).container_no      := NULL;
                lr_orchid_shpdtl(cnt1).ord_qty           := lv_ord_qty;
                lr_orchid_shpdtl(cnt1).ship_qty          := lr_com_shpdtl(k).ship_qty;
                lr_orchid_shpdtl(cnt1).price_point       := NULL;
                lr_orchid_shpdtl(cnt1).pick_invoice_no   := NULL;
                lr_orchid_shpdtl(cnt1).cancel_qty        := NULL;
                lr_orchid_shpdtl(cnt1).bldg_id           := NULL;                              --lr_com_shpdtl(k).bldg_id;
                lr_orchid_shpdtl(cnt1).sku_company       := NULL;                              --lr_com_shpdtl(k).sku_company;
                lr_orchid_shpdtl(cnt1).sku_desc          := lv_sku_desc;
                lr_orchid_shpdtl(cnt1).icc_cd1           := NULL;                              --lr_com_shpdtl(k).icc_cd1;
                lr_orchid_shpdtl(cnt1).erp_ord_no        := lr_com_shpdtl(k).erp_ord_no;
                lr_orchid_shpdtl(cnt1).cre_dat           := SYSDATE;
                lr_orchid_shpdtl(cnt1).cre_usr           := USER;
                lr_orchid_shpdtl(cnt1).batch_ctrl_no     := lv_dtl_batch_ctrl_no;
              END LOOP;
            CLOSE c_com_shpdtl;
            -- build the logic to populate Order Header
            lr_orchid_shphdr(i).client_id              := lr_com_shphdr(i).client_id;
            lr_orchid_shphdr(i).ord_no                 := lr_com_shphdr(i).plheadno;
            lr_orchid_shphdr(i).tracking_no            := lr_com_shphdr(i).tracking_no;
            lr_orchid_shphdr(i).container_no           := NULL;                            -- container number is not maintained in COM
            lr_orchid_shphdr(i).carrier_id             := lr_com_shphdr(i).carrier_id;
            lr_orchid_shphdr(i).plant_id               := lr_com_shphdr(i).plant_id;
            lr_orchid_shphdr(i).erp_ord_no             := lv_erp_ord_no;
            lr_orchid_shphdr(i).erp_ord_no2            := NULL;
            lr_orchid_shphdr(i).po_no                  := lv_po_no;
            lr_orchid_shphdr(i).ship_to_id             := lr_com_shphdr(i).ship_to_id;
            lr_orchid_shphdr(i).ship_to_addr_id        := lr_com_shphdr(i).custaddr;
            lr_orchid_shphdr(i).scac                   := NULL;                             --lr_com_shphdr(i).scac;
            lr_orchid_shphdr(i).actual_ship_date       := lv_actual_ship_date;
            lr_orchid_shphdr(i).cfm_order_type         := lr_com_shphdr(i).cfm_order_type;
            lr_orchid_shphdr(i).company_code           := lv_company_code;
            lr_orchid_shphdr(i).no_of_order_lines      := NULL;                             --lr_com_shphdr(i).no_of_order_lines;
            lr_orchid_shphdr(i).pick_invoice_no        := NULL;
            lr_orchid_shphdr(i).ord_date               := lv_ord_date;
            lr_orchid_shphdr(i).orig_tender_date       := NULL;
            lr_orchid_shphdr(i).orig_delv_date         := NULL;
            lr_orchid_shphdr(i).delivery_flag          := NULL;
            lr_orchid_shphdr(i).delv_date_from         := NULL;
            lr_orchid_shphdr(i).delv_date_to           := NULL;
            lr_orchid_shphdr(i).orig_carr_cd           := NULL;
            lr_orchid_shphdr(i).routing_comment        := NULL;
            lr_orchid_shphdr(i).segment_type           := NULL;
            lr_orchid_shphdr(i).back_order_flag        := NULL;
            lr_orchid_shphdr(i).addr_override_flag     := NULL;
            lr_orchid_shphdr(i).fmx_assigned_carr      := NULL;
            lr_orchid_shphdr(i).fmx_assigned_ship_date := NULL;
            lr_orchid_shphdr(i).fmx_assigned_delv_date := NULL;
            lr_orchid_shphdr(i).freight_terms          := lr_com_shphdr(i).freight_terms;
            lr_orchid_shphdr(i).fmx_load_id            := NULL;
            lr_orchid_shphdr(i).asn_type               := NULL;
            lr_orchid_shphdr(i).icc_cd1                := NULL;                             --lr_com_shphdr(i).icc_cd1;
            lr_orchid_shphdr(i).trans_type             := NULL;
            lr_orchid_shphdr(i).ref_no1                := NULL;
            lr_orchid_shphdr(i).ref_no2                := NULL;
            lr_orchid_shphdr(i).ref_no3                := NULL;
            lr_orchid_shphdr(i).ref_no4                := NULL;
            lr_orchid_shphdr(i).cre_dat                := SYSDATE;
            lr_orchid_shphdr(i).cre_usr                := USER;
            lr_orchid_shphdr(i).batch_ctrl_no          := lv_hdr_batch_ctrl_no;
            -- logic to get total boxes and weight.
            BEGIN
              SELECT SUM(no_cartons), SUM(weight)
                INTO lr_orchid_shphdr(i).total_boxes
                   , lr_orchid_shphdr(i).weight
                FROM com_plline@com_pricing.world pll
               WHERE pll.plheadno = lr_com_shphdr(i).plheadno;
            EXCEPTION
             WHEN OTHERS THEN
                lr_orchid_shphdr(i).total_boxes := NULL;
                lr_orchid_shphdr(i).weight      := NULL;
            END;
          END LOOP;
        -- initialize the variables for next loop cycle.
        cnt := 0;
        cnt1 := 0;
        -- populate the shipment header interface table.
        FOR x IN 1..lr_orchid_shphdr.COUNT
        LOOP
          ld_hdr_download_end_tstamp := lr_orchid_shphdr(x).cre_dat;
          INSERT INTO orchid_shipment_hdr_intf
                    (record_qualifier
                    ,client_id
                    ,ord_no
                    ,tracking_no
                    ,container_no
                    ,bol_no
                    ,carrier_id
                    ,plant_id
                    ,erp_ord_no
                    ,erp_ord_no2
                    ,po_no
                    ,ship_to_id
                    ,ship_to_addr_id
                    ,scac
                    ,actual_ship_date
                    ,cfm_order_type
                    ,company_code
                    ,no_of_order_lines
                    ,pick_invoice_no
                    ,total_boxes
                    ,weight
                    ,ord_date
                    ,orig_tender_date
                    ,orig_delv_date
                    ,delivery_flag
                    ,delv_date_from
                    ,delv_date_to
                    ,orig_carr_cd
                    ,routing_comment
                    ,segment_type
                    ,back_order_flag
                    ,addr_override_flag
                    ,fmx_assigned_carr
                    ,fmx_assigned_ship_date
                    ,fmx_assigned_delv_date
                    ,freight_terms
                    ,fmx_load_id
                    ,asn_type
                    ,upl_status
                    ,icc_cd1
                    ,trans_type
                    ,ref_no1
                    ,ref_no2
                    ,ref_no3
                    ,ref_no4
                    ,cre_dat
                    ,cre_usr
                    ,batch_ctrl_no)
            VALUES
                    ( 10
                    ,lr_orchid_shphdr(x).client_id
                    ,lr_orchid_shphdr(x).ord_no
                    ,lr_orchid_shphdr(x).tracking_no
                    ,lr_orchid_shphdr(x).container_no
                    ,lr_orchid_shphdr(x).bol_no
                    ,lr_orchid_shphdr(x).carrier_id
                    ,lr_orchid_shphdr(x).plant_id
                    ,lr_orchid_shphdr(x).erp_ord_no
                    ,lr_orchid_shphdr(x).erp_ord_no2
                    ,lr_orchid_shphdr(x).po_no
                    ,lr_orchid_shphdr(x).ship_to_id
                    ,lr_orchid_shphdr(x).ship_to_addr_id
                    ,lr_orchid_shphdr(x).scac
                    ,lr_orchid_shphdr(x).actual_ship_date
                    ,lr_orchid_shphdr(x).cfm_order_type
                    ,lr_orchid_shphdr(x).company_code
                    ,lr_orchid_shphdr(x).no_of_order_lines
                    ,lr_orchid_shphdr(x).pick_invoice_no
                    ,lr_orchid_shphdr(x).total_boxes
                    ,lr_orchid_shphdr(x).weight
                    ,lr_orchid_shphdr(x).ord_date
                    ,lr_orchid_shphdr(x).orig_tender_date
                    ,lr_orchid_shphdr(x).orig_delv_date
                    ,lr_orchid_shphdr(x).delivery_flag
                    ,lr_orchid_shphdr(x).delv_date_from
                    ,lr_orchid_shphdr(x).delv_date_to
                    ,lr_orchid_shphdr(x).orig_carr_cd
                    ,lr_orchid_shphdr(x).routing_comment
                    ,lr_orchid_shphdr(x).segment_type
                    ,lr_orchid_shphdr(x).back_order_flag
                    ,lr_orchid_shphdr(x).addr_override_flag
                    ,lr_orchid_shphdr(x).fmx_assigned_carr
                    ,lr_orchid_shphdr(x).fmx_assigned_ship_date
                    ,lr_orchid_shphdr(x).fmx_assigned_delv_date
                    ,lr_orchid_shphdr(x).freight_terms
                    ,lr_orchid_shphdr(x).fmx_load_id
                    ,lr_orchid_shphdr(x).asn_type
                    ,00
                    ,lr_orchid_shphdr(x).icc_cd1
                    ,lr_orchid_shphdr(x).trans_type
                    ,lr_orchid_shphdr(x).ref_no1
                    ,lr_orchid_shphdr(x).ref_no2
                    ,lr_orchid_shphdr(x).ref_no3
                    ,lr_orchid_shphdr(x).ref_no4
                    ,lr_orchid_shphdr(x).cre_dat
                    ,lr_orchid_shphdr(x).cre_usr
                    ,lr_orchid_shphdr(x).batch_ctrl_no);
        END LOOP;
        -- populate the shipment address interface table.
        FOR y IN 1..lr_orchid_shpadr.COUNT
        LOOP
          ld_adr_download_end_tstamp := lr_orchid_shpadr(y).cre_dat;
          INSERT INTO orchid_shipment_address_intf
                      ( record_qualifier
                      , client_id
                      , ord_no
                      , tracking_no
                      , addr_name
                      , attn_line
                      , addr_line1
                      , addr_line2
                      , addr_line3
                      , addr_line4
                      , addr_line5
                      , city
                      , state_cd
                      , zip
                      , zip_ext
                      , country_cd
                      , tax_geo_cd
                      , work_phone
                      , email1
                      , cre_dat
                      , cre_usr
                      , batch_ctrl_no)
               VALUES ( 14
                      , lr_orchid_shpadr(y).client_id
                      , lr_orchid_shpadr(y).ord_no
                      , lr_orchid_shpadr(y).tracking_no
                      , lr_orchid_shpadr(y).addr_name
                      , lr_orchid_shpadr(y).attn_line
                      , lr_orchid_shpadr(y).addr_line1
                      , lr_orchid_shpadr(y).addr_line2
                      , lr_orchid_shpadr(y).addr_line3
                      , lr_orchid_shpadr(y).addr_line4
                      , lr_orchid_shpadr(y).addr_line5
                      , lr_orchid_shpadr(y).city
                      , lr_orchid_shpadr(y).state_cd
                      , lr_orchid_shpadr(y).zip
                      , lr_orchid_shpadr(y).zip_ext
                      , lr_orchid_shpadr(y).country_cd
                      , lr_orchid_shpadr(y).tax_geo_cd
                      , lr_orchid_shpadr(y).work_phone
                      , lr_orchid_shpadr(y).email1
                      , lr_orchid_shpadr(y).cre_dat
                      , lr_orchid_shpadr(y).cre_usr
                      , lr_orchid_shpadr(y).batch_ctrl_no);
        END LOOP;
        -- populate the shipment detail interface table.
        FOR z IN 1..lr_orchid_shpdtl.COUNT
        LOOP
          ld_dtl_download_end_tstamp := lr_orchid_shpdtl(z).cre_dat;
          INSERT INTO orchid_shipment_dtl_intf
                      ( record_qualifier
                      , client_id
                      , ord_no
                      , ord_line_no
                      , erp_line_no
                      , sku
                      , tracking_no
                      , container_no
                      , ord_qty
                      , ship_qty
                      , price_point
                      , pick_invoice_no
                      , cancel_qty
                      , bldg_id
                      , sku_company
                      , sku_desc
                      , icc_cd1
                      , erp_ord_no
                      , cre_dat
                      , cre_usr
                      , batch_ctrl_no)
               VALUES ( 20
                      , lr_orchid_shpdtl(z).client_id
                      , lr_orchid_shpdtl(z).ord_no
                      , lr_orchid_shpdtl(z).ord_line_no
                      , lr_orchid_shpdtl(z).erp_line_no
                      , lr_orchid_shpdtl(z).sku
                      , lr_orchid_shpdtl(z).tracking_no
                      , lr_orchid_shpdtl(z).container_no
                      , lr_orchid_shpdtl(z).ord_qty
                      , lr_orchid_shpdtl(z).ship_qty
                      , lr_orchid_shpdtl(z).price_point
                      , lr_orchid_shpdtl(z).pick_invoice_no
                      , lr_orchid_shpdtl(z).cancel_qty
                      , lr_orchid_shpdtl(z).bldg_id
                      , lr_orchid_shpdtl(z).sku_company
                      , lr_orchid_shpdtl(z).sku_desc
                      , lr_orchid_shpdtl(z).icc_cd1
                      , lr_orchid_shpdtl(z).erp_ord_no
                      , lr_orchid_shpdtl(z).cre_dat
                      , lr_orchid_shpdtl(z).cre_usr
                      , lr_orchid_shpdtl(z).batch_ctrl_no);
        END LOOP;
        COMMIT;
      END LOOP;
      CLOSE c_com_shphdr;
      -- set the status to success
      UPDATE comoes.download_batch_info
         SET batch_ctrl_no = orchid_plhead_btch_ctrl_seq.NEXTVAL
           , dwn_status = '90'
           , download_end_tstamp = NVL(ld_hdr_download_end_tstamp,SYSDATE)
       WHERE download_id = 'ORCHID_SHIPMENT_HDR_INTF'
         AND batch_ctrl_no = lv_hdr_batch_ctrl_no;
      UPDATE comoes.download_batch_info
         SET batch_ctrl_no = orchid_address_btch_ctrl_seq.NEXTVAL
           , dwn_status = '90'
           , download_end_tstamp = NVL(ld_hdr_download_end_tstamp,SYSDATE)
       WHERE download_id = 'ORCHID_SHIPMENT_ADDRESS_INTF'
         AND batch_ctrl_no = lv_adr_batch_ctrl_no;
      UPDATE comoes.download_batch_info
         SET batch_ctrl_no = orchid_plline_btch_ctrl_seq.NEXTVAL
           , dwn_status = '90'
           , download_end_tstamp = NVL(ld_dtl_download_end_tstamp,SYSDATE)
       WHERE download_id = 'ORCHID_SHIPMENT_DTL_INTF'
         AND batch_ctrl_no = lv_dtl_batch_ctrl_no;
      -- Update the download status to success in the interface table.
      -- Shipment Header
      COMMIT;
    EXCEPTION
      WHEN OTHERS THEN
        -- load is not sucess then set the status to fail
        UPDATE comoes.download_batch_info
           SET dwn_status = '99'
         WHERE download_id = 'ORCHID_SHIPMENT_HDR_INTF'
           AND batch_ctrl_no = lv_hdr_batch_ctrl_no;
        UPDATE comoes.download_batch_info
           SET dwn_status = '99'
         WHERE download_id = 'ORCHID_SHIPMENT_ADDRESS_INTF'
           AND batch_ctrl_no = lv_adr_batch_ctrl_no;
        UPDATE comoes.download_batch_info
           SET dwn_status = '99'
         WHERE download_id = 'ORCHID_SHIPMENT_DTL_INTF'
           AND batch_ctrl_no = lv_dtl_batch_ctrl_no;
        COMMIT;
        DBMS_OUTPUT.PUT_LINE('Following error occured while executing ORCHID_SHIPMENT_INTF procedure...!!!'||SQLERRM);
        RAISE;
    END orchid_shipment_interface;Edited by: BluShadow on 03-Aug-2011 13:28
    added {noformat}{noformat} tags. Please read {message:id=9360002} to learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                &nb

    Please read the Forum FAQ on how to ask a question, particularly how to format code
    SQL and PL/SQL FAQ
    SQL and PL/SQL FAQ
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE (' Following error occured while getting batch control number for ORCHID_SHIPMENT_HDR_INTF in Download Batch Info table...!!!'||SQLERRM);
    RAISE;http://tkyte.blogspot.com/2008/01/why-do-people-do-this.html

  • Request: compare and propagate user objects

    After making changes to table definitions, views, program units, and so on, it may be useful to propagate these changes to another database user. This maybe another development environment, or a testing environment in same or another database. Like "Compare user objects" option in PLSQL/Developer.
    /* BEGIN: cut and paste from PLSQL Developer Help */
    Compare User Objects
    After making changes to table definitions, views, program units, and so on, it may be useful to propagate these changes to another database user. This maybe another development environment, or a testing environment. To compare the objects of your development user with another user, you can use the Compare User Objects function in the Tools menu. This will bring up the following dialog:
    On the Selection tab page you can select the objects you wish to compare. After making this selection, you can press the Target Session button, to select the user and database that you want to compare. This will enable the Compare button, which you can press to start the compare operation. You can select the Include storage... option to include the storage information such as tablespace names and initial sizes for new objects. These may differ across databases, so this may not always be appropriate.
    When the compare operation is finished, the dialog will switch to the Differences tab page, which will show a list of all objects that are different:
    This list is sorted in order of dependency. Below the list of different objects of the target user, you see the SQL that needs to be executed to make these objects equal to the corresponding objects of the current user. If no object is selected, the SQL of all objects is displayed. If one or more objects are selected, only the SQL for the selected object(s) is displayed. In the example above, a missing EMP_MGR_EMPNO check constraint was added to the EMP table.
    The Show Differences button will show a visual line-by-line difference of the old and new source file of an object. This can be useful to view the changes made in Program Units, or can help you determine why a specific DDL statement was generated for other object types. The Configure External Difference Tool allows you to configure the difference tool should be used. By default the ExamDiff utility will be used, for which a Pro version is available (See the About item of ExamDiff’s Info menu). See also Tools - Differences.
    You can now press the Apply SQL button to execute this SQL in the target session. You can alternatively save the SQL in a file by pressing the Save SQL button, or you can copy it to the clipboard by pressing the Copy SQL button.
    When objects are compared, the following properties are ignored:
    ·     Storage – Properties such as the next extent and pct free of tables and indexes are not considered relevant for comparison.
    ·     Constraints with system generated names – These constraints will have different names for the 2 users, so they cannot be compared. If a table is new in the target session, these constraints will be generated though.
    ·     Table creation properties – Properties that would require the recreation of the table are ignored.
    ·     Table data – To export table data, use the Export Table function (see Export Tables).
    ·     Sequence values – The current value of a sequence is considered data.
    /* END: cut and paste from PLSQL Developer Help */

    This is on the list but not for 1.0.
    -kris

  • Unable to delete User object in FIM Portal - Cannot find the object "#calculateRequestSetTransitionsAssembleStatementsPartition"

    Hi,
    ***Problem
    I encounter a problem with FIM (version 4.1.3441.0 and 4.1.3496.0) when I try to delete a User object (and only a User object) whatever if it is
    manually/Expiration Workflow/Powershell.
    Deleting a User object used to be perfectly functional and, without any product version modification, stopped working. I haven't neither deleted/modified or add a
    "Grant" MPR or any of the corresponding Sets since last time I saw it working.
    Displayed error is "Request could not be dispatched" in FIM Portal and is referencing a stored procedure in Event Viewer.
    ***Error details
    When I try to delete a User object, here is the output :
    Portal
    "Processing error" on submit
    with the following details 
    Request status is stuck at "Validating" until next restart of FIM Service (after what it becomes “Canceled”)
    Request’s “Applied Policy” tab does not contain any MPR where, at least, a “Grant” MPR is expected
    As SQL Timeout is relatively high and error happens quickly, I don’t think there is a Timeout problem under that.
    Logs
    « Application »
    The Portal cannot connect to the middle tier using the web service interface.  This failure prevents all portal scenarios from functioning correctly.
    The cause may be due to a missing or invalid server url, a downed server, or an invalid server firewall configuration.
    Ensure the portal configuration is present and points to the resource management service.
     « Forefront Identity Manager »
    Reraised Error 50000, Level 16, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 1088, Level 16, State 12, Procedure CalculateRequestSetTransitionsAssembleStatements,
    Line 332, Message: Cannot find the object "#calculateRequestSetTransitionsAssembleStatementsPartition" because it does not exist or you do not have permissions.
    Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.
    Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> System.Data.SqlClient.SqlException: Reraised Error 50000, Level 16, State
    1, Procedure ReRaiseException, Line 37, Message: Reraised Error 1088, Level 16, State 12, Procedure CalculateRequestSetTransitionsAssembleStatements, Line 332, Message: Cannot find the object "#calculateRequestSetTransitionsAssembleStatementsPartition"
    because it does not exist or you do not have permissions.
    Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
    TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult
    result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.ResourceManagement.Data.DataAccess.UpdateRequest(RequestType request, IEnumerable`1 updates)
       --- End of inner exception stack trace ---
    Requestor: urn:uuid:7fb2b853-24f0-4498-9534-4e10589723c4
    Correlation Identifier: e7209633-46d0-4f4b-a59e-807649ef71ea
    Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> System.InvalidCastException: Specified cast is not valid.
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.CreateRequest(UniqueIdentifier requestor, UniqueIdentifier targetIdentifier, OperationType
    operation, String businessJustification, List`1 requestParameters, CultureInfo locale, Boolean isChildRequest, Guid cause, Boolean doEvaluation, Nullable`1 serviceId, Nullable`1 servicePartitionId, UniqueId messageIdentifier, UniqueIdentifier requestContextIdentifier,
    Boolean maintenanceMode)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.CreateRequest(UniqueIdentifier requestor, UniqueIdentifier targetIdentifier, OperationType
    operation, String businessJustification, List`1 requestParameters, CultureInfo locale, Boolean isChildRequest, Guid cause, Boolean doEvaluation, Nullable`1 serviceId, Nullable`1 servicePartitionId, UniqueId messageIdentifier)
       at Microsoft.ResourceManagement.WebServices.ResourceManagementService.Delete(Message request)
       --- End of inner exception stack trace ---
    For information, a maintenance plan rebuild/reorganize indexes daily and this problem has occurred on servers with different performances.
    Is any of you has already encounter this problem ?
    Any help would be greatly appreciated,
    Thanks in advance for your help,
    Matthew

    While there are several SQL Agent jobs (FIM Temporal Events, Maintain Sets, and Maintain Groups among others)created by the FIM install only one of those is enabled and scheduled and it calls all of the same stored procedures that the other
    jobs do. Step 2 is Maintain sets and Step 3 is maintain groups. So the Maintain sets and groups jobs never need to get enabled and scheduled, but if you want them to be maintained more frequently then you can.
    David Lundell, Get your copy of FIM Best Practices Volume 1 http://blog.ilmbestpractices.com/2010/08/book-is-here-fim-best-practices-volume.html

  • System Copy -- database PRR conains user object belongs to system user dbo

    Hi all,
    I am having an issue while performing the system copy for the sql server.
    Actions taken so far.
    1.Detached the database.
    2.Installed central instance in the target system .
    3.Attached the database using attach as option.
    4.Then used STM coll for the conversion.
    5.Bought sap in Up condition.
    Before detaching the database made export for java addin abap in source system
    Then I am trying to import the java add in abap using sapinst(system copy option)..In the half of the way i am getting the below message as ..
    DATABASE QAS containus user object belongs to system user dbo.
    I have performed the 551915 , 151603 but the still the same message is dispalying.
    In log files.  inserting
    TRACE [iaxxejsexp.cpp:208]
    EJS_Installer::writeTraceToLogBook()
    - Database XIA contains user objects belonging to system user dbo
    TRACE [iaxxbjsmod.cpp:301]
    CJSlibModule::showMessageBox_impl()
    <html> <head></head> <body> <b>Problems were found after checking configuration of database server b><br>- Database XIA contains user objects belonging to system user dbo<br><br>SOLUTION: Fix these problems to continue the installation. </body> </html>
    TRACE [iaxxgenimp.cpp:845]
    showDialog()
    waiting for an answer from gui
    TRACE [iaxxdlghnd.cpp:180]
    CDialogHandler::doHandleDoc()
    ACTION_OK received
    ERROR 2009-01-09 12:52:31 [iaxxinscbk.cpp:289]
    abortInstallation
    MDB-05919 Errors were found when checking connection to or configuration of database server (listed above in the log file).
    TRACE [iaxxejsbas.hpp:270]
    EJS_Base::dispatchFunctionCall()
    JS Callback has thrown std::ESAPinstException: ESAPinstException: error text undefined
    TRACE [syxxcfsmgt.cpp:430]
    CSyFileSystemMgtImpl::getFile(iastring,bool)
    lib=iamodmssql module=CIaNtMssDmo
    WARNING: THE FUNCTIONALITY YOU ARE USING IS DEPRECATED: getFile(const iastring & sFullName, bool bCaseSensitive) const. Use getFile(const PSyFSPath &) const instead.
    TRACE [syxxcfsmgt.cpp:195]
    CSyFileSystemMgtImpl::getNode(iastring,bool)
    lib=iamodmssql module=CIaNtMssDmo
    WARNING: THE FUNCTIONALITY YOU ARE USING IS DEPRECATED: getNode(const iastring & sFullName, bool bCaseSensitive) const. Use getNode(const PSyFSPath &) const instead.
    TRACE [syxxcfsmgt.cpp:921]
    CSyFileSystemMgtImpl::isExisting(iastring,bool)
    lib=iamodmssql module=CIaNtMssDmo
    WARNING: THE FUNCTIONALITY YOU ARE USING IS DEPRECATED: CSyFileSystemMgtImpl::isExisting(const iastring & , bool , ISyNode::eNodeType ) const. Use CSyFileSystemMgtImpl::isExisting(const CSyPath & , ISyNode::eNodeType ) const instead.
    WARNING 2009-01-09 12:52:31 [iaxxccntrl.cpp:477]
    CController::stepExecuted()
    The step dSetActionUnattended with step key J2EE_EngineEnterprise_Addin_OneHost|ind|ind|ind|WebAS|630|0|J2EE_EngineEnterpriseDialogs|ind|ind|ind|WebAS|630|0|J2EE_Engine|ind|ind|ind|J2EE_Engine|630|0|MssJ2eeDBSetup|ind|ind|ind|ind|ind|0|MssDatabaseInfo|ind|ind|ind|ind|ind|0|dSetActionUnattended was executed with status ERROR.
    TRACE [iaxxcsihlp.hpp:301]
    main()
    An error occurred during the installation of component SAP NetWeaver '04 SR1> SAP System Installation> Java Add-In for ABAP> MS SQL Server> Central / Distributed System> Java System Finalization. Press the log view button to get extended error information or press OK to terminate the installation. Log files are written to SAP NetWeaver '04 SR1> SAP System Installation> Java Add-In for ABAP> MS SQL Server> Central / Distributed System> Java System Finalization.
    TRACE [iaxxgenimp.cpp:845]
    showDialog()
    waiting for an answer from gui
    TRACE [iaxxdlghnd.cpp:180]
    CDialogHandler::doHandleDoc()
    ACTION_OK received
    WARNING 2009-01-09 12:52:33 [iaxxcsihlp.hpp:250]
    main()
    An error occurred during the installation.
    Regadrs
    Vijay

    Hi,
    what do you get executing this statement:
    use <SID>
    go
    select * from sys.objects where schema_id =
    (select schema_id from sys.schemas where name = 'dbo')
    go
    Sven

  • Deleting mailbox without removing user object? Exchange 2010

    In Exchange 2010, How can I delete a mailbox but keep the User Object since this user still access the network??

    Caution: Horror story ahead:
    Yeah, well, the earlier bits of Exchange 2010 don't let you remove Exchange without first removing the mailbox from the mailbox database... this is according to MSFT documentation.  So I highlighted all the users at a customer's 130 user site and clicked
    remove.  S.O.A.B.!!!!  Only to find out one of the other senior techs did the same thing at a 10 user site but didn't tell anybody.
    The worst thing here is that there were no backups of AD.  We were able to restore the deleted user accounts via the aduser tool from sysinternals, but it only got the sam name and the SID, no group memberships, no passwords, not even first name, lastname
    or UPN.  Since AD comes with the recycle bin disabled (dumb because you don't know you have to enable it until you need it.) and the new Windows Server Backup doesn't let you take system state backups without lots of hassle dedicating drives and backup
    locations, we found ourselves royally um... humped.  Still dealing with the after math after restoring the objects for over 6 hours.
    Thanks for the egg on my face MSFT!

  • A function containing switch statement and foreach-object loop

    Hello Guys
    in my testdomain.lab, i have following five OUs in mt test AD structure:
    'OUusers', 'OUcomputers','OUservers','OUadministrators','OUhelpdesks'.
    i have created following five variables:
    $OUusers = 'ou=OUusers,dc=mytestdomain,dc=lab'
    $OUcomputers = 'ou=OUcomputers,dc=mytestdomain,dc=lab'and so on
    now i have created a function which gets this names as input &
    foreach-object creates the related OU.
    but the problem is sometimes when i run my function, maybe some of those five OUs
    currently exist in AD so this will cause a
    terminating error. 
    so i know i must use switch statement to define conditions like this:
    if $OUusers doesn't exist, execute this :  new-ADOrganizationalunit $OUusers
    if $OUcomputers doesn't exist, execute this :  new-ADOrganizationalunit $OUcomputers
    and so on...
    it's a long time which i am trying to create a
    function which contains such switch statement & properly forEach-object loop.
    i have studied switch and foreach-object loops , but this scenario is complicated for me & i was unable to get the correct code.
    Function createOUs {
    # combination of ForEach-Object and Switch statement here
    may someone give me the correct
    command please?
    thanks a lot

    Like this:
    $CompanyRoot=tha'ou=MyCompany, dc=mytestdomain,dc=lab'
    New-ADOrganizationalUnit -Name MyCompany -ErrorAction SilentlyContinue
    $ous='Users', 'Computers','Servers','Administrators','Helpdesk'
    foreach($ou in $ous){
    New-ADOrganizationalUnit -Name $ou -Path $companyroot -ErrorAction SilentlyContinue
    ¯\_(ツ)_/¯
    jrv, That can't be the solution because when you running a command which tries to creates an OU
    which already exist in AD, causes a
    terminating error which has two caveats:
    1- shows red error message on screen
    2- stops and doesn't continue to execute next lines of code
    Note that -ea silentlycontinue and -ea ignore have no effect on
    terminating errors and they cn't hide error messages, also script can't continue.
    i examined that.
    to get sure, run this function in your test AD & see the result:
    function createOUs {
    New-ADOrganizationalUnit -Name 'an-existing-ou' -Protected 0 -ea SilentlyContinue # you see that -ea silentlycontinue has no effect here
    New-ADOrganizationalUnit -Name '2ndOU' -Protected 0 -ea SilentlyContinue # you see that because the previous error has been a terminating error, command execution has been stopped and this 2nd OU hasn't been creatde
     another bad news is ( as i tested), if we query for an Organizational Unit which doesn't exist in AD , it generates a terminating error as well, so again here -ea has no effect.
    test this:
    PS C:\> Get-ADOrganizationalUnit -identity 'ou=nonesense,dc=yourDomain,dc=lab' -ea ignore
    error doesn't disapear ;-)

  • Objects states in an object state

    I am finding it impossible to insert an object state into a state of another object state...
    So that in object state 1 there is another series of object states (B) that would disappear once object state 1 goes to the next state...
    the end result I am trying to achieve is to have a question in an object state that the user can touch to show the answer...
    example: state 1 appears a question...when you touch it the answer appears, in state 2 a different question/answer etc...

    @hooplife – there are two solutions:
    1. InDesign CS5: copy or cut the MSO to the clipboard, paste after selecting the one and only insertion point in the empty text frame with your text tool (= double click the text frame with the selection tool). You can change position of the inserted MSO by using the anchored object options.
    2. InDesign CS5.5 and above:
    if you select an object you may have noticed that there is a new control on every object: the small blue square. Hover your mouse pointer over the square and just follow the instructions of the tool tip.
    In case you have disabled the tool tips function:
    Simply drag the little blue square to the one and only insertion point in the empty text frame.
    Use shift + drag to get the same result like pasting the MSO to the insertion point or:
    use alt + drag to immediately getting the options for anchored objects.
    Uwe

  • Size limitation for all attributes in user objects in Active Directory????

    hi geeks , i wanna know maximum size limit of an user objects attribute in   active directory ... like max amount of character first name attribute can hold ... Thank in advance..

    You can use ADSI Edit to view the properties of the attributes in the Schema container of your AD. In the Schema container you can select an attribute, like Company, right click, select properties, and find the rangeUpper property of the attribute. This
    is the maximum length in characters (or bytes). You can also use dsquery to retrieve rangeUpper for an attribute. For example:
    dsquery * "cn=Schema,cn=Configuration,dc=MyDomain,dc=com" -filter "(LDAPDisplayName=streetAddress)" -attr rangeUpper
    where your domain is MyDomain.com. This finds the maximum length for the "street address" attribute. A few values in my test domain (the values can be modified, so these are the defaults):
    company                      64
    streetAddress              1024
    physicalDeliveryOfficeName  128
    initials                      6
    st                          128
    postOfficeBox                40
    name                        255
    cn                           64
    You can use the first two spreadsheets on this page to help identify attributes in AD (with no Exchange):
    http://www.rlmueller.net/UserAttributes.htm
    The first spreadsheet documents the attributes corresponding to the fields on most of the tabs of ADUC. For example, "st" is the attribute for state, "physicalDeliveryOfficeName" for the field labeled "office". You need the
    LDAPDisplayName's of the attributes, like I used in the dsquery command above. The second spreadsheet documents all attributes in AD with more information, like the syntax and which class each applies to.
    Richard Mueller - MVP Directory Services

  • WCF Service update UPS. Operation is not valid due to the current state of the object.

    I try import custom data to custom user properties from my own wcf service (on sharepoint server machine), but i got
    Message "Operation is not valid due to the current state of the object. "
    on line
    userProfile[PropertyConstants.Department].Value = "SDDDD";
    Why i cant modify property value?
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite site = new SPSite("http://portal.local"))
    SPServiceContext serviceContext = SPServiceContext.GetContext(site);
    using (var web = site.OpenWeb())
    Debug.WriteLine(web.CurrentUser); //Here AppPoolAccount user of current wcf service
    Debug.WriteLine(WindowsIdentity.GetCurrent().Name); //Here too AppPoolAccount user of current wcf service
    UserProfileManager userProfileMgr = new UserProfileManager(serviceContext);
    ProfilePropertyManager profilePropMgr = new UserProfileConfigManager(serviceContext).ProfilePropertyManager;
    ProfileSubtypePropertyManager subtypePropMgr = profilePropMgr.GetProfileSubtypeProperties("UserProfile");
    UserProfile userProfile = userProfileMgr.GetUserProfile(accountName);
    userProfile[PropertyConstants.Department].Value = "SDDDD";
    userProfile.Commit();
    My service running under domain\SPSvcAcc what have full permissions on UPS service, it's management account and UPS admin with full rights.
    If i create console app with identical code and run it under SPSvcAcc account it working without problems
    What i do wrong?

    Hi,
    pls seee if you can add threading like this below to solve the pbm
    https://social.technet.microsoft.com/Forums/office/en-US/b6d6f85c-e12b-4540-a821-690e296b7b56/operation-is-not-valid-due-to-the-current-state-of-the-object-exception-when-activating-a?forum=sharepointdevelopmentprevious
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to set the fetch size for a ResultSet object?

    Connection con  = getConnection();
    Statement stmt = con.createConnection();
    ResultSet res = stmt.executeQuery("select * from table");
    //res.setFetchSize(?);
    while (res.next)
    res.get....
    }I do not know the number of rows .
    How can I set the fetch size for the ResultSet object?
    I try
    res.last();
    res.setFetchSize(res.getRow()/2);
    res.beforeFirst();
    while (res.next)
    res.get....
    }but it's so slow if there are 6000 rows.
    How can I set the fetch size for the ResultSet object more effectible?
    And what is the best number to set the fetch size?

    The fetch size defaults to a standard number. It is unlikely that it will be any faster if you set it unless you only plan to read a small number of rows.
    i.e. if you are going to read all the rows, you need to read all the rows no matter what.
    Unless the system has set the fetch size to 1 changing it will not be faster.
    Depending on the row length, reading in 6000 rows is going to take a long time. You could try using a cpu profiler to improve performance.
    Do you really need to read everything in every row?

  • Package and User Objects of reports/macros/...

    Hello,
    in my program I need to find out the package of a report. So for example I have a report with an include or macro statement. I know which report is included, but not its package.
    The table TRDIR seems to have no information about the containing package and TADIR contains user objects not reports.
    For example a global class ZCL_CAR is realized through reports like ZCL_CAR===(...)===CP and so on. Is there a way to obtain the package of arbitrary reports and the object in TADIR that contains that report? And do you know in which cases a user object can contain other reports?
    - thanks in advance

    Hi clemens heppner,
    Package is there in TADIR table itself
    See the field DEVCLASS
    Or elaborate more about ur requirement...
    Also pls have a look on below tables
    d010inc, trdir, eudb, title, d020t, trkey, tfdir, tmdir, tadir,
    Hope it will solve your problem
    Thanks & Regards
    ilesh 24x7

  • "Operation is not valid due to the current state of the object" error when trying to create a link for a shared folder in OneDrive

    I'm trying to share a folder in OneDrive with another user in my organization, and create a link so that people outside of the company can see the folder. Whenever I try to create a link I get an error that says: "Couldn't create the link sorry something
    went wrong operation is not valid due to the current state of the object" How do I resolve this?

    Hi,
    Sorry for replying late and I noticed that you posted another thread in this forum:
    http://social.technet.microsoft.com/Forums/en-US/2b8c6f54-9c59-4b37-b28f-1d49a1b7913b/operation-is-not-valid-due-to-the-current-state-of-the-object-error-when-trying-to-create-a-link?forum=officeitpro
    I've replied and kindly refer to it to see if it is helpful.
    Regards,
    Melon Chen
    TechNet Community Support

  • Diference bte fetch into statement fetch bulkcollect into statement.

    hi,,
    difference btw fetch into statement and bulk collect into statement.
    differece btw for loop and forall loop.

    Hi,
    Syntax:
    (Select)(Fetch)(execute immediate) … BULK COLLECT Into collection_name [,collection_name, …] [LIMIT max_lines] ;
    LIMIT is used to limit the number of rows returned.
    BULK COLLECT can also be used to retrieve the result of a DML statement that uses the RETURNING INTO clause:
    SQL> Declare
    2 TYPE TYP_TAB_EMPNO IS TABLE OF EMP.EMPNO%Type ;
    3 TYPE TYP_TAB_NOM IS TABLE OF EMP.ENAME%Type ;
    4 Temp_no TYP_TAB_EMPNO ;
    5 Tnoms TYP_TAB_NOM ;
    6 Begin
    7 -- Delete rows and return the result into the collection --
    8 Delete From EMP where sal > 3000
    9 RETURNING empno, ename BULK COLLECT INTO Temp_no, Tnoms ;
    10 For i in Temp_no.first..Temp_no.last Loop
    11 dbms_output.put_line( 'Fired employee : ' || To_char( Temp_no(i) ) || ' ' || Tnoms(i) ) ;
    12 End loop ;
    13 End ;
    14 /
    Fired employee : 7839 KING
    try to understand this example.i think it is sufficient.
    Thanks,
    Sanjeev.

Maybe you are looking for