Get ORA-01489: with tabular

Hello

I have a tabular presentation that has a couple of apex_item.select_list_from_lov in the source query, for example

SELECT Apex_item.hidden (1
NULL
)
|| apex_item.select_list_from_lov (4
NULL
, "LOV_POLICY".
, "style =" width: 170px "'"
|| ')"'
'NO '.
NULL
NULL
, "f04_".
|| LPAD (9900
+ LEVEL
4
, '0'
)
NULL
)
|| apex_item. Hidden (3
NULL
) policy_name
.....

I now get an ORA-01489: result of concatenating string is too long error. It was working fine but the LOV which depends on one of the points went to a hundred documents, or so I'm half guess that the apex_item function creates a static string more than 4,000 characters, and thus the error.

This has large implications for our application as long as there are several tabular forms that display data in this way (I assume that apex_item.select_list_from_query is no different) and it is likely that these selection lists will grow over time.

Someone has encountered this problem themselves and found a solution? We have an Ajax solution but this will involve rewritten considerable and we have little time.

Any suggestions greatly appreciated...

Hello

Do something like the following:

1. create a LOV to SELECT NULL, NULL Ruy FROM DUAL and use this instead LOV_POLICY
2. on your APEX_ITEM, add in the parameter which allows additional values
3. under your existing area, create a new PL/SQL area that generates the actual values using something like:

DECLARE
 vSEP VARCHAR2(1);
BEGIN
 vSEP := '';
 htp.p('<script type="text/javascript">');
 htp.p('var sMaster = new Array(');
 FOR c IN (SELECT DNAME d, DEPTNO r FROM DEPT ORDER BY UPPER(DNAME))
 LOOP
  htp.p(vSEP || 'new Array (' || c.r|| ',"' || c.d|| '")');
  vSEP := ',';
 END LOOP;
 htp.p(')');
 htp.p('</script>');
END;

4. create another region below which set it on have No model and the source of the value:

<script type="text/javascript">
function updateList(sChild)
{
 var o;
 var sChildValue = sChild.value;
 sChild.options.length = 0;
 o = new Option('-Select-', '');
 sChild.options.add(o);
 var k;
 for (k = 0; k < sMaster.length; k++)
 {
  o = new Option(sMaster[k][1], sMaster[k][0]);
  sChild.options.add(o);
 }
 sChild.value = sChildValue;
 if (sChild.selectedIndex == -1)
 {
  sChild.selectedIndex = 0;
 }
}
function updateLists()
{
 var lists = document.getElementsByName("f04");
 var k;
 var x;
 if (lists)
 {
  for (k = 0; k < lists.length; k++)
  {
   updateList(lists[k]);
  }
 }
}
updateLists();
</script>

Now, when the page loads, each selection list will show a null value and the actual value. In this report, will be generated a javascript array that contains the appropriate values for the lists. Following that will be the JavaScript that traverses the playlists selection and fills them with the content of the table.

The benefits of doing it this way are double - you work around issues with lengths of chain and the page will actually load a lot faster.

Tags: Database

Similar Questions

  • Get ORA-28562 with link of database when select NULL via ODBC

    Hello

    This is my first post of the time issue in this community.  Apologies if this isn't the right place to start and lease let me know where to post this instead.

    I have a database link to connect via odbc to Ingres.  Everything works as expected but when I try to select ODBC (HS), where the column is NULL, it returns the error:

    Select * from mynull@ingres;

    ORA-28562: heterogeneous Services data truncation error

    ORA-02063: preceding line of INGRES

    This is the track that counts:

    hgoftch2, line 139: print hoada @ 0xe55288

    MAX: 1, SIZE: 1, BRC:1, WHT = 5 (SELECT_LIST)

    hoadaMOD bit-values found (0x200: TREAT_AS_CHAR)

    DTY NULL-OK LEN MAXBUFLEN PR/SC CSE IND MOD NAME

    VARCHAR Y 1 1 12 0 / 0 0 0 200 col1

    SQLFetch: rank: 1, column 1, bflsz: 2, bflar:-1

    SQLFetch: rank: 1, column 1, bflsz: 2, bflar: SQL_NULL_DATA

    1 lines read

    Here's the hsinit:

    #

    # HS init parameters

    #

    HS_FDS_CONNECT_INFO = rd-cdsuat02

    HS_FDS_TRACE_LEVEL = DEBUG

    HS_FDS_TRACE_LEVEL0 = 255

    #HS_FDS_FETCH_ROWS = 1

    HS_FDS_SHAREABLE_NAME = /opt/Ingres/IngresII/ingres/lib/libiiodbcdriver.1.so

    HS_LANGUAGE = AMERICAN_AMERICA.we8iso8859P1

    #HS_KEEP_REMOTE_COLUMN_SIZE = REMOTE

    #

    # ODBC specific environment variables

    #

    Set ODBCINI=/opt/Ingres/IngresII/ingres/files/odbc.ini

    The values in the table mynull on the side of Ingres is added as follows:

    create table mynull (col1 char (1) with the null value);

    insert into mynull values (NULL);

    The idea is to use the database link to convert the Ingres on Oracle data.  I have the tables all created and copied 90% of the data, but stuck with all the data that has NULL values in it.  Can someone tell me what I did not right?

    Thank you

    HY

    Hi Mike,.

    Thanks for spending the time to answer my question.  Just to let you know that I discovered that I need to add this in my hs init file:

    HS_FDS_SQLLEN_INTERPRETATION = 32

    This solved the problem I have.  Now, I get NULL value correctly.  Before closing the issue, here is the info you requested.  Thanks again for the help.

    1. you use DG4ODBC to connect to Ingres?  If so, what is the version?

    Yes, not sure about the version that is part of the Oracle 12 C.
    2. What is the name and the version of the ODBC of Ingres driver that you use?

    The driver name is Ingres and version: 3.50.1010.0137

    3. What is returned by - describe "mynull"@gtw_link ".

    -do not put a semicolon at the end of the describe.

    02:04:21 wswmvzwd [SYS] > describe mynull@ingres

    Name                                                                               Null?    Type

    ----------------------------------------------------------------------------------------------------------- -------- ------------------------------------------------------------------------

    col1                                                                                VARCHAR2(1)

    4. what happens if you use NVL in the selection from Oracle?

    Previously, it is fixed:

    12:15:39 wswmvzwd [SYS] > select * from mynull@ingres;

    ERROR:

    ORA-28562: heterogeneous Services data truncation error

    ORA-02063: preceding line of INGRES

    no selected line

    Elapsed time: 00:00:00.13

    After it is fixed (added HS_FDS_SQLLEN_INTERPRETATION = 32):

    12:17:03 wswmvzwd [SYS] > select nvl ("col1", 'NULL') of mynull@ingres;

    NVL)

    ----

    NULL VALUE

    A

    NULL VALUE

    5. you have-
    HS_FDS_SHAREABLE_NAME = /opt/Ingres/IngresII/ingres/lib/libiiodbcdriver.1.so

    -is the Ingres driver or a driver manager libiiodbcdriver.1.so?

    Ingres driver
    -If the pilot can you confirm it offers the features of driver as Manager?

    Yes, I was able to check it out since the Manager ODBC INgres for the test.

    6. can you upload a track of comprehensive gateway somewhere so that see us? Use-

    HS_FDS_TRACE_LEVEL = 255

    for the trace.

    Since it is resolved, I'll ignore it.  Part of the debugging information is in the original post.

    Thanks again Mike, really appreciated.

    HY

  • "ORA - 01489:result of concatenation of string is too long" (the chain is small)

    Hello

    I am using the listagg as follows function but get ORA-01489: result of concatenating string is too long.

    SELECT LOCATIONID, LISTAGG (TO_CHAR (WHICH |)) ',' || (POSITIONY), ',') ADR WITHIN GROUP (ORDER BY SEQUENCENUMBER)
    OF POSITIONPOINTS
    GROUP BY LOCATIONID
    AFTER HAVING COUNT (SEQUENCENUMBER) = 20;

    When I try to run this in Oracle Sql Developer, he shows the lines first in 1550, then reports the error ORA-01489. In total 2612 lines must be returned, all values in ADR having a length of approximately 440 characters. An example of one of the lines that developer Sql is back is:

    22372682 410434.801,551142.885,410434.784,551142.875,410439.801,551141.922,410439.991,551141.795,410439.293,551138.303,410438.531,551137.668,410429.768,551134.302,410427.228,551133.159,410426.212,551132.143,410425.196,551129.667,410421.957,551114.3,410414.972,551081.28,410413.639,551076.136,410412.94,551073.66,410412.94,551072.326,410413.639,551071.628,410415.798,551070.612,410416.369,551069.469,410416.877,551068.834,410433.23,551061.795

    There are a few LocationIDs in table PositionPoints that have more than 20 entries (max is 254), and for these lines, I want the concatenated string more than the maximum of 4000 characters. However, where count (sequencenumber) = 20, the length of the concatenated string would be less than 500. Oracle running concatenations even for places that I've excluded with my HAVING clause and an error on these?

    I tried to run the query at the time Oracle Sql Developer and SQL Plus.

    Would be grateful if someone could shed some light on this issue.

    Thank you

    Ronnie m says:
    Oracle running concatenations even for places that I've excluded with my HAVING clause and an error on these?

    Yes, that's the explanation.
    HAVING is not WHERE it is applied after the grouping is performed.

  • Aggregation of chain - ORA-01489

    Hi, I get ORA-01489 for the following query. Basically, I'm performing aggregation of chain:

    SELECT LTRIM (REPLACE (sys_connect_by_path (expression, ':'), ': ',' '), ',')
    IN clob_variable
    FROM (SELECT * FROM tb_metadata_detail WHERE performance_metadata_id = 2) TDG
    WHERE connect_by_isleaf = 1
    CONNECT BY performance_metadata_detail_id = BEFORE
    performance_metadata_detail_id + 1
    START WITH performance_metadata_detail_id = 1;

    I heard to_clob can help. but where to put it?

    still get ora-01489

    try another approach:

    select xmlagg (
              xmlelement (e, expression || ',') order by performance_metadata_detail_id
           ).extract ('//text()').getclobval ()
      from tb_metadata_detail
     where performance_metadata_id = 2
    
  • Get ORA-00942 error with the clause, but not when the user sys.

    Hello

    About 3 weeks ago we increased our memary to PGA_aggregate_target = 60 GB, SGA_target = 58 GB Oracle instance. About 1 week ago our cognos user started having errors ORA-00942 for these queries generated with clause, with the same authorization. i.e.

    with 'aBmtQuerySubject4' as
    (select "BANK_NOTE_ADI_INFO_T". ' ' PRINT_BATCH_ID ' 'PRINT_BATCH_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' PROCESS_RUN_DT ' 'PROCESS_RUN_DT '.
    'BANK_NOTE_ADI_INFO_T '. ' ' RDP_ID ' 'RDP_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' FI_ID ' 'FI_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' DEPOSIT_NB ' 'DEPOSIT_NB '.
    'BANK_NOTE_ADI_INFO_T '. ' ' PROCESS_MACHINE_ID ' 'PROCESS_MACHINE_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' OUTPUT_STACKER_TYPE_CE ' 'OUTPUT_STACKER_TYPE_CE '.
    'BANK_NOTE_ADI_INFO_T '. ' ' PARTITION_KEY ' 'PARTITION_KEY '.
    'BANK_NOTE_ADI_INFO_T '. ' ' LOAD_ID ' 'LOAD_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' SERIAL_NUMBER_ID ' 'SERIAL_NUMBER_ID '.
    'BANK_NOTE_ADI_INFO_T '. ' ' SHIFT_NB ' 'SHIFT_NB '.
    'BANK_NOTE_ADI_INFO_T '. ' ' BANK_NOTE_COUNT_NB ' 'BANK_NOTE_COUNT_NB '.
    of "BOISI '." BANK_NOTE_ADI_INFO_T' 'BANK_NOTE_ADI_INFO_T '.
    )
    'CountResultQuery5' as
    (select count ("aBmtQuerySubject4". "BANK_NOTE_COUNT_NB") 'C_1' "
    , count (1) 'C_2' of 'aBmtQuerySubject4 '.
    After having count (*) > 0)
    Select 'CountResultQuery5 '. "' C_2 ' 'Count1.
    of 'CountResultQuery5 '.
    ;


    with 'aBmtQuerySubject4' as
    (select "BANK_NOTE_ADI_INFO_T". ' ' LOAD_ID ' 'LOAD_ID '.
    of "BOISI '." BANK_NOTE_ADI_INFO_T' 'BANK_NOTE_ADI_INFO_T '.
    )
    'CountResultQuery5' as
    (select count ("aBmtQuerySubject4". "LOAD_ID") 'C_1' "
    , count (1) 'C_2 '.
    of 'aBmtQuerySubject4' having count (*) > 0
    )
    Select 'CountResultQuery5 '. "' C_2 ' 'Count1' of 'CountResultQuery5 '.
    ;

    -output like:

    'BANK_NOTE_ADI_INFO_T '. ' ' PROCESS_RUN_DT ' 'PROCESS_RUN_DT '.
    *
    ERROR at line 3:
    ORA-00942: table or view does not exist


    of "BOISI '." BANK_NOTE_ADI_INFO_T' 'BANK_NOTE_ADI_INFO_T '.
    *
    ERROR at line 3:
    ORA-00942: table or view does not exist

    Since 2 days ago, we get ORA-0403.

    One thing I noticed that the coguser can run above queries correctly after they are run by a user sys...

    Could you please help me on how I can resolve ORA-00942 error?

    Thank you very much, much in advance for all your help and your advice! :-)

    Jihong.

    "One thing I've noticed the coguser can run over queries correctly after they are run by a user sys... »

    Jihong,

    Do you mean that queries can be run successfully as a sys user, or as long as once a sys cognos user user has run the query at least once?

    Gerard

  • log in - help sql: error ORA-01489: string concatena result

    Here's a sql query and I am cooking a decoding, but since there are several columns invloved when I try to run it I get the following error:
    ORA-01489: result of concatenating string is too long

    Any kind of help is appreciated, I need to get it going or I'm dead :(

    Concerning
    Rahul



    SQL:
    Select sys_connect_by_path(c.decode_prep,'-') decode_prep
    from (select "DECODE (BIAPPS_11.'|)") substr (b.all_cols, InStr(b.all_cols,',',1,a.RN) + 1, InStr(b.all_cols,',',1,a.RN+1)-InStr(b.all_cols,',',1,a.RN)-1). «, » ||' RAHULKALRA.' | substr (b.all_cols, InStr(b.all_cols,',',1,a.RN) + 1, InStr(b.all_cols,',',1,a.RN+1)-InStr(b.all_cols,',',1,a.RN)-1) |', "1", "0")' decode_prep, rownum curr, prev rownum-1
    from (select rownum rn
    Double connect rownum < =.
    (select (length('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM ,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT ,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM')
    - length(replace('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM ,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT ,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM',',')))+1 total_cols
    the double)), (select ',' |') ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE ,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT SRC_EFF_FROM_DT , SRC_EFF_TO_DT, EFFECTIVE_FROM_DT, EFFECTIVE_TO_DT, DELETE_FLG, CURRENT_FLG, W_INSERT_DT, W_UPDATE_DT, DATASOURCE_NUM_ID, ETL_PROC_WID, INTEGRATION_ID, SET_ID, TENANT_ID, X_CUSTOM' | (',' double all_cols) b) c
    Start by curr = 1
    Connect prior curr = prev
    length (sys_connect_by_path(c.decode_prep,'-')) desc order

    ---------------------------------------------------------------------------------------------

    same as above sql only the difference is here I'm pulling the first record in the result set that top query returns:

    Select ltrim (replace(decode_prep,'-','||'),'| ') decode_prep
    of (sys_connect_by_path(c.decode_prep,'-') select decode_prep)
    from (select "DECODE (BIAPPS_11.'|)") substr (b.all_cols, InStr(b.all_cols,',',1,a.RN) + 1, InStr(b.all_cols,',',1,a.RN+1)-InStr(b.all_cols,',',1,a.RN)-1). «, » ||' RAHULKALRA.' | substr (b.all_cols, InStr(b.all_cols,',',1,a.RN) + 1, InStr(b.all_cols,',',1,a.RN+1)-InStr(b.all_cols,',',1,a.RN)-1) |', "1", "0")' decode_prep, rownum curr, prev rownum-1
    from (select rownum rn
    Double connect rownum < =.
    (select (length('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM ,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT ,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM')
    - length(replace('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM ,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT ,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM',',')))+1 total_cols
    the double)), (select ',' |') ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE ,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT SRC_EFF_FROM_DT , SRC_EFF_TO_DT, EFFECTIVE_FROM_DT, EFFECTIVE_TO_DT, DELETE_FLG, CURRENT_FLG, W_INSERT_DT, W_UPDATE_DT, DATASOURCE_NUM_ID, ETL_PROC_WID, INTEGRATION_ID, SET_ID, TENANT_ID, X_CUSTOM' | (',' double all_cols) b) c
    Start by curr = 1
    Connect prior curr = prev
    length (sys_connect_by_path(c.decode_prep,'-')) desc order)
    where rownum = 1

    Published by: Mac_Freak_Rahul on November 28, 2012 01:31: in the first sql ')'
    removed after desc in the last line so now this query begin and will throw an error.

    Mac_Freak_Rahul wrote:
    @Blushadow:

    (1) first of all, I'm sorry for not posting my question according to the rules of the forum, next time I'll take care of that.
    (2) Secondly, thanks for the solution, I have no exp with clob, but I can take a deeper look later.
    (3) I just want to know if there are any other wayout, you mean the second concatenation of 4000 bytes sys_connect_by_path exhausts it might return this error?

    SYS_CONNECT_BY_PATH returns a VARCHAR2 data type. In SQL VARCHAR2 data type is limited to 4000 bytes, then Yes, you will get an error if the data that you generate is greater than 4000 bytes (and I say bytes rather than characters, because if your database uses a multibyte multi character set could be as little as 1000 characters)

    I'm right now stable for a table who got 62 columns... I have tables that have 200 close passes: (, great, if you can throw some light on this, if your the best way and the only one to achieve?)

    If you really need to concatenate strings together which exceeds 4000 bytes, then Yes you must use CLOB to store data. Oracle does not provide a native way to aggregate together in a CLOB datatype string, so why you need to write your own function.

    PS: just a quick overview of my value, it will be by comparing schema1.table (s) with shema2.table (s) where table_name must be the same...

    So why are you information concatenation together to achieve this goal?

  • ORA-01489 sys_connect_by_path and previous solution does not

    Hi all.

    Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE 11.2.0.1.0 Production."
    AMT for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    I need to get directions in a card and the associated amount long distances to another.
    map
    --     9
      F ----------E
      | \         |
      |  \2       |6
      |   \   11  |
    14|   C-------D
      |  / \10   /
      | /9  \   /15
      |/     \ /
      A-------B
         7
    I have a query that gets the roads properly.
    WITH distances AS
    (
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    )
    SELECT
         'A'||sys_connect_by_path(n2,'-') path,
         SUBSTR(sys_connect_by_path(d,'+'),2) sum_dist
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    
    A-B          7
    A-B-C          7+10
    A-B-C-D          7+10+11
    A-B-C-D-E     7+10+11+6
    A-B-C-F          7+10+2
    A-B-C-F-E     7+10+2+9
    A-B-D          7+15
    A-B-D-E          7+15+6
    A-C          9
    A-C-D          9+11
    A-C-D-E          9+11+6
    A-C-F          9+2
    A-C-F-E          9+2+9
    A-F          14
    A-F-E          14+9
    The problem is when there is a lot of knots, I get an ORA-01489: result of concatenating string is too long.

    I followed this link.

    SYS_CONNECT_BY_PATH & to_CLOB

    I built the package specified but apparently is combining elements.

    If it is called only once.
    WITH distances AS
    (
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    )
    SELECT
         'A'||'-'||hierarchy.branch(LEVEL,n2,'-') path
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    
    A-B
    A-B-C
    A-B-C-D
    A-B-C-D-E
    A-B-C-F
    A-B-C-F-E
    A-B-D
    A-B-D-E
    A-C
    A-C-D
    A-C-D-E
    A-C-F
    A-C-F-E
    A-F
    But if I call it twice in the same query...
    WITH distances AS
    (
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    )
    SELECT
         'A'||SUBSTR(hierarchy.branch(LEVEL,n2,'-'),2) path,
         hierarchy.branch(LEVEL,d,'+') sum_dist
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    
    A          7
    A-C          7+10
    A-10-D          7+10+11
    A-10-11-E     7+10+11+6
    A-10-F          7+10+2
    A-10-2-E     7+10+2+9
    A-D          7+15
    A-15-E          7+15+6
    A          9
    A-D          9+11
    A-11-E          9+11+6
    A-F          9+2
    A-2-E          9+2+9
    As you can see, is to combine the node elements (A-10-11-E) - node distance - distance-

    Do I have to create separate functions in the package, one per column?, or is there another way to solve this problem?, or better yet, another way to solve the original problem (ORA-01489)

    Thank you very much.

    Kind regards.

    Package (by Solomon Yakobson) code:
    CREATE OR REPLACE
      PACKAGE Hierarchy
        IS
            TYPE BranchTableVarchar2Type IS TABLE OF VARCHAR2(4000)
              INDEX BY BINARY_INTEGER;
            BranchTableVarchar2 BranchTableVarchar2Type;
            TYPE BranchTableClobType IS TABLE OF CLOB
              INDEX BY BINARY_INTEGER;
            BranchTableClob BranchTableClobType;
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN VARCHAR2,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
                           )
              RETURN VARCHAR2;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN CLOB,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
                           )
              RETURN CLOB;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
    END Hierarchy;
    / 
    CREATE OR REPLACE
      PACKAGE BODY Hierarchy
        IS
            ReturnValueVarchar2 VARCHAR2(4000);
            ReturnValueClob     CLOB;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN VARCHAR2,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
                       )
          RETURN VARCHAR2
          IS
          BEGIN
              BranchTableVarchar2(p_Level) := p_Value;
              ReturnValueVarchar2          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueVarchar2 := BranchTableVarchar2(I)|| p_Delimiter || ReturnValueVarchar2;
              END LOOP;
              RETURN ReturnValueVarchar2;
        END Branch;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN CLOB,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
                       )
          RETURN CLOB
          IS
          BEGIN
              BranchTableClob(p_Level) := p_Value;
              ReturnValueClob          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueClob := BranchTableClob(I)|| p_Delimiter || ReturnValueClob;
              END LOOP;
              RETURN ReturnValueClob;
        END Branch;
    END Hierarchy;
    /
    Published by: sKr on 08-mar-2012 17:29
    Added package code

    Hello

    sKr wrote:
    Hi all.

    Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE 11.2.0.1.0 Production."
    AMT for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    I need to get directions in a card and the associated amount long distances to another.

    map
    --     9
    F ----------E
    | \         |
    |  \2       |6
    |   \   11  |
    14|   C-------D
    |  / \10   /
    | /9  \   /15
    |/     \ /
    A-------B
    7
    

    ...

    I wish we could mark questions as 'Useful' or 'Correct '. You get 10 points for sure.

    Do I have to create separate functions in the package, one per column.

    You need to separate the functions. A user-defined function should be enough, just like a built-in version of SYS_CONNECT_BY_PATH is sufficient. All that should be stored in their own country, he knows that he needs to keep a separate copy for each argument to which you call it with. The problem with the package, which had been initially posted, is that there is only a single BranchTableVarchar2 of internal variables. Instead of a variable, an array of similar variables and add an optional argument to the funtion branch to tell him which item in this table to use.

    CREATE OR REPLACE
      PACKAGE Hierarchy
        IS
            TYPE BranchTableVarchar2Type IS TABLE OF VARCHAR2(4000)
              INDEX BY BINARY_INTEGER;
            BranchTableVarchar2 BranchTableVarchar2Type;
    
         TYPE VList     IS TABLE OF BranchTableVarchar2Type          -- ***  NEW  ***
           INDEX BY     BINARY_INTEGER;                         -- ***  NEW  ***
         vl     VList;                                      -- ***  NEW  ***
    
            TYPE BranchTableClobType IS TABLE OF CLOB
              INDEX BY BINARY_INTEGER;
            BranchTableClob BranchTableClobType;
    
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN VARCHAR2,
                            p_Delimiter      IN VARCHAR2     DEFAULT CHR(0),
                   p_PathNum      IN PLS_INTEGER     DEFAULT     1     -- ***  NEW  ***
                           )
              RETURN VARCHAR2;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
    
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN CLOB,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
                           )
              RETURN CLOB;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
    END Hierarchy;
    /
    SHOW ERRORS
    
    PROMPT     ==========  FK BODY  ==========
    
    CREATE OR REPLACE
      PACKAGE BODY Hierarchy
        IS
            ReturnValueVarchar2 VARCHAR2(4000);
            ReturnValueClob     CLOB;
    
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN VARCHAR2,
                        p_Delimiter    IN VARCHAR2       DEFAULT CHR(0),
                  p_PathNum        IN PLS_INTEGER DEFAULT 1     -- ***  NEW  ***
                       )
          RETURN VARCHAR2
          IS
          BEGIN
              vl (p_PathNum) (p_Level) := p_Value;               -- ***  CHANGED  ***
              ReturnValueVarchar2          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueVarchar2 := vl (p_PathNum) (I)          -- ***  CHANGED  ***
                             || p_Delimiter
                         || ReturnValueVarchar2;
              END LOOP;
              RETURN ReturnValueVarchar2;
        END Branch;
    
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN CLOB,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
                       )
          RETURN CLOB
          IS
          BEGIN
              BranchTableClob(p_Level) := p_Value;
              ReturnValueClob          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueClob := BranchTableClob(I)|| p_Delimiter || ReturnValueClob;
              END LOOP;
              RETURN ReturnValueClob;
        END Branch;
    END Hierarchy;
    /
    SHOW ERRORS
    

    As you can see, I only changed the version of VARCHAR2. Let you change the CLOB as an exercise for you.

    When you call branch, pass a unique number for each output column. If you do not explicitly give a default number is 0.
    Here's your query modified to call it:

    SELECT  'A' || SUBSTR ( hierarchy.branch ( LEVEL
                                           , n2
                              , '-'
                              )
                    , 2
                    )          AS path
    ,     hierarchy.branch ( LEVEL
                    , d
                    , '+'
                    , 12
                    )     AS sum_dist
    FROM    distances
    START WITH          n1 = 'A'
    CONNECT BY NOCYCLE      PRIOR n2     = n1
    ;
    

    Path, I called the branch with only 3 arguments, so that it uses vl (0) for internal storage for the path.
    For sum_dist, I had to use a different integer. I couldn't decide if I should use 1 or 2, so I compromised and used 12. I could have used any integer, except 0.
    Output:

    PATH                           SUM_DIST
    ------------------------------ -----------------------------
    A                              7
    A-C                            7+10
    A-C-D                          7+10+11
    A-C-D-E                        7+10+11+6
    A-C-F                          7+10+2
    A-C-F-E                        7+10+2+9
    A-D                            7+15
    A-D-E                          7+15+6
    A                              9
    A-D                            9+11
    A-D-E                          9+11+6
    A-F                            9+2
    A-F-E                          9+2+9
    A                              14
    A-E                            14+9
    

    or is there another way to solve this problem?, or better yet, another way to solve the original problem (ORA-01489)

    Given that you call a user-defined set, you might want to add other features to the package.
    For starters, in addition to a function that returns a string like "7 + 10 + 11', it might be useful to have a string that maintains these numbers internally, but returns the value 7 + 10 + 11 = 28.
    If you use this for problems when you want to find the less total path (or the highest total d, for that of importance, but for now, let's say you are only interested in the minimum), you might want a function that keeps track of the minimum total d met so far for each node. Whenever you find a different path to a node, the function can check if the total d is better than the previous best. If this isn't the case, it could return an indicator (kind of similar CONNECT_BY_ISCYCLE) which indicates not bore you with this path.

  • ORA-01017 with database link

    Hi all

    I have a small problem, but I can't find the solution yet.

    I created a DB1 databaselink: "create public database GO_TO_DB link

    connect to TEMP identified by PW_TEMP

    using DB2; »

    On DB2 I have the TEMP user with password PW_TEMP thanks to subsidies for the TEST table.

    In DB2, there is a table "TEST";

    I'm logged into DB1 and do: SELECT * FROM TEST;  I get: "ora-01017 name username/password invalid; connection refused

    ORA-02063 previous line of GO_TO_DB'

    messages.

    I can connect to DB2 with the TEMP of the user and can select: no problem.

    Also, I tried to connect with sqlplus and user TEMP on DB2: no problem.

    Connect to DB1 in sqlplus and don't select it * test, I get ora messages too.

    Do I did wrong or what I forgot?

    Greetz, Cees

    This error message means that you have provided the wrong username and password for the database that the DB connection is connected to.

    If the password is case-sensitive, you must put quotation marks when you create the DB link.

    The name of DB that you provided when you create the DB link could also be referring to a different database than the one you expect. You should check your tnsnames.ora file (or files) to verify this. You can also specify definitively the DB using the syntax ' host: port / SID "instead of a TNS name.

  • Two-node Rac (11204) Cluster node 1 has failed to stop with error: impossible to get in touch with the loan of cluster service. duty to force stop

    Newly build Production environment (don't use it yet)

    OS: Linux redhat 64-bit 2.6.18

    Cluster version: 11.2.0.4

    This environment clusterware installed last December, we are trying to install oracle RDBMS, so try to first stop the crs.  However on node 1, the v$ asm_diskgroup shows nothing under total_mb /free_mb on diskgroup OCR.  and stop the crs shows: impossible to get in touch with the loan of cluster service.

    Alerts cluster log shows below:

    2014-03-25 03:50:01.429:

    [crsd (8608)] CRS-1013: the location of the OCR in ASM disk group is inaccessible. Details in u00/app/11.2.0.4/grid/log/oprd100/crsd/crsd.log.

    2014-03-25 03:50:01.433:

    [crsd (8608)] CRS - 0804:Cluster Ready Service interrupted due to the Oracle Cluster registry error [PROC-26: error when accessing the physical storage]

    ]. Details at (: CRSD00111 :) in u01/app/11.2.0.4/grid/log/orpd100/crsd/crsd.log.)

    2014-03-25 03:50:02.123:

    [ohasd (12490)] CRS - 2765:Resource 'ora.crsd' failed on the server "orpd100".

    2014-03-25 03:50:03.407:

    [crsd (8623)] CRS-1013: the location of the OCR in ASM disk group is inaccessible. Details in u01/app/11.2.0.4/grid/log/orpd100/crsd/crsd.log.

    2014-03-25 03:50:03.411:

    [crsd (8623)] CRS - 0804:Cluster Ready Service interrupted due to the Oracle Cluster registry error [PROC-26: error when accessing the physical storage]

    The NEWSPAPER of the ASM alerts:

    Wed Mar 25 03:21:49 2014

    WARNING: Waited 15 seconds IO to write to the disk of PST 1 in Group 1.

    WARNING: Waited 15 seconds to write IO to disk of PST 2 in Group 1.

    WARNING: Waited 15 seconds IO to write to the disk of PST 1 in Group 1.

    WARNING: Waited 15 seconds to write IO to disk of PST 2 in Group 1.

    Wed Mar 25 03:21:49 2014

    NOTE: process _b000_ + asm1 initiating (21071) 1.1807368888 disk offline (OCR_0681_2EF4) with mask 0x7e in Group 1

    NOTE: process _b000_ + asm1 initiating (21071) 2.1807368889 disk offline (OCR_0681_2EF5) with mask 0x7e in Group 1

    NOTE: check PST: grp = 1

    GMON seeking ways of disc for Group 1 to 5 pid 27, DiSo 21071

    ERROR: read no quorum within Group: required 2 found 1 records

    NOTE: audit PST grp 1 fact.

    NOTE: start the PST update: grp = 1, dsk = 1/0x6bba42b8, mask is 0x6a, op = clear

    NOTE: start the PST update: grp = 1, = 2/0x6bba42b9 dsk, mask is 0x6a, op = clear

    GMON update modes of disk for the Group 1 to 6 for 27, DiSo 21071 pid

    ERROR: read no quorum within Group: required 2 found 1 records

    Wed Mar 25 03:21:49 2014

    NOTE: disassembly of the cache (not clean) Group 1/0x35AAB27B (OCR_DATA)

    WARNING: For disk offline OCR_0681_2EF4 0x7f mode failed.

    2 node rac cluster is normal.  We were able to stop the crs without force.

    What should I look at to understand what is happening here?

    Thanks to adavnace.

    WARNING: For disk offline OCR_0681_2EF5 0x7f mode failed.

    NOTE: e-mail CKPT suspend pins Unix process pid: 21073, image:

    No default value is 1 M

  • What does that mean?  ORA-32039: WITH recursive clause must have list of column aliases

    What does that mean?  If I have alias each column in the clause, I get the same error.  I noticed that if I replace this point of view abw_v_exist_mbr_alt_hierarchy , with a statement select hard-coded query works.

    ORA-32039: WITH recursive clause must have list of column aliases

    [code]

    with bridge as)

    SELECT

    AVS.pontis_bridge_id,

    AVS.super_struct_name structure_name,

    ALV.name vehicle_name,

    AVS.inv_rf inv_rating_factor,

    AVS.opr_rf opr_rating_factor,

    AVS.post_rf legal_rating_factor,

    AVS.safe_rf permit_rating_factor,

    sys_type_display. Display inv_rating_method,

    AVS.up_to_date_ind,

    AE.event_descr,

    AE.event_timestamp,

    AP.username,

    AVS.event_id,

    SYS_TYPE_IMPACT. Display sys_type_impact,

    SYS_TYPE_LANE. Display sys_type_lane

    Of

    (SELECT

    AVEMAH.pontis_bridge_id,

    AVEMAH.super_struct_name,

    ARRS.vehicle_id,

    min (ARRS.inv_rf) inv_rf,

    min (ARRS.opr_rf) opr_rf,

    min (ARRS.post_rf) post_rf,

    min (ARRS.safe_rf) safe_rf,

    ARRS.design_method_type,

    ASMAE.event_id,

    ASMAE.up_to_date_ind,

    ARRS.impact_loading_type,

    ARRS.lane_loading_type

    Abw_v_exist_mbr_alt_hierarchy AVEMAH, abw_spng_mbr_alt_events ASMAE, abw_rating_results_summary ARRS

    WHERE

    AVEMAH.bridge_id = ASMAE.bridge_id

    and ASMAE.bridge_id = ARRS.bridge_id

    and AVEMAH.struct_def_id = ASMAE.struct_def_id

    and ASMAE.struct_def_id = ARRS.struct_def_id

    and AVEMAH.super_struct_mbr_id = ASMAE.super_struct_mbr_id

    and ASMAE.super_struct_mbr_id = ARRS.super_struct_mbr_id

    and AVEMAH.super_struct_spng_mbr_alt_id = ASMAE.super_struct_spng_mbr_alt_id

    and ASMAE.super_struct_spng_mbr_alt_id = ARRS.super_struct_spng_mbr_alt_id

    and ASMAE.event_id = ARRS.event_id

    and ASMAE.results_use_type = 37601

    GROUP OF AVEMAH.pontis_bridge_id, AVEMAH.super_struct_name, ARRS.vehicle_id, ARRS.design_method_type, ASMAE.event_id, ASMAE.up_to_date_ind, ARRS.impact_loading_type, ARRS.lane_loading_type

    ) AVS.

    abw_lib_vehicle BIANCO,

    abw_event AE,

    abw_person AP,

    abw_sys_type sys_type_display,

    abw_sys_type sys_type_impact,

    abw_sys_type sys_type_lane

    WHERE AVS.event_id = AE.event_id

    AND AE.entered_by = AP.person_id

    AND AVS.vehicle_id = ALV.vehicle_id

    AND AVS.impact_loading_type = SYS_TYPE_IMPACT.sys_type

    AND AVS.lane_loading_type = SYS_TYPE_LANE.sys_type

    AND AVS.design_method_type = sys_type_display.sys_type)

    Select

    t.pontis_bridge_id BRIDGE_NAME,

    t.event_timestamp LOAD_RATING_DATE,

    MAX (CASE WHEN t.vehicle_name = 'HL-93 (US)' THEN round (t.inv_rating_factor, 2) ELSE NULL END) LOAD_RATING_HL93_INV_FACTOR,.

    MAX (CASE WHEN t.vehicle_name = 'HL-93 (US)' THEN round (t.opr_rating_factor, 2) ELSE NULL END) LOAD_RATING_HL93_OP_FACTOR,.

    Max(case when t.vehicle_name = 'H 20-44' Then trunc (t.inv_rating_factor * 36) of OTHER END NULL) H_INV_RATING_TONS,.

    Max(case when t.vehicle_name = 'H 20-44' Then trunc (t.opr_rating_factor * 36) of OTHER END NULL) H_OP_RATING_TONS,.

    Max(case when t.vehicle_name = 'HS 20-44' Then trunc (t.inv_rating_factor * 36) of OTHER END NULL) HS_INV_RATING_TONS,.

    Max(case when t.vehicle_name = 'HS 20-44' Then trunc (t.opr_rating_factor * 36) of OTHER END NULL) HS_OP_RATING_TONS,.

    Max(case when t.inv_rating_method='LRFR' Then trunc (t.inv_rating_factor * 36) of OTHER END NULL) LRFR_INV_RATING,.

    Max(case when t.opr_rating_method='LRFR' Then trunc (t.opr_rating_factor * 36) of OTHER END NULL) LRFR_OP_RATING,.

    Max(case when t.vehicle_name = 'SU4' Then Round (t.legal_rating_factor, 2) of OTHER END NULL) LOAD_RATING_SU4_LEGAL_FACTOR,.

    Max(case when t.vehicle_name = 'Type 3S2' Then Round (t.legal_rating_factor, 2) of OTHER END NULL) LOAD_RATING_3S2_LEGAL_FACTOR,.

    Max(case when t.vehicle_name = 'Type 7 divisible Load Vehicle' Then Round (t.permit_rating_factor, 2) of OTHER END NULL) LOAD_RATING_TYP7_PERM_FACTOR,.

    Max(case when t.vehicle_name = 'Type 6A divisible Load Vehicle' Then Round (t.permit_rating_factor, 2) of OTHER END NULL) LOAD_RATING_TYP6A_PERM_FACTOR,.

    MAX (CASE WHEN t.vehicle_name = 'HL-93 (US)' THEN round (t.permit_rating_factor, 2) ELSE NULL END) LOAD_RATING_HL93_PERM_FACTOR,.

    (CASE WHEN t.inv_rating_method = 1 THEN 'LFD'

    WHEN t.inv_rating_method = 'ASD' THEN 2

    WHEN t.inv_rating_method = 'LRFD' THEN 3

    WHEN t.inv_rating_method = 'LRFR' THEN 8 ELSE NULL END) LOADRATE_METHOD_ID,.

    t.UserName LOAD_RATING_SUBMITTED_BY

    Bridge t,.

    (select q.pontis_bridge_id, max (q.event_timestamp) max_et

    Bridge q

    where q.impact_loading = 'as requested.

    and q.lane_loading = 'as requested.

    Q.pontis_bridge_id group) max_event_timestamp

    where t.impact_loading = 'as requested.

    and t.lane_loading = 'as requested.

    and t.pontis_bridge_id = max_event_timestamp.pontis_bridge_id

    and t.event_timestamp = max_event_timestamp.max_et

    and t.username = 'PCAMPISI. '

    GROUP BY

    t.pontis_bridge_id,

    t.event_timestamp,

    t.UserName,

    t.inv_rating_method;

    [/ code]

    You must use the database version 11.2, right?

    ORA-32039: WITH recursive clause must have list of column aliases

    Cause: A query clause called WITH itself (recursive) but do not have a list of aliases for column specified to him.

    Action: Add a list of column alias for the WITH clause query name.

    See:

    SELECT

    Example (you add the list of columns in the "BOLD" part / underlined below):

    WITH

    reports_to_101 (emp_last, mgr_id, eid, reportLevel) AS

    (

    SELECT employe_id, last_name, manager_id reportLevel 0

    Employees

    WHERE employee_id = 101

    UNION ALL

    SELECT e.employee_id, select, e.manager_id, reportLevel + 1

    Reports_to_101 r, e employees

    WHERE r.eid = e.manager_id

    )

    SELECT mgr_id, reportLevel, emp_last and eid

    OF reports_to_101

    ORDER BY reportLevel, eid;

  • get ORA-01403: when it should not

    Hello, I apologize in advance for my spelling, name (takes 6 hours to change) and the headaches you migth get, however,.
    I bring you the following code and test results:
    -----------------------------------------------------------
    -The procedure that throws the error.
    -----------------------------------------------------------
    create or replace
    procedure P_COLEGAS(x in number) as
    ctipo varchar2(20);
    asd varchar2(20);
    
    cursor curnombre is
    select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo and elemento.ciudad=asd);
    
    begin
    select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=x and elemento.id_elem=x;
    for blah in curnombre loop
    DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    end loop;
    end;
    -what i get when executing the procedure-
    Error que empieza en la línea 1 del comando:
    exec p_colegas(19)
    Informe de error:
    ORA-01403: no data found
    ORA-06512: at "BD00.P_COLEGAS", line 9
    ORA-06512: at line 1
    01403. 00000 - "no data found"
    *Cause:
    *Action:
    -----------------------------------------------------------
    -the real problem-
    -----------------------------------------------------------
    in the case of this procedure I had to write
    (1)
    select unidad.tipo into ctipo from unidad where unidad.id_elem=x;
    (2)
    select elemento.ciudad into asd from elemento where elemento.id_elem=x;
    Instead the single query I wrote, we get the following:
    (1) wonderful works, gets only error when there is no match for x.
    (2) throws the error that I was before.

    However when I do the following query in the spreadsheet and run it:
    (3)
    select elemento.ciudad from elemento where elemento.id_elem=x;
    I get what I expect to get 1 row 1 column. (Yes it has data)
    Note: (3) the only difference is that I remove the clause, and x is the same number that I used when I run the procedure.

    -----------------------------------------------------------
    --------------------the question------------------------
    -----------------------------------------------------------
    Why in the procedure, the failure of the (2) query to retrieve the data, the same which data the query (3) doesn't fail to pick up?
    I get ORA-01403, when I shouldn't?
    is there a work around for this problem?

    -----------------------------------------------------------
    --------------------what i try------------------------------
    -----------------------------------------------------------
    Nestled the request with its own handle exception error, get the same results, a few screenshots of the error with a different treatment.

    used tool: sql developer

    ----------
    -Example of data-
    ----------
    tested the procedure with the following sample data in a new workspace, make the same mistake.
    --------------------------------------------------------
    --  DDL for Table ELEMENTO
    --------------------------------------------------------
    
      CREATE TABLE "ELEMENTO" 
       (     "ID_ELEM" NUMBER, 
         "CIUDAD" VARCHAR2(20), 
         "TIPO" CHAR(1), 
         "X" NUMBER, 
         "Y" NUMBER, 
         "FECHAHORA_CREACION" TIMESTAMP (6)
       ) ;
    /
    --------------------------------------------------------
    --  DDL for Table UNIDAD
    --------------------------------------------------------
    
      CREATE TABLE "UNIDAD" 
       (     "ID_ELEM" NUMBER, 
         "PORCENTAJE_SALUD" NUMBER, 
         "NOMBRE" VARCHAR2(20), 
         "TIPO" VARCHAR2(20)
       ) ;
    /
    REM INSERTING into ELEMENTO
    SET DEFINE OFF;
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (12,'Infernalia','U',10,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (15,'Infernalia','U',10,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (19,'Infernalia','U',15,9,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (23,'Infernalia','U',16,8,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (27,'Infernalia','C',15,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (52,'Humania','U',26,10,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (58,'Humania','U',24,9,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (62,'Humania','U',27,11,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (64,'Humania','C',25,8,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (78,'GruntVille','U',47,32,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (84,'GruntVille','U',42,28,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (89,'GruntVille','U',43,29,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (91,'GruntVille','C',44,37,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (29,'Infernalia','C',16,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (90,'GruntVille','U',49,36,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    REM INSERTING into UNIDAD
    SET DEFINE OFF;
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (12,100,'Grang','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (15,100,'Krout','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (19,100,'Warf','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (23,100,'Puaj','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (52,100,'Marcelus','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (58,100,'Claudius','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (62,100,'Arturius','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (78,100,'Klaknot','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (84,100,'Staisht','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (89,100,'Bjorkson','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (90,100,'Sknot','Médico');
    --------------------------------------------------------
    --  Constraints for Table ELEMENTO
    --------------------------------------------------------
    
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_CHK1_TIPO" CHECK (TIPO IN ('U', 'C')) ENABLE;
     
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
     
      ALTER TABLE "ELEMENTO" MODIFY ("ID_ELEM" NOT NULL ENABLE);
     
      ALTER TABLE "ELEMENTO" MODIFY ("CIUDAD" NOT NULL ENABLE);
     
      ALTER TABLE "ELEMENTO" MODIFY ("TIPO" NOT NULL ENABLE);
     
      ALTER TABLE "ELEMENTO" MODIFY ("X" NOT NULL ENABLE);
     
      ALTER TABLE "ELEMENTO" MODIFY ("Y" NOT NULL ENABLE);
     
      ALTER TABLE "ELEMENTO" MODIFY ("FECHAHORA_CREACION" NOT NULL ENABLE);
    /
    --------------------------------------------------------
    --  Constraints for Table UNIDAD
    --------------------------------------------------------
    
      ALTER TABLE "UNIDAD" MODIFY ("ID_ELEM" NOT NULL ENABLE);
     
      ALTER TABLE "UNIDAD" MODIFY ("PORCENTAJE_SALUD" NOT NULL ENABLE);
     
      ALTER TABLE "UNIDAD" MODIFY ("NOMBRE" NOT NULL ENABLE);
     
      ALTER TABLE "UNIDAD" MODIFY ("TIPO" NOT NULL ENABLE);
     
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
    /
    --------------------------------------------------------
    --  Ref Constraints for Table ELEMENTO
    --------------------------------------------------------
    
    --------------------------------------------------------
    --  Ref Constraints for Table UNIDAD
    --------------------------------------------------------
    
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_ELEMENTO_FK1" FOREIGN KEY ("ID_ELEM")
           REFERENCES "ELEMENTO" ("ID_ELEM") ENABLE;
     
    /
    Edited by: 975362 04:47 12/06/2012

    Published by: BluShadow on December 6, 2012 12:51
    addition of {noformat}
    {noformat} tags for readability of code/data.  Please read {message:id=9360002} and learn to do this yourself in future.
    
    Edited by: 975362 on 06-12-2012 05:44 AM
    added example data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    This is because you use X as the parameter to the procedure, and X is a column in the table :)

    So use a table alias in the query or use another name for the parameter.

    Published by: ascheffer on December 6, 2012 15:04

  • error ORA-03113 with XMLTABLE inside the subquery or view

    I get ORA-03113 error if I use a XMLTABLE result within one subquery of another query (if XMLTABLE inline or view). Code below to reproduce that - simplified and now rather meaningless - but produces the same error. Someone at - he seen this error re. XMLTABLE or know bugs in metalink on that? I couldn't find anything. I'll have to use deprecated table (xmlsequence) instead, which does not receive this error.


    -TABLE DROP TEST
    CREATE TABLE TEST (ID number (10), CUST_REF varchar2 (50 char), XMLDATA XMLTYPE);

    INSERT INTO TEST (ID, CUST_REF, XMLDATA) VALUES (1, 'XYZ',
    XMLTYPE ("<?") XML version = "1.0" encoding ="utf-16"? >
    < TESTXML
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xmlns = "urn: ABC - 123:TESTXML" >
    < collection >
    < TRANSACTION_COLLECTION >
    < TRANSACTION >
    < RECORD_ID > 1 < / RECORD_ID >
    < TRANSACTION_ID > 7791786 < / TRANSACTION_ID >
    < AMOUNT > 335 < / AMOUNT >
    < TYPE > I < / TYPE >
    DR < DC > < /DC >
    < / TRANSACTION >
    < / TRANSACTION_COLLECTION >
    < / collections >
    ((< / TESTXML > '));

    COMMIT;

    CREATE VIEW TEST_XMLVIEW
    AS
    SELECT
    ID,
    CUST_REF,
    xmltbl. RECORD_ID,
    xmltbl. TRANSACTION_ID,
    xmltbl. AMOUNT,
    xmltbl. TYPE,
    xmltbl. DC
    OF THE TEST,
    XMLTable (XMLNamespaces (DEFAULT "urn: ABC - 123:TESTXML'"),)
    "/ TESTXML/collections/TRANSACTION_COLLECTION/TRANSACTION" TEST PASSING. XMLDATA
    COLUMNS
    "RECORD_ID" number (10) path "RECORD_ID."
    "TRANSACTION_ID" VARCHAR (200 CHAR) PATH "TRANSACTION_ID"
    "DC' VARCHAR (200 CHAR) PATH"DC. "
    "TYPE' VARCHAR (200 CHAR) PATH"TYPE. "
    ('AMOUNT' NUMBER (38.8) PATH 'QUANTITY')
    AS xmltbl;


    WITH SUM_AMOUNTS (ID, CUST_REF, SUM_1, SUM_2, SUM_3)
    AS
    (SELECT ID, CUST_REF, FLAT AS FLAT AS SUM_2, FLAT + FLAT AS SUM_3, SUM_1)
    OF TEST_XMLVIEW
    GROUP BY ID, CUST_REF)
    Select
    ID,
    CUST_REF,
    SUM_1,
    SUM_2,
    SUM_3
    of SUM_AMOUNTS;


    Version information:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for 64-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Someone at - he seen this error re. XMLTABLE or know bugs in metalink on that? I couldn't find anything.

    Really?

    Go to the directory path and look for the relevant trace or incident file.
    On my system, I can see something like this:

    ORA-07445: exception encountered: core dump [evaopn3()+656] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x234A5B6] [UNABLE_TO_READ] []
    

    Copy / paste this line into the ORA-00600/ORA-07445 on My Oracle Support search tool and search for your version.
    Read this article:

    * ORA-7445 (evaopn3) [860969.1 ID] *.

    and at the bottom of the page, among the associated bugs known, this one:

    Bug 12724375 : ORA-7445 [evaopn3] XQuery with GROUP BY *.

  • Get "ORA-12534: TNS:operation unsupported ' connect as sysdba

    Hello

    We get "ORA-12534: TNS:operation not supported" error when connecting as sysdba.

    Bash-2. $03 sqlplus "virtue sysdba".

    SQL * more: Release 10.2.0.4.0 - Production Thu Feb 23 10:16:16 2012

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    ERROR:
    ORA-12534: TNS:operation unsupported


    Enter the user name:

    I can able to connect to the database using tns entry without any problem.

    SQLNET. Contents of the ORA:
    ====================
    Bash-2. $03 cat /var/opt/oracle/sqlnet.ora
    ENCRYPTION_WALLET_LOCATION=(source=(method=file)(METHOD_DATA=(Directory=/dboracle/ORABASE/product/10.2.0/dbs/wallet/)))
    SQLNET. WALLET_OVERRIDE = TRUE
    SSL_CLIENT_AUTHENTICATION = FALSE
    SSL_VERSION = 0

    I'm not aware of the portfolio. Please, help me to solve this problem.

    Thank you.

    Kind regards
    National Stadium

    >
    SQLNET. Contents of the ORA:
    ====================
    Bash-2. $03 cat /var/opt/oracle/sqlnet.ora
    ENCRYPTION_WALLET_LOCATION=(source=(method=file)(METHOD_DATA=(Directory=/dboracle/ORABASE/product/10.2.0/dbs/wallet/)))
    SQLNET. WALLET_OVERRIDE = TRUE
    SSL_CLIENT_AUTHENTICATION = FALSE
    SSL_VERSION = 0
    >

    You can replace the keyword ENCRYPTION_WALLET_LOCATION with just WALLET_LOCATION in your file sqlnet.ora.

    EWL is only used for transparent encryption of data, but if you want to use the external password store, you will need to use WALLET_LOCATION rather than ENCRYPTION_WALLET_LOCATION. However, if you want to use TDE and external repository of password, then make sure that your sqlnet.ora file has two entries ENCRYPTION_WALLET_LOCATION and WALLET_LOCATION

    Concerning
    Vincent

  • Using XMLTYPE and cursor I get ORA-01000

    When I run this example I get:

    ORA-01000: cursors open maximum exceeded
    01000 00000 - "maximum open cursors exceeded".
    * Cause:
    * Action:

    < {code >}
    drop table model.
    create the dummy (pidm number (8) of the table)
    , Name varchar2 (20)
    , name varchar2 (20)
    , phone varchar2 (12)
    , Dept varchar2 (6)
    , In_Case_Emerg varchar2 (20)
    , Zip varchar2 (5)
    , Field_A varchar2 (5)
    , Field_B varchar2 (5)
    , Field_C varchar2 (5)
    , Field_D varchar2 (5)
    , Field_E varchar2 (5)
    , Field_F varchar2 (5)
    , Field_G varchar2 (5)
    , Field_H varchar2 (5)
    , Field_I varchar2 (5)
    , Field_J varchar2 (5)
    , Field_K varchar2 (5)
    , Field_L varchar2 (5)
    , Field_M varchar2 (5)
    , Field_N varchar2 (5)
    , Field_o varchar2 (5)
    , Field_P varchar2 (5)
    , Field_Q varchar2 (5)
    , Field_R varchar2 (5)
    , Field_S varchar2 (5)
    , Field_T varchar2 (5)
    , Field_U varchar2 (5)
    , Field_V varchar2 (5)
    , Field_W varchar2 (5)
    , Field_X varchar2 (5)
    , Field_Y varchar2 (5)
    , Field_Z varchar2 (5)
    );
    Insert into dummy(pidm,lastname,firstname,phone,dept)
    values(649,'Doe','Jane','1234','FINAC');
    Insert into dummy (pidm, lastname, firstname, dept)
    values(649,'Doe','Jane','CUST');
    Insert into dummy(pidm,lastname,firstname,phone,dept)
    values(649,'Doe','Jane','3456','REPAIR');
    Insert into dummy (pidm, lastname, firstname, dept)
    values(649,'Doe','Jane','PARTS');

    ----------------------------

    Select
    Z.Akey, Z.dept, Z.column_name, Y.dvalue
    Y.Deptorg, Y.drecord
    CEN
    Select
    Upper (Trim (C.Dept)) deptorg
    Annals of t.column_value.getrootelement)
    (, t.column_value.extract('//text () ') value
    model c
    table
    (xmlsequence
    (xmltype
    (cursor
    (
    Select d.
    model d
    where d.dept = c.dept
    AND d.pidm = 649
    )
    ).extract('rowset/row/*')
    )
    ) t
    where c.pidm = 649
    Order at the top (c.dept), Annals
    ) (Right outer join Y)
    Select J.column_name, K.dept, J.akey
    de)
    Select B.column_name, '1' akey
    Of user_tab_columns B
    where upper (B.table_name) = upper ('dummy')
    () Join the inner J)
    Select distinct '1' akey, UPPER (dept) dept
    where dummy pidm = 649
    ) K
    ON J.Akey = K.Akey
    ORDER BY J.column_name, K.dept
    ) Z
    ON Y.DRECORD = Z.COLUMN_NAME
    AND Y.Deptorg = Z.Dept
    WHERE Z.akey = '1'
    order of Z.dept, Z.column_name

    < code >
    However when I do

    update set = 123 pidm dummy where DEPT = 'PARTIES ';

    The query above works.

    Is it possible to make the above query without having a cursor limit?

    If this is the wrong forum, please tell me the right forum?

    Suggestions?

    TIA
    Steve42

    Hi Steve,.

    The following query should work:

    WITH t1 AS (
      SELECT *
      FROM XMLTable(
       'for $i in ora:view("DUMMY")/ROW[PIDM=xs:integer($pidm)]
          , $j in $i/child::*
        return element r
        {
          $i/DEPT
        , element COLUMN_NAME {name($j)}
        , element DVALUE      {$j}
        }'
       passing sys_xmlgen(649) as "pidm"
       columns dept        varchar2(6)  path 'DEPT'
             , column_name varchar2(30) path 'COLUMN_NAME'
             , dvalue      varchar2(30) path 'DVALUE'
      )
    ),
    t2 AS (
      SELECT column_name, column_id
      FROM user_tab_columns
      WHERE table_name = 'DUMMY'
    )
    SELECT t1.dept, column_name, t1.dvalue
    FROM t1
         PARTITION BY (dept)
         RIGHT OUTER JOIN t2 USING (column_name)
    ORDER BY t1.dept, t2.column_id
    ;
    

    The subquery "t1" is pretty much the same as the one you used with XMLSequence.

    XMLTable has been introduced in version 10.2 and now replaces XMLSequence:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14259/xdb_xquery.htm#sthref1705

    Another useful feature here is the "partitioned outer join", that allow outer join independently each group of the Department to the list in the column.

  • Get the date with the millisecond of the table

    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Table created
    SQL > insert into test_date values (sysdate);

    1 row inserted

    SQL > commit;

    Validation complete

    SQL > select * from test_date;

    COL1
    -----------
    18/12/2009


    Here I have to get datewith "millisecond" format and put it into the variable varchar2 (50) and pass this
    to Java.


    SQL > select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date;

    Select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date

    ORA-01821: date format not recognized

    SQL >

    Thank you
    Khaldi

    user601042 wrote:
    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Your data col1 type should be TIMESTAMP.

    See you soon
    Sarma.

Maybe you are looking for