Problem in query : please urgent

Hi I have this query , all the address_id i am selecting from 3 tables i want to match to another table address where i have to match adrress_id from address table to all the diffrerent address_ids from subquery . But i am getting too many values error . Please help me in writing this query.
select * from address where address_id in (select sh.a_address_id,sh.b_address_id,ph.home_address_id,
ph.work_address_id,cnh.site_address_id,cnh.postal_address_id,
ph.Postal_address_id from service_history@sppmig1 sh, person_history@sppmig1 ph , customer_node_history@sppmig1 cnh where
ph.person_id in ( select person_id from temp_customer_node_history ) and
ph.person_id=cnh.person_id and sh.customer_node_id=cnh.customer_node_id)

select * from address where address_id a
WHERE exists (select 1FROM service_history@sppmig1 sh, person_history@sppmig1 ph , customer_node_history@sppmig1 cnh
WHERE
((a.address_id = sh.a_address_id) or (a.adress_id = sh.b_address_id)
or .....) and
ph.person_id in ( select person_id from temp_customer_node_history ) and
ph.person_id=cnh.person_id and sh.customer_node_id=cnh.customer_node_id)

Similar Messages

  • Query Please Urgent

    SELECT DISTINCT icms_task_assigned.task,icms_task_department.task_department,icms_assigned_to.assigned_to,to_char(icms_task_assigned.target_date,'DD-Mon-YYYY') AS target_date,call_status,icms_task_assigned.remarks,icms_task_assigned.task_id FROM icms_task_assigned LEFT JOIN icms_task_department ON icms_task_department.task_department_id = icms_task_assigned.department LEFT JOIN icms_assigned_to ON icms_assigned_to.assigned_to_id = icms_task_assigned.assigned_to WHERE icms_users.user_id = 1 AND to_char(icms_task_assigned.assigned_date,'YYYY-MM-DD') >= '2006-07-01' AND to_char(icms_task_assigned.assigned_date,'YYYY-MM-DD') <= '2006-07-14' ORDER BY UPPER(target_date)
    The error is
    ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

    You can't use the alias in the order by clause. And what about :
    SCOTT@demo102> select ename,
      2                   case when sal >= 30000 then 'Very high'
      3                        when sal >= 20000 then 'High'
      4                        when sal >= 10000 then 'Medium'
      5                        else 'Low' end as SalStatus
      6            from emp
      7            order by SalStatus;
    ENAME      SALSTATUS
    CLARK      High
    BLAKE      High
    JONES      High
    JAMES      Low
    SMITH      Low
    ALLEN      Medium
    WARD       Medium
    MILLER     Medium
    MARTIN     Medium
    TURNER     Medium
    ADAMS      Medium
    SCOTT      Very high
    FORD       Very high
    KING       Very high
    14 rows selected.
    SCOTT@demo102> Nicolas.

  • Problem in query help me

    hi
    i m having problem in query please help me
    here data is not coming
    SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR  WHERE
    ZBUKR =  P_BUKRS
    AND  UBHKT IN (P_OHKONT).
    loop at int_payr.
    OUT_HBKID = int_payr-W_hbkid  .
    MODIFY INT_PAYR.
    endloop.
    give me advice.
    thanks .

    This example will help you ...
    data: begin of i_mara occurs 0,
                matnr like mara-matnr,
                maktx like makt-maktx,
          end of i_mara.
      data: wa_maktx type maktx.
    select matnr into table i_mara from mara where matnr =
    '000000000000000001'.
       select maktx into wa_maktx from makt
       for all entries in i_mara where matnr = i_mara-matnr.
       endselect.
       loop at i_mara.
          i_mara-maktx = wa_maktx.
          modify i_mara transporting maktx .
       endloop.
    Regards,
    Jayant
    Please award if helpful

  • Problem loading Query Designer Add-in

    Hi All,
    Can anyone please help me on my below issue.
    Whenever user is trying to start a new query in Essbase , he is getting below error message. It will not allow user to build a fresh Essbase pull
    Problem loading Query Designer Add-in. Workbook Activate,open & close operations may not be fully propogated
    Thanks in advance.
    Regards
    Vishal

    Hi Vishal,
    1) Try to remove the addin and then add again.(Before doing this close all the excel process from the task Manager)
    2) Check weather essexcln.xll and essxleqd.xla are corrupted.

  • Qyery problem in query generator

    Hi friends,
    I have one problem regarding query generator.
    I want to take the field value from the active form for query generator. I got in the demo that u have to use $[table.field]. But still I got the error.
    Query which I tried.
    SELECT 'TRUE' FROM OCRD T0 WHERE $[OCRD.CardCode] = '[%0]'
    any one who take the value from active form as a parameter and pass to the query in the query generator please send my the sample query.
    Thanks in advance.

    hi,
    Thanks for your reply.
    When I try to execute the first query from the query generator I got the error.
    Error :-
    Incorrect syntax near $4.0.0
    statement 'Received Alerts' could not be prepared.
    When I try to execute the second query from the query generator I got the error.
    Error :-
    Incorrect syntax near 'Ocrd.cardcode'
    Statement 'Search function (CSHS)' could not bne prepared.
    What would be the reason.
    Please help me in solving this problem.

  • Problem in JAXRPC Webservice - Urgent

    This is Santhakumar.
    I have developed and deployed a JAXRPC webservice in Tomcat5.0 with JWSDP1.5.
    WSDL is created and it works fine for normal java remote methods.
    But when I write a code for to connect a live server ( EPP-Extensible Provisioning Protocol TCP server ), I could not invoke the service.
    I get the following error:
    ================================================================
    C:\examples\jaxrpc\dynamicproxy>ant run
    Buildfile: build.xml
    run-client:
    [java] UrlString = http://localhost:8080/domain-jaxrpc/domain?WSDL
    [java] java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingS
    ender.java:497)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.
    java:294)
    [java] at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvok
    erImpl.java:79)
    [java] at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:48
    2)
    [java] at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallI
    nvocationHandler.java:121)
    [java] at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallI
    nvocationHandler.java:85)
    [java] at $Proxy0.domainCheck(Unknown Source)
    [java] at dynamicproxy.DomainClient.main(Unknown Source)
    run:
    BUILD SUCCESSFUL
    Total time: 3 seconds
    C:\examples\jaxrpc\dynamicproxy>
    ===========================================================================
    I tried in many ways to resolve it.But still I could not find out any solutions.
    Is there any security settings to be handled for that?
    The method works fine and the server is connected  when I execute it from the normal java class in command prompt.
    But when implementing that method in JAXRPC webservice only I found this problem.
    Please share your ideas with me to resolve this problem.I am at urgent.
    Thanks in advance.
    Santhakumar.
    The sample example site used is:
    http://www.cis.umassd.edu/~hxu/Projects/UMD/WebServices/

    Please check the OSS note - 1041204 - Controlling COMMIT WORK in production order BAPIs
    Hope this helps you.

  • Infospoke problem - opeb hub service - urgent

    hello friends,
    I am trying to run one infospoke but getting the below error.
    *The 3rd party status for request ATTRIBUTE_MSGV3 has not yet been set*
    I have checked all the source and traget structures , which are active .
    The source system connection is also OK.
    RFC is also OK .
    Could you please let me know , how to solve this problem , it is quite urgent .
    Thanks

    refer:
    http://help.sap.com/saphelp_nw04s/helpdata/en/a8/a6eae34c9e9b4cbd8fbc7acd2845d0/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f12a03d-0401-0010-d9a7-a55552cbe9da

  • Low level events please URGENT

    hello
    please i have some problem with low level events.please anybody have some solution so please tell me
    basically any language such as c/c++ events are captured by operating system and then focusing on the particular component such as window or textbox etc.
    is there any bypass mechanism in java that we get the lovel level events from any operating system and all to do something.
    please Urgently reply me so that i can try for it, i have some work to do with this stuff.
    thanx in advance
    [email protected]

    You can already get mouse clicks, mouse motions, key presses... what other "low-level" events are you interested in?

  • I am not able to launch FF everytime i tr to open it, it says FF has to submit a crash report, i even tried doing that and the report was submitted too, but stiil FF did not start, and the problem still persists, please help me solve this issue in English

    Question
    I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
    '''(in English)'''

    Hi Danny,
    Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
    but not 180, right?
    I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
    =COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
    or
    =SUM(IIF(Fields!TICKET_STATUS=4,1,0))
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    Restart your WiFi router and printer by removing power for 30 seconds.

  • When i try to open photoshop this shows up Please uninstall and reinstall the product.  If this problem still occurs, please contact Adobe technical support for help, and mention the error code shown at the bottom of this screen.  Error: 16

    i had to take my photoshop file into a hardrive because my dad was going to give me a new Mac and when things didn't work out and went back to my old one i use the time capsule thing to save everything before but didn't give me photoshop so i physically moved the file and tried to open it but then this error shows up
    Please uninstall and reinstall the product.
    If this problem still occurs, please contact Adobe technical support for help, and mention the error code shown at the bottom of this screen.
    Error: 16
    and when i click the uninstall app on the file it tells me this
    The alias “Uninstall Adobe Photoshop CS6 2” can’t be opened because the original item can’t be found
    and when i click fix alias i click on photoshop and the app just turns into photoshop and i just run in circles
    please help thank you

    Run the cleaner tool and reinstall.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    Download CS6 products
    Mylenium

  • View with columns based on function - problem with query

    Hi,
    I'm using Oracle 9i;
    I've created a view which has columns based on a table columns (multiple columns from 1 table) and funtion (multiple columns based on 1 function).
    The function takes ID as the first argument and name of the column to determine which value to return as the second one.
    Here is a sample of such function (simplified):
    FUNCTION my_function
    (in_id IN NUMBER, in_col_name IN VARCHAR2)
    RETURN VARCHAR2
    IS
    c_name VARCHAR2(100);
    c_last_name VARCHAR2(100);
    BEGIN
    SELECT T.NAME, T.LAST_NAME
    INTO c_name, c_last_name
    FROM TABLE_1 T, TABLE_2 Z
    WHERE T.PK = Z.FK
    AND Z.ID = in_id;
    IF in_col_name = 'NAME' THEN
    RETURN c_name;
    ELSIF in_col_name = 'LAST_NAME' THEN
    RETURN c_last_name;
    END IF;
    END;
    For simplicty I've restricted the number of columns.
    CREATE OR REPLACE VIEW my_view
    (ID, NAME, LAST_NAME)
    AS
    SELECT
    T.ID ID
    ,CAST(my_function(T.ID,'NAME') AS VARCHAR2(100)) NAME
    ,CAST(my_function(T.ID,'LAST_NAME') AS VARCHAR2(100)) LAST_NAME
    FROM TABLE T;
    There is no problem with query:
    SELECT * FROM my_view;
    The problem arises when I query the view (regardles of '=' or 'LIKE'):
    SELECT * FROM my_view
    WHERE name LIKE '%some_part_of_name%'
    The query returns rows for same names, for same it doesn't. If I put '=' and the whole name the query returns nothing, but when I put 'LIKE' and the first letter it returns rows in some cases.
    I've tried to debug this situation and I've discovered that the function recives ID not in the proper order and not the same amount of times - in explicit:
    for each ID in (1, 2, 3, 4, 5, 6, ... , 100) the function should be called twice for each ID and in the same order, but it does not.
    I get 1, 1, 2, 3, 3, 6, 20, 20 and so on.
    Help needed.
    Greetings.

    The problem is more complicated than the solutions provided here.
    The reason why I'm using the function is this:
    the original view was constructed using multiple union all selects and the speed was terrible. I've created the index on the base table to obtain a proper sort. For retriving all records at once the view works perfectly, but if one wants to query by columns based on function the results are suprisng - sometimes there are, some times there are none, or if you serch with "like" and only a part of string there are results, but with "=" there are no results.
    Here are real DDLs:
    View:
    CREATE OR REPLACE VIEW V_DOK_ARCH
    (ID_ZDAR, TYP, STAN, DATE_CREATED, CREATED_BY,
    DATE_MODIFIED, MODIFIED_BY, SPRA_ID_SPRA, PODM_ID_PODM, PODM_UMOW_ID_UMOW,
    NR_WFS, WFS_NR_INTER, UWAGI_OPER, FUNDUSZ, NUMER,
    DATA_PODPISANIA, RODZAJ, TYP_PRZY, TYP_UBEZ, NAZWISKO,
    IMIE, IMIE_OJCA, NAZWA_FIRMY, NAZWA_FIRMY_SKR, DANE_KLIE)
    AS
    SELECT /*+ INDEX(Z ZDAR_DATE_CREATED_DESC_I) */
    Z.ID_ZDAR ID_ZDAR
    , Z.TYP TYP
    , Z.STAN STAN
    , Z.DATE_CREATED DATE_CREATED
    , Z.CREATED_BY CREATED_BY
    , Z.DATE_MODIFIED DATE_MODIFIED
    , Z.MODIFIED_BY MODIFIED_BY
    , Z.SPRA_ID_SPRA SPRA_ID_SPRA
    , Z.PODM_ID_PODM PODM_ID_PODM
    , Z.PODM_UMOW_ID_UMOW PODM_UMOW_ID_UMOW
    , Z.NR_WFS NR_WFS
    , Z.WFS_NR_INTER WFS_NR_INTER
    , Z.UWAGI_OPER UWAGI_OPER
    , Z.FUNDUSZ FUNDUSZ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NUMER') AS VARCHAR2(30)) NUMER
    , F_Rej_Zdar_Date(Z.ID_ZDAR, 'DATA_PODPISANIA') DATA_PODPISANIA
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'RODZAJ') AS VARCHAR2(4)) RODZAJ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_PRZY') AS VARCHAR2(4)) TYP_PRZY
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_UBEZ') AS VARCHAR2(3)) TYP_UBEZ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO') AS VARCHAR2(30)) NAZWISKO
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE') AS VARCHAR2(30)) IMIE
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA') AS VARCHAR2(30)) IMIE_OJCA
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY') AS VARCHAR2(300)) NAZWA_FIRMY
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR') AS VARCHAR2(100)) NAZWA_FIRMY_SKR
    , CAST(LTRIM(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA')||F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY')||DECODE(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY'),NULL,F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR'),NULL)) AS VARCHAR2(492)) DANE_KLIE
    FROM T_ZDARZENIA Z
    WHERE F_Rej_Zdar_Char(Z.ID_ZDAR, 'JEST') = 'T';
    and functions:
    CREATE OR REPLACE FUNCTION F_Rej_Zdar_Char
    (WE_ID_ZDAR IN NUMBER
    ,WE_KOLUMNA IN VARCHAR2
    RETURN VARCHAR2
    IS
    c_numer           T_PRZYSTAPIENIA.NUMER%TYPE;--VARCHAR2(30);
    c_rodzaj           T_KLIENCI.RODZAJ%TYPE;--VARCHAR2(1);
    c_typ_przy           T_PRZYSTAPIENIA.TYP_PRZY%TYPE;--VARCHAR2(1);
    c_typ_ubez           T_PRZYSTAPIENIA.TYP_UBEZ%TYPE;--VARCHAR2(3);
    c_nazwisko           T_KLIENCI.NAZWISKO%TYPE;--VARCHAR2(30);
    c_imie                T_KLIENCI.IMIE%TYPE;--VARCHAR2(30);
    c_imie_ojca      T_KLIENCI.IMIE_OJCA%TYPE;--VARCHAR2(30);
    c_nazwa_firmy      T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(300);
    c_nazwa_firmy_skr T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(100);
    c_jest                VARCHAR2(1) := 'T';
    c EXCEPTION;
    BEGIN
    --dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR);
    BEGIN
    SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
    INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
    FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
    WHERE p.KLIE_ID_KLIE = k.ID_KLIE
    AND z.PODM_ID_PODM = D1.ID_PODM
    AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
    AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
    AND D2.PRZY_ID_PRZY = P.ID_PRZY
    AND z.ID_ZDAR = WE_ID_ZDAR;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         BEGIN
         SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
         INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
         FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
         WHERE z.PODM_UMOW_ID_UMOW IS NULL
         AND z.PODM_ID_PODM = D.ID_PODM
         AND D.KLIE_ID_KLIE = k.ID_KLIE
         AND p.KLIE_ID_KLIE = k.ID_KLIE
         AND z.ID_ZDAR = WE_ID_ZDAR;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
              BEGIN
              SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, I.nazwisko, I.imie, I.imie_ojca, I.NAZWA NAZWA_FIRMY, I.NAZWA_SKR nazwa_firmy_skr
              INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
              FROM T_ZDARZENIA z, T_INSTYTUCJE I
              WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
              AND z.PODM_UMOW_ID_UMOW IS NULL
              AND Z.PODM_ID_PODM = I.ID_INST
              AND z.ID_ZDAR = WE_ID_ZDAR;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   BEGIN
                   SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
                   INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                   FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                   WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                   AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
                   AND z.ID_ZDAR = WE_ID_ZDAR;
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                        BEGIN
                        SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
                        INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                        FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                        WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                        AND z.PODM_ID_PODM = a.ID_AGAG
                        AND z.PODM_UMOW_ID_UMOW IS NULL
                        AND z.ID_ZDAR = WE_ID_ZDAR;
                        EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             BEGIN
                             SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
                             INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                             FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                             WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                             AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
                             AND z.ID_ZDAR = WE_ID_ZDAR;
                             EXCEPTION
                                  WHEN NO_DATA_FOUND THEN
                                  BEGIN
                                  SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
                                  INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                  FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                                  WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                                  AND z.PODM_ID_PODM = a.ID_AGKAN
                                  AND z.PODM_UMOW_ID_UMOW IS NULL
                                  AND z.ID_ZDAR = WE_ID_ZDAR;
                                  EXCEPTION
                                       WHEN NO_DATA_FOUND THEN
                                       BEGIN
                                       SELECT k.NUMER_UMOWY NUMER, DECODE(k.TYP_PRZYSTAPIENIA,'P','F','P') RODZAJ,k.TYP_PRZYSTAPIENIA TYP_PRZY,'NPO' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, k.nazwa_firmy nazwa_firmy, k.nazwa_firmy_skr nazwa_firmy_skr
                                       INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                       FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
                                       WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                       AND k.TYP_PRZYSTAPIENIA IN ('P','W')
                                       AND z.PODM_ID_PODM IS NULL
                                       AND z.PODM_UMOW_ID_UMOW IS NULL
                                       AND z.ID_ZDAR = WE_ID_ZDAR;
                                       EXCEPTION
                                            WHEN NO_DATA_FOUND THEN
                                            BEGIN
                                            SELECT k.NUMER_UMOWY NUMER, 'F' RODZAJ,'-' TYP_PRZY,'OPS' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
                                            INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                            FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
                                            WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                            AND z.PODM_ID_PODM IS NULL
                                            AND z.PODM_UMOW_ID_UMOW IS NULL
                                            AND z.ID_ZDAR = WE_ID_ZDAR;
                                            EXCEPTION
                                                 WHEN NO_DATA_FOUND THEN
                                                 BEGIN
                                                 SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, NULL nazwisko, NULL imie_pierwsze, NULL imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
                                                 INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                                 FROM T_ZDARZENIA z
                                                 WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
                                                 AND z.PODM_ID_PODM IS NULL
                                                 AND z.PODM_UMOW_ID_UMOW IS NULL
                                                 AND z.ID_ZDAR = WE_ID_ZDAR;
                                                 EXCEPTION
                                                      WHEN NO_DATA_FOUND THEN
                                                           --dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR||' ostatni wyjatek');
                                                           NULL;
                                                 END;
                                            END;
                                       END;
                                  END;
                             END;
                        END;
                   END;
              END;
         END;
    END;
    --raise c;
    IF WE_KOLUMNA = 'NUMER' THEN
    RETURN c_numer;
    ELSIF WE_KOLUMNA = 'RODZAJ' THEN
    RETURN c_rodzaj;
    ELSIF WE_KOLUMNA = 'TYP_PRZY' THEN
    RETURN c_typ_przy;
    ELSIF WE_KOLUMNA = 'TYP_UBEZ' THEN
    RETURN c_typ_ubez;
    ELSIF WE_KOLUMNA = 'NAZWISKO' THEN
    RETURN c_nazwisko;
    ELSIF WE_KOLUMNA = 'IMIE' THEN
    RETURN c_imie;
    ELSIF WE_KOLUMNA = 'IMIE_OJCA' THEN
    RETURN c_imie_ojca;
    ELSIF WE_KOLUMNA = 'NAZWA_FIRMY' THEN
    RETURN c_nazwa_firmy;
    ELSIF WE_KOLUMNA = 'NAZWA_FIRMY_SKR' THEN
    RETURN c_nazwa_firmy_skr;
    ELSIF WE_KOLUMNA = 'JEST' THEN
    RETURN c_jest;
    END IF;
    END;
    CREATE OR REPLACE FUNCTION F_Rej_Zdar_Date
    (WE_ID_ZDAR IN NUMBER
    ,WE_KOLUMNA IN VARCHAR2
    RETURN DATE
    IS
    d_data DATE;
    BEGIN
    BEGIN
    SELECT p.DATA_PODPISANIA
    INTO d_data
    FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
    WHERE p.KLIE_ID_KLIE = k.ID_KLIE
    AND z.PODM_ID_PODM = D1.ID_PODM
    AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
    AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
    AND D2.PRZY_ID_PRZY = P.ID_PRZY
    AND z.ID_ZDAR = WE_ID_ZDAR;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         BEGIN
         SELECT p.DATA_PODPISANIA
         INTO d_data
         FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
         WHERE z.PODM_UMOW_ID_UMOW IS NULL
         AND z.PODM_ID_PODM = D.ID_PODM
         AND D.KLIE_ID_KLIE = k.ID_KLIE
         AND p.KLIE_ID_KLIE = k.ID_KLIE
         AND z.ID_ZDAR = WE_ID_ZDAR;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
              BEGIN
              SELECT NULL DATA_PODPISANIA
              INTO d_data
              FROM T_ZDARZENIA z, T_INSTYTUCJE I
              WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
              AND z.PODM_UMOW_ID_UMOW IS NULL
              AND Z.PODM_ID_PODM = I.ID_INST
              AND z.ID_ZDAR = WE_ID_ZDAR;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   BEGIN
                   SELECT p.DATA_PODPISANIA DATA_PODPISANIA
                   INTO d_data
                   FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                   WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                   AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
                   AND z.ID_ZDAR = WE_ID_ZDAR;
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                        BEGIN
                        SELECT p.DATA_PODPISANIA DATA_PODPISANIA
                        INTO d_data
                        FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                        WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                        AND z.PODM_ID_PODM = a.ID_AGAG
                        AND z.PODM_UMOW_ID_UMOW IS NULL
                        AND z.ID_ZDAR = WE_ID_ZDAR;
                        EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             BEGIN
                             SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
                             INTO d_data
                             FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                             WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                             AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
                             AND z.ID_ZDAR = WE_ID_ZDAR;
                             EXCEPTION
                                  WHEN NO_DATA_FOUND THEN
                                  BEGIN
                                  SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
                                  INTO d_data
                                  FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                                  WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                                  AND z.PODM_ID_PODM = a.ID_AGKAN
                                  AND z.PODM_UMOW_ID_UMOW IS NULL
                                  AND z.ID_ZDAR = WE_ID_ZDAR;
                                  EXCEPTION
                                       WHEN NO_DATA_FOUND THEN
                                       BEGIN
                                       SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
                                       INTO d_data
                                       FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
                                       WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                       AND k.TYP_PRZYSTAPIENIA IN ('P','W')
                                       AND z.PODM_ID_PODM IS NULL
                                       AND z.PODM_UMOW_ID_UMOW IS NULL
                                       AND z.ID_ZDAR = WE_ID_ZDAR;
                                       EXCEPTION
                                            WHEN NO_DATA_FOUND THEN
                                            BEGIN
                                            SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
                                            INTO d_data
                                            FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
                                            WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                            AND z.PODM_ID_PODM IS NULL
                                            AND z.PODM_UMOW_ID_UMOW IS NULL
                                            AND z.ID_ZDAR = WE_ID_ZDAR;
                                            EXCEPTION
                                                 WHEN NO_DATA_FOUND THEN
                                                 BEGIN
                                                 SELECT NULL DATA_PODPISANIA
                                                 INTO d_data
                                                 FROM T_ZDARZENIA z
                                                 WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
                                                 AND z.PODM_ID_PODM IS NULL
                                                 AND z.PODM_UMOW_ID_UMOW IS NULL
                                                 AND z.ID_ZDAR = WE_ID_ZDAR;
                                                 EXCEPTION
                                                      WHEN NO_DATA_FOUND THEN
                                                           d_data := NULL;
                                                 END;
                                            END;
                                       END;
                                  END;
                             END;
                        END;
                   END;
              END;
         END;
    END;
    IF WE_KOLUMNA = 'DATA_PODPISANIA' THEN
    RETURN d_data;
    END IF;
    END;

  • HT201263 my ipad give me the apple sign without running up it appears all the time in the screen , i tries to reset my ipad , but still in this problem , can you please help me?

    my ipad give me the apple sign without running up it appears all the time in the screen , i tries to reset my ipad , but still in this problem , can you please help me?

    You may want to look at this about using recovery mode to restore your iPad.
    http://support.apple.com/kb/ht4097

  • Whenever i try to sync apps, tones, music etc, it says me to authorize my computer. But i had already authorized it and had even signed into my account. Can you please help me? I am facing this problems since long. please.

    Hey there.
    Please help me.
    Whenever i try to sync apps, tones, music etc, it says me to authorize my computer. But i had already authorized it and had even signed into my account. Can you please help me? I am facing this problems since long. please.
    It goes like this.
    Whenever i connect my iPhone5, it starts to sync. later when it reaches the 4th stage of 'Tranferring Purchases' it stops and says me to Authorize my computer.
    But i had already authorized it and even signed my apple id.
    Moreover, i have only authorized 1 out of my 5 computers.
    Please help me.
    I have been facing this from long.
    Thank You.

    Hi Rameez,
    Thanks for visiting Apple Support Communities.
    The steps in this article can help if iTunes is asking you to authorize your computer repeatedly:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Best,
    Jeremy

  • Problem in query with the u0091Document numberu0092

    Hi,
    I got problem in query with the ‘Document number’
    There are three columns in the cube 1) Document number 2) Country 3) Count
    In the cube there are multiple entries for same document number as below.
          Document number            country          Count
         10000               US          1
         10001               US          1
         10002               US          1
         10002               US          1
         10002               US          1
         10003               UK          1
         10004               IN          1
         10004               IN          1
    When I ran the query on this cube for country US it shows count as 5 but I want count as 3 (i.e. it has to take count only once for the same document no’s)
    Similarly for country IN I want count as 1

    Hi,
    You have to create a counter based on the document number (exception aggregation). There is a How-to paper available for this. It is called: How-to...count the occurences of a characteristic.
    Regards,
    P.

Maybe you are looking for

  • Disgust and Exasperation with BT "Customer Service...

    I am posting this here as really a final attempt to see if anything helpful will actually be done by BT, but I think also as more of a warning to others, as I truly have ben a “victim” of their so called customer service. To make clear, I don’t reall

  • Synchronise my mail on my new iMac and old iPad

    How do i do this so that once an emial is deleted from one of the inboxes it goes from the other? Thanks Skippins

  • Steps to use win 7 with bootcamp on imac7,1

    what steps do I need to do to utilize win 7 with boot camp on my imac7,1 ?

  • Import Time Q for AVCHD

    Hi, Thinking about purchasing an AVCHD camera. I realize AVCHD can take a long time to "import" because you must import the clip and then have the computer convert the clip to AIC. Thus the total import time can be longer than actually 1X (which you

  • Create icon for keyboard shortcut

    I would like to create a DESKTOP ICON for the Keyboard Shortcut    (COMMAND-SHIFT-4) How can this be done ?