Oracle Views with Column type as CLOB

I have a table which has a column of type CLOB. I am trying to creating a view which has all the columns of that table.
I get
Warning: View created with compilation errors.
SQL> show errors;
No errors
Can any one help me how to create a view on a table wihich has a CLOB/BLOB column types. Also how to select the clob data from the view
sree

Are you the owner of the view you created?
Check out the documentation for the SHOW command.
If you omit schema, SHOW ERRORS assumes the object is located in your current schema.

Similar Messages

  • Problem with Column types and String

    Hi
    I have some problem while comparing against empty string.
    My column is of type it_Linked_Button. Actually it seems that column type doesn't matter.
    If cell that belongs to this column is empty and based on other columns' values I put some value into this cell.
    It works fine.
    But when I clear that cell and try to put some value again nothing happens.
    In my if statement I'm checking against empty string and it fails second time.
    Before I put anything in that cell (in debugger) that value is "" so it is empty and it works.
    (OK, I see that after I posted this message it was slightly reformated)
    But after I put something and clear that cell and try to put something again (in debugger) I get "(here is some long space) " which fails String.IsNullOrEmpty(var) test.
    What is going on? Has it something to do with Column type?
    How to clear it so I can put something in it again?
    One more thing - to put values and clear it I use DbDataSource SetValue method. And String.Empty or ""(doesn't matter)
    Thanks
    Kamil
    NOTE
    I made some workaround that gives me the behaviour I want but still I would like to know what is going on?
    Edited by: Kamil Wydrzycki on Sep 24, 2009 12:57 PM

    DrLaszloJamf wrote:
    warnerja wrote:
    DrLaszloJamf wrote:
    1. Could you define an Enum? Then you could switch on enum values.
    2. Wait for Java 7 which is supposed to extend switch to strings?3. Put the target strings in a collection, write a loop to find the match in the collection and use the matching index in the switch statement. At least that will get rid of the hashcode kludge, where it won't mistakenly 'match' a string which isn't the actual target.3b: Map<String, Command>Yep.
    I also wanted to point this out to the OP:
    For example, let's say the 7 character string "BugABoo" happens to have the same hashcode as "EDI_DOC". And let's say your input just happens to have the string "BugABoo" in it, where you're extracting the 7 character substring. See the problem? You're getting "BugABoo" but treating it as if it really were "EDI_DOC", by virtue of comparing hashcodes instead of actual strings.
    OOPS!

  • 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;

  • Joint 2 datatable with column type double with a seperater

    Can anyone please tell me how to merge 2 datatable of column type double with a seperator (|). one with datetime header and 2nd table with integer headers, like this
    table 1
    01/02/2015   01/03/2015
      12346          47894
    table 2
    1               2
    7899       45678
    to become
    01/02/2015        01/03/2015
    12346 | 7899    47894 | 45678
    thanks

    Hi Sysaide,
    According to your description, you'd like to migration the two dataTable to one.
    What is the corresponding relationship of these two DataTables? Or when you migrating, the 01/02/2015 column and 1 column are fixed to one column. what is the relationship between these two columns?
    Or, Does the first column of table1 correspond to the first column of table2? the second correspont to the second? ...
    If the column index is corresponding each other. you could use the following way.
    Getting out the value of each cell, then rebuild a new table to get this new value.
    In your example, your column type is DataTime, but the value in the column is still string type. The below sample is used two different column type, string and int. And I show the result in a dataGridView.
    DataTable dt1 = new DataTable();
    dt1.Columns.Add("01/02/2015", typeof(string));
    dt1.Columns.Add("01/03/2015", typeof(string));
    DataRow dr = dt1.NewRow();
    dr["01/02/2015"] = "11";
    dr["01/03/2015"] = "12";
    dt1.Rows.Add(dr);
    dr = dt1.NewRow();
    dr["01/02/2015"] = "21";
    dr["01/03/2015"] = "22";
    dt1.Rows.Add(dr);
    DataTable dt2 = new DataTable();
    dt2.Columns.Add("1", typeof(int));
    dt2.Columns.Add("2", typeof(int));
    DataRow dr2 = dt2.NewRow();
    dr2["1"] = 1111;
    dr2["2"] = 1122;
    dt2.Rows.Add(dr2);
    dr2 = dt2.NewRow();
    dr2["1"] = 2211;
    dr2["2"] = 2222;
    dt2.Rows.Add(dr2);
    DataTable dt = new DataTable();
    dt = dt1.Clone();
    for (int i = 0; i < dt1.Rows.Count; i++)
    dt.Rows.Add();
    for (int j = 0; j < dt1.Columns.Count; j++)
    dt.Rows[i][j] = dt1.Rows[i][j].ToString() + " | " + dt2.Rows[i][j].ToString();
    this.dataGridView1.DataSource = dt;
    Result:
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • OSB Service with Oracle AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE

    I am trying to write a web-service to Enqueue/Dequeue messages from an AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE defined in Oracle DB.
    In my understanding is that I need to create a JMSModule within weblogic with a ForeignServer defined within it to enqueue/dequeue message to/from the AQ.
    I have created Datasource, JMSServer, JMSModule, ForeignServer (created ConnectionFactory with localJNDIName="MyQueueCF" and RemoteJNDIName as "QueueConnectionFactory" and Destination with localJNDIName="MyQueueDest" and RemoteJNDIName="Queues/<queue_name_in_DB>")
    My business service has an endpoint "http://localhost:7001/MyQueueCF/MyQueueDest"
    When I am testing my service to populate message on to the Queue. I get the following error:
    The error was oracle.jms.AQjmsException: Error creating the db_connection
    My questions are:
    * Am I following the correct procedure to talk to AQ with JMS text message type payload?
    * If yes, how can I get around the issue I am stuck with?
    Please help!
    Thanks.
    Edited by: user4696353 on 27-Sep-2011 11:43
    Edited by: user4696353 on 27-Sep-2011 11:49
    Edited by: user4696353 on 27-Sep-2011 12:25

    Example:
    conn / as sysdba
    begin
    dbms_aqadm.create_queue_table
    ( queue_table=> 'SCOTT.AQJMS'
    , queue_payload_type=> 'SYS.AQ$_JMS_TEXT_MESSAGE'
    , compatible=> '9.1'
    end;
    This worked fine for me after a standard DB-installation.

  • Oracle Views with input

    Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
    Hi Experts,
    Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
    The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
    create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
    as
    SELECT Col1,Col2
    FROM table_name1
    where any_column11 in (
    &P_inputparam
    UNION
    SELECT Col1,Col2
    FROM table_name2
    where any_column22 in (
    &P_inputparam
              Thanks In advance.
    Edited by: 883279 on May 10, 2013 1:41 AM

    883279 wrote:
    Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
    Hi Experts,
    Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
    The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
    create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
    as
    SELECT Col1,Col2
    FROM table_name1
    where any_column11 in (
    &P_inputparam
    UNION
    SELECT Col1,Col2
    FROM table_name2
    where any_column22 in (
    &P_inputparam
              Thanks In advance.
    Not like that... no.
    What you're using as "input" there are SQL*Plus substitution variables. Those values are requested by SQL*Plus before the code is sent to the database and compiled. Code that runs on the database has no way of interacting with a client keyboard or screen, so you cannot get stored code to prompt for user input.
    See: {message:id=10744582}
    It's possible to use SYS_CONTEXT to get a view to pick up a value that has been previously assigned before the view is used, though I rarely find a need to do this myself.

  • Replicate an oracle view with SLT

    Hi -
    Using Oracle 11g and SLT 2011_1_731 Patch 7 with Hana rev 82
    I am trying to replicate oracle views in hana through SLT
    Scenario 1:
    tables T2 and T3 with View T2_T3_view
    If I follow this thread  SLT view replication
    It creates the view as a table in hana  but does not populate it with any data.
    Scenario 2 -
    I have 2 oracle tables - T4 and T5.  I have a view T4_T5_VIEW that joins the 2 tables.
    I followed steps in a document I received to replicate the view syntax as well as the tables.
    1) replicated both tables T4 and T5 - success
    2) stopped replication on T4
        table exists in hana with data but no replication
    3) using LTRS, assigned the view T4_T5_VIEW to table T4
    4) changed the performance option
    5) restarted replication on T4
    The view gets created as a table, but table T4 gets and error and does not replicate.
    The view gets no data
    What is the proper process for an oracle table?
    I have a very complex view with 5 source tables I want to replicate.
    Thanks
    Diane

    sorry,
    with the query
    SELECT TAB2.COD_M ,
    COUNT(TAB1.COD_MAT) count_mat
    FROM TAB2,
    TAB1
    WHERE TAB2.COD_R (+) = TAB1.COD_MAT
    AND TAB1.COD_R IN ('1','3')
    GROUP BY TAB2.COD_M
    I get:
    COD_M..........COUNT_MAT
    00114940...........1
    00116220...........1
    00116300...........2
    00119320...........1
    00119450...........1
    ...................0
    but I'd like to get this output:
    COD_M..................count_mat
    00114940...................1
    00114949...................0
    00116220...................1
    00116300...................2
    00119324...................0
    00119450...................1

  • Materialized View with column based on PL/SQL function returning object

    I have the following problem - it is known that materialized view wants PL/SQL functions used in it to be DETERMINISTIC. And it appears that a function which returns SDO_GEOMETRY cannot be DETERMINISTIC - I can add DETERMINISTIC modifier to my function which returns sdo_geometry based on USNG grid ID and save the package, and it compiles and runs fine with regular queries, but when it comes to materialized view (mview), the following error is thrown:
    ORA-12018: following error encountered during code generation for "SCHEMA"."MVIEW_NAME"
    ORA-00932: inconsistent datatypes: expected NUMBER got MDSYS.SDO_GEOMETRY
    Looks like DETERMINISTIC modifier is not fully supported for object types. I have tried to use SDO_CS.FROM_USNG Oracle's function, and it appeared that this function is also non-deterministic - I cannot refresh mview with P or F on-demand refresh method (see http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14223/refresh.htm#i1008349 for a list of on-demand refresh methods). Without that function I can refresh mview with P or F flags.

    Hi,
    Yes, the Chart Series can be based on "Function Returing SQL Query" and the "SQL" would be something like:
    DECLARE
    vSQL VARCHAR2(1000);
    BEGIN
    vSQL := 'SELECT NULL LINK, ENAME LABEL, SAL VALUE FROM EMP ORDER BY ENAME';
    RETURN vSQL;
    END;You should tick the "Save query without validation" underneath that. Without this, there is a validation error - the ; at the end is required to get the chart to function correctly but the validator sees this as an error.
    You would need to create this separately from the report. No matter how you did it, the chart would still run a SQL statement to generate the output. If you wanted to use the "same data", then you could create a collection using the PL/SQL and base both the report and the chart on the collection instead.
    Andy

  • How to insert long text data in oracle for LONG column type??

    Anybody who can tell me what is best way to store long text (more than 8k) in Oralce table.
    I am using Long datatype for column but it still doenst let me insert longer strings.
    Also I am using ODP.Net.
    Anybody with a good suggestion???
    Thanks in advance

    Hi,
    Are you getting an error? If so, what?
    This works for me..
    Greg
    create table longtab(col1 varchar2(10), col2 long );
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using System.Text;
    public class longwrite
    public static void Main()
    // make a long string
    StringBuilder sb = new StringBuilder();
    for (int i=0;i<55000;i++)
    sb.Append("a");
    sb.Append("Z");
    string indata = sb.ToString();
    Console.WriteLine("string length is {0}",indata .Length);
    // insert into database
    OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
    con.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.CommandText = "insert into longtab values(1,:longparam)";
    cmd.Connection = con;
    OracleParameter longparam = new OracleParameter("longparam",OracleDbType.Long,indata .Length);
    longparam.Direction = ParameterDirection.Input;
    longparam.Value = indata ;
    cmd.Parameters.Add(longparam);
    cmd.ExecuteNonQuery();
    Console.WriteLine("insert complete");
    //now retrieve it
    cmd.CommandText = "select rowid,col2 from longtab where col1 = 1";
    OracleDataReader reader = cmd.ExecuteReader();
    reader.Read();
    string outdata = (string)reader.GetOracleString(1);
    Console.WriteLine("string length is {0}",outdata.Length);
    //Console.WriteLine("string is {0}",outdata);
    reader.Close();     
    con.Close();
    con.Close();
    }

  • How to disable Oracle table NUMBER column type auto round-up

    Below is an example,
    SQL> create table a
    a_col1 NUMBER(8, 2)
    SQL> update a set a_col1=1.999 where ...
    I found column 'a_col1' of table 'a' value will be 2.00, but the application is for some financial calculation and doesn't allow any difference of the amount value (like, 1.999 <> 2.00), what I want to achieve is to disable the Oracle NUMBER type auto round-up and make above 'update' SQL fail with error, so I can trap the error and handle it in the program.
    Could anyone advise me how to achieve above or any good suggestion ? Thanks.

    user12317666 wrote:
    Below is an example,
    SQL> create table a
    a_col1 NUMBER(8, 2)
    SQL> update a set a_col1=1.999 where ...
    I found column 'a_col1' of table 'a' value will be 2.00, but the application is for some financial calculation and doesn't allow any difference of the amount value (like, 1.999 <> 2.00), what I want to achieve is to disable the Oracle NUMBER type auto round-up and make above 'update' SQL fail with error, so I can trap the error and handle it in the program.
    Could anyone advise me how to achieve above or any good suggestion ? Thanks.Oracle does not auto-round.
    you have data presentation problem; not data storage problem.

  • How to create a view with columns from multiple rows

    I have posted this in SQL/PSL forum, but I hope database experts in this group can give me ideas too, also the need is from BI reports.
    I have a table, say, project_milestones, which has these columns in concern:
    proj_id, milestone_name, actual_end_date
    with data:
    proj_id, milestone_name, actual_end_date
    ===== ================ ==============
    1001, Key Element Approve, 2009-10-02
    1001, Final Synopsis, 2009-10-07
    1001, Final Protocol Approved, 2009-10-15
    1001, FPFV, 2010-01-10
    1001, LPFV, 2010-03-12
    1002, Key Element Approve, 2008-12-02
    1002, Final Synopsis, 2009-01-07
    1002, Final Protocol Approved, 2009-01-12
    1002, FPFV, 2009-03-30
    1002, LPFV, 2009-10-04
    There are about 10 milestones in each project.
    I have to create a view to flat these data at project level, looks like this:
    proj_id, key_element_date, final_synopsis_date, final_protocol_approved_date, FPFV_date, LPFV_date, key_element_to_final_synopsis_days, final_synopsis_final_protocol_days, ....
    How can I do this?
    Thanks,

    user9175541 wrote:
    I have posted this in SQL/PSL forum, but I hope database experts in this group can give me ideas too, also the need is from BI reports.
    I have a table, say, project_milestones, which has these columns in concern:
    proj_id, milestone_name, actual_end_date
    with data:
    proj_id, milestone_name, actual_end_date
    ===== ================ ==============
    1001, Key Element Approve, 2009-10-02
    1001, Final Synopsis, 2009-10-07
    1001, Final Protocol Approved, 2009-10-15
    1001, FPFV, 2010-01-10
    1001, LPFV, 2010-03-12
    1002, Key Element Approve, 2008-12-02
    1002, Final Synopsis, 2009-01-07
    1002, Final Protocol Approved, 2009-01-12
    1002, FPFV, 2009-03-30
    1002, LPFV, 2009-10-04
    There are about 10 milestones in each project.
    I have to create a view to flat these data at project level, looks like this:
    proj_id, key_element_date, final_synopsis_date, final_protocol_approved_date, FPFV_date, LPFV_date, key_element_to_final_synopsis_days, final_synopsis_final_protocol_days, ....
    How can I do this?
    Thanks,Create a pivot table and put "milestone_name" in the Columns section under the Labels.
    Put "actual_end_date" in the Measures section and change the Aggregation Rule to "Max."
    The rest of the attributes keep in Rows section.

  • Customizing WAD report chart view with input types(pie, line etc..)

    Hi All
    I am very much new to WAD, now i have a requirement where in i am viewing a query output as a chart, but here the added features that need to be embedded are, adjacent to the chart view i have 4 radio buttion say
    1)area view
    2)coloumn view
    3)Line view
    4)Pie view
    Based on the radio button selection the chart view must change, so please guide me how can i achieve this funstionality.
    Regards
    VK

    Hi VK,
    1>>> use container  in that container use all the 4 charts
    2>>>make the 2> 3> 4> charts hidden
    3>>> use 4 radio buttons beside the chart give names as area column line and pie
    4> for area buttom use the command SET_ITEM_PARAMETERS make area chartvisible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide colomn chart
    ^^^^^^^^^       2> to hide line chart
    ^^^^^^^^^       3> to hide pie chart
    5> for colomn buttom use the command SET_ITEM_PARAMETERS make colomn chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
    ^^^^^^^^^       2> to hide line chart
          ^^^^^^^^^ 3> to hide pie chart
    6> for line buttom use the command SET_ITEM_PARAMETERS make line chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
         ^^^^^^^^^  2> to hide column chart
        ^^^^^^^^^   3> to hide pie chart
    7> for Pie buttom use the command SET_ITEM_PARAMETERS make Pie chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
    ^^^^^^^^^      2> to hide column chart
       ^^^^^^^^^    3> to hide Line chart
    check the following links before , it will help you to start
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/934291ff0b274ee10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/935812ff0b274ee10000000a422035/content.htm
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0f7d724-c0f0-2d10-828f-be249d59b5c3
    Regards,
    Ranganath

  • Using EBS Oracle views with Discoverer

    Hi everyone
    Does anyone have experience of working with the standard EBS BI install for R12? If so, I'd like the opportunity to discuss it with you.
    Please email me on [email protected] so I can pick your brains. :-)
    Best wishes
    Michael

    Hi everyone
    Does anyone have experience of working with the standard EBS BI install for R12? If so, I'd like the opportunity to discuss it with you.
    Please email me on [email protected] so I can pick your brains. :-)
    Best wishes
    Michael

  • Problems on selecting views with french characters into column names

    Hi All,
    I have views with column names such as "Détermination Planimétriq" or "Année de construction:*";
    I can get in my c# function this columns names from ALL_VIEWS dictionary table, but if I try to make a selectionby use of an OracleCommand, Oracle returns an "Invalid identifier" error:
    SELECT "Détermination Planimétriq" FROM mytable;
    System.Data.OracleClient.OracleException (0x80131938): ORA-00904: "Determination Planimetriq": invalid identifier at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) at ...
    Any suggestion?...

    Be wary of using character codes outside the Western European "simple" alphanumeric [A-Z0-9] for object names, i.e. columns, table names, function and procedure names, and so on.
    First reason, there is a 30 character limit for most object names, and characters that have to be spelled out with unicode characters take more space, i.e.:
    select dump( 'Détermination Planimétriq'  ) from dual;
    DUMP('D?TERMINATIONPLANIM?TRIQ')
    Typ=96 Len=29: 68,239,[ ... ]Although the varchar string for that column name looks like 25 characters, it needs room for 29 to store the e<acute> character. And could also depend on the client settings. Using case sensitive names is not a best practice, its better to avoid specifying objects with the double quotes.
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements008.htm#i27570

  • Proper showing value of a column type chart in BI 7.0

    Hi,
    I am in BI 7.0.  I created a Web template with column type chart.  I want to show the column value only when users move the cursor on top of the column.
    The problem is when system showing value also show the category/serious and category description.  Is there any way to show value only?
    Thanks for your help,
    Frank

    Hi Wond,
    Thanks for your quick response. 
    Your solution is for BW 3.5 or BI 7.0?  I remember with BW 3.5, WAD has chart property and option.  But, I don’t think BI 7.0 has chart option.  I am with BI 7.0.  I clicked on property and nothing happens.  I don’t know is my system setup issue or other.  When I modify chart property, I have to use Edit -> Wizard or Refine.
    Any other solution?
    Regards,
    Frank

Maybe you are looking for

  • Integrated WebLogic Server won't start

    Hi, Hope someone can help asap, as I am about to tear my hair out :-) Hopefully it's something straight forward and just can't see it from staring at it for too long!! OS: Windows 7 Pro 64-bit Same happens, with or without the WebCenter Extensions in

  • What optical audio cable to use with Mac Mini (late 2009) to receiver?

    I want to do the following (removing TiVo for something else is NOT an option, EVER): 1) I want to watch TV through my HD TiVo (better than sex, better than chocolate, better than sex, chocolate, and anything else you can combine together). 2) I want

  • Security - Preventing "Save As" Functionality

    I am a user of Version 8 and have established password security in its strictest form.  My problem is that the Save As functionality is not prevented.  So you can perform a Save As file operation.  The new file does retain all the password security t

  • Webcam VF0070..why cant i adjust the "white balance"?

    i am running windows XP home edition, with the latest updates. i am using the webcam model VF0070. under the options for this webcam, i can change virtually every option EXCEPT the white balance? the white balance is set all the way to the LEFT. can

  • Can Not Copy Music From iTunes to iPhone

    OK, I have an album in iTunes that when I try and click and drag to the phone will not go. Why? Anyone can help it would be most appreciated. Thanks, CP