ERROR WHEN RETURNING A PL/SQL TABLE?

Hi,
I try to call a Oracle 9i function from Oracle 8i via TEST9.WORLD dblink.
The function returns me a pl/sql table.
It compiles but when I try to execute I get the following error
The following error has occurred:
ORA-02068: following severe error from TEST9.WORLD
ORA-06512: at "TBSDEV.GETDATA", line 12
ORA-06512: at line 2
Note: I test the code in a single database instance
and it works fine. The problem occurs when I move the getData function to 8i and
call the package function via a dblink.
What can I do?
what might be the problem?
Does not Oracle permit us move table of records between 2 database instances?
]f it does not, it is very tragic because we can get the SQL Server record sets to
Oracle 9i through a gateway but we could not move these records sets within Oracle?
!!!!!!!!!!! All of the code .} use is listed below.
thanks in advance.
--BELOW IS MY PACKAGE IN ORACLE 9i SERVER
--THIS PACKAGE GETS DATA FROM SQL SERVER THROUGH TRASPARENT GATEWAY
CREATE OR REPLACE package tgw is
TYPE RefCursorType IS REF CURSOR;
TYPE HisseRecordType IS RECORD( HisseAd VARCHAR2(20) := '' );
TYPE HisseTableType IS TABLE OF HisseRecordType INDEX BY BINARY_INTEGER;
mytable HisseTableType;
myrecord HisseRecordType;
function getRecords return HisseTableType ;
end;
CREATE OR REPLACE package body tgw is
function getRecords return HisseTableType is
rc RefCursorType;
htable HisseTableType;
hrec HisseRecordType;
BEGIN
"ahtha"."getHisseSenetleri"@ata(rc); --CALLS SQL SERVER STORED PROCEDURE
FOR i IN 1..10 LOOP
FETCH rc INTO htable(i);
END LOOP;
CLOSE rc;
RETURN htable;
END;
end;
--HERE IS THE PROCEDURE IN OUR MAIN ORACLE 8i SERVER
-- TGW9i ]S THE dblink to the oracle 9i
-- THE BELOW CODE COMPILES BUT GIVES THE ERROR I MENTIONED ABOVE
PROCEDURE getdata is
htable tgw9i.mytable%TYPE;
hrec tgw9i.myrecord%TYPE;
begin
htable:=tgw9i.getRecords(10);
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(htable(i).HisseAd);
END LOOP;
end;

The problem might be passing PL/SQL Tables or Records over your database link. You might run some more simple tests with PL/SQL Records and Tables over your link.
1) I still suggest you use a GLOBAL TEMPORARY TABLE to pass your information, attempt to do everything in a few SQL statements to pass the informaiton. And then process it on the other side. Database links tend to be a bit slow, and so you want to try to reduce the number of times you extract information through the link.
2) Someone else may have more experience with DB links, and calling procedures through them.
I wish you luck that you find your answer soon,
Eric Kamradt

Similar Messages

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • Web service task: Error when returning an empty array

    Hi,
    I've encountered an annoying error when using a Web Service Task from an SSIS package in SQL Server Data Tools.
    [Web Service Task] Error: An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: Could not execute the Web method. The error is: Index was outside the bounds of the array..
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo methodInfo, String serviceName, Object connection)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo methodInfo, String serviceName, Object connection, VariableDispenser taskVariableDispenser)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".
    It seems that the Web Service Task generates this error when returning an empty response from the WSDL. I've seen several topics about this here on MSDN but they are all from 2008-2009 and seem to suggest that
    this is a bug.  The workaround suggested is using a script task but I would really love to avoid that since my programming skills are lacking.
    I'm using Visual studio 2010 with SP1.

    Hello,
    From my own experience: in all the cases where I had to use SSIS 2008 to retrieve data or send data to Webservices, I had to revert to using Script Tasks or Script components. Whenever I tried with a Web service task, because the job looked simple, I had
    to abandon it in favour of Scripts. Keep in mind that I try to make use of the SSIS components as often as possible, before reverting to Scripting. But handling web services is the one exception, where I always use scripts. In SSIS 2012 I did not find
    any significant improvement of the Web service task and hence no compelling reason to use it.
    Jan D'Hondt - SQL server BI development

  • ODSI support for return type "PL/SQL TABLE"?

    Hello!
    We are trying to connect our ODSI to an Oracle function with return type "PL/SQL TABLE". The ODSI "wizard" (used to create the physical data service) seems to understand the interface during creation, but when executed it fails. The ODSI server complains about wrong type (PLS-00382: expression is of wrong type) when we execute it from the "test tab".
    The function's metadata is looks like this:
    <params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:physical/rekondis/CALC_DEBITING" >
    <param name="RETURN_VALUE" kind="return" xqueryType="pn1:RETURN_VALUE_ROW" nativeTypeCode="1111" nativeType="PL/SQL TABLE"/>
    <param name="PIN_CASE_ID" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PIN_ACTION_CODE" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PI_AD_NAME" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    </params>
    Any ideas how we can make this work!? Or is this not even supported in ODSI 10.3?
    Thanks!
    // Mikael

    Please refer to the documentation - http://download.oracle.com/docs/cd/E13162_01/odsi/docs10gr3/datasrvc/Create%20Physical%20Data%20Services%20from%20Stored%20Procedures.html

  • Error when attempting to merge into table with RLS - ORA - 28132

    hey,
    i've encountered an "ORA-28132 - Merge into syntax does not support security policies" when attempting to merge into a table with RLS defined on it.
    i looked around and found this [discussion |http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:259415261270] on ask tom.
    according to the thread - this was a bug in 9i. in 10g merge is possible only if the policy returns "null" and in 11g it was finally fixed.
    *i have been able to merge into tables with rls in 10gR2 in some cases.*
    i would like to know if anyone has some more information about this error. when can i merge into tables with RLS ?
    thanks, Haki.

    Never.
    The bug was that it did work sometimes in 10g i.e. it should always raise an error.
    It's something that I've always found a bit odd and frustrating - that MERGE and RLS policy should not be compatible.
    But bottom line is that you shouldn't be using MERGE on table with RLS policy.
    Edited by: Dom Brooks on Feb 14, 2011 10:51 AM

  • Error when assigning SID: Action VAL_SID_CONVERT table 0FISCPER

    Hi All,
    We are getting the following error when activating an ODS:
    Fiscal year variant  not expected                                           
    Error when assigning SID: Action VAL_SID_CONVERT table 0FISCPER   
    Interestingly, we have two systems for two different phases, on the same BW 3.5 SP level and the corresponding source R/3 SP Levels. BEx reporting is turned on for both the ODSs.
    On one system, the ODS get's activated without any issue and on the other, it get's errored out.
    I have tried different things like Rebuiding Global Transfer Settings, comparing the data between the two systems, etc., but no use.
    Any ideas/solutions?
    Thanks,
    - Shashi

    Marc,
    I have checked once and found all the data is correct. I will do that again.
    When I tried RSRV checks on 0FISCPER and 0FISCVARNT, I am getting the following message:
    0FISCVARNT is not a characteristic but an InfoObject of type TIM
    Message no. RSRV209
    Diagnosis
    The value entered 0FISCVARNT must be the name of a characteristic. However, 0FISCVARNT is an InfoObject of type TIM.
    The following values can be types:
    CHA characteristic
    KYF key figure
    TIM time characteristic
    UNI unit
    DPA package
    ATR attribute
    MTA meta-InfoObject
    Thanks,
    - Shashi

  • Error when assigning SID: Action VAL_SID_CONVERT table 0TYPE

    Hi Experts
    When I am trying to load the data into DSO the data is scheduling But DSO data is not Activated It Showing Error
    messages in Log for request processing in Request tab of DSO Manage.
    1.Error when assigning SID: Action VAL_SID_CONVERT table 0TYPE
    2.Value 'area' (hex. '61726561') of characteristic 0TYPE contains invalid characters
    3.Error when assigning SID: Action VAL_SID_CONVERT table ZCH_O_TYP
    4.Value 'area' (hex. '61726561') of characteristic 0TYPE contains invalid characters
    5.Error when assigning SID: Action VAL_SID_CONVERT table ZVALUE
    6.Value '0000000000000000860452655_PDF_45U x 200' (hex. '30303030303030303030303030303030383630343532363535') of
    characteristic ZVALUE contains invalid characters
    7.Error when assigning SID: Action VAL_SID_CONVERT table ZVALUE_O .
    8.Value '224053 sht 1.pdf##~##000000153363' (hex. '3232343035332073687420312E70646623237E232330303030') of
    characteristic ZVALUE_O contains invalid characters.
    9.Activation of M records from DataStore object ZCF_O02 terminated
    I have tried adding the special character # with transaction rskc but nothing seems to change and
    I still get the same error.
    DATA: T_ALL(100) type C,
    T_VAR1(45) type C value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq',
    T_VAR2(50) type C Value 'rstuvwxyz 0123456789 @#$%^&*()_-+=:;\/?',
    temp(60) type c,
    cnt type i,
    length type i.
    clear : cnt,temp,length.
    break-point.
    temp = SOURCE_FIELDS-TXZ01.
    CONCATENATE T_VAR1 T_VAR2 into T_ALL.
    cnt = 0.
    length = STRLEN( temp ).
    IF NOT temp CO T_ALL.
    WHILE cnt < length.
    IF NOT temp+cnt(1) CO T_ALL.
    CLEAR: temp+cnt(1).
    ENDIF.
    cnt = cnt + 1.
    ENDWHILE.
    ENDIF.
    translate temp to upper case.
    RESULT = temp.
    i am getting the above error, one of the expert suggested to implement this code but i am getting some errros when i execute this one please can anyone check this code and correct the errors it would be help ful to me.
    Regards
    Venu

    Hi ,
           Implement this code to resolve the issue.
    You can use the sample code below to choose only the charachters to be allowed in for the field. Using that you can remove all special charachters and # symbols as required
    DATA: T_ALL(100) type C,
    T_VAR1(45) type C value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq',
    T_VAR2(50) type C Value 'rstuvwxyz 0123456789 @#$%^&*()_-+=:;\/?',
    temp(60) type c,
    cnt type i,
    length type i.
    clear : cnt,temp,length.
    break-point.
    temp = SOURCE_FIELDS-TXZ01.
    CONCATENATE T_VAR1 T_VAR2 into T_ALL.
    cnt = 0.
    length = STRLEN( temp ).
    IF NOT temp CO T_ALL.
    WHILE cnt < length.
    IF NOT temp+cnt(1) CO T_ALL.
    CLEAR: temp+cnt(1).
    ENDIF.
    cnt = cnt + 1.
    ENDWHILE.
    ENDIF.
    translate temp to upper case.
    RESULT = temp.
    Regards,
    Rahul.

  • Using a Table Trigger to Trap Error Codes Returned to a SQL Loader seeion

    I would be grateful if anyone knows how to go about this.
    I am trying to insert into a table, details of SQL Loader's rejected records by possibly using a trigger on the loading table to try and trap the error code returned to SQL Loader.
    What I am trying to achieve is to insert in to a table the load or rejected record details that are in SQL Loader’s log file after a load session. For example: records read:, records inserted:, records rejected:...etc..
    My main concern is that the loading table is regularly loaded, with 3m records, has 90 columns, and to check by referencing each column's new value, in the table trigger, may mean very long load times.
    Anyone got any “how to” ideas?
    Many thanks
    Regards
    Carlos

    Folks, thanks for your help.
    Previously, I had briefly considered both ideas and they would work.
    I dismissed the utl_file package solution because I believed that it would take too long to read in each log file line, search for the text and then inserts it into a table.
    I overlooked testing this and when I did (1mb file) it actually was pretty fast. I will go that route.
    Thanks for everyone’s help
    regards
    Carlos

  • Error when publishing a PL/SQL Web Service with JDeveloper 10.1.3!!!!!!!!!

    Hi,
    When I publish a PL/SQL package as a web service in J2EE 1.4 (Jax-RPC) Web Service version get this error:
    oracle.j2ee.ws.common.tools.api.ValidationException: Error in database webservices assembly
         at oracle.j2ee.ws.tools.wsa.db.WSADBPlugin.processDBEndpoint(WSADBPlugin.java:329)
         at oracle.j2ee.ws.tools.wsa.Util.processDBEndpoint(Util.java:887)
         at oracle.jdeveloper.webservices.model.plsql.PLSQLGenerator.preparePLSQLPortTypes(PLSQLGenerator.java:734)
         at oracle.jdeveloper.webservices.model.plsql.PLSQLGenerator.doGeneration(PLSQLGenerator.java:233)
         at oracle.jdeveloper.webservices.model.Generator.generateImpl(Generator.java:447)
         at oracle.jdeveloper.webservices.model.Generator.generate(Generator.java:295)
         at oracle.jdeveloper.webservices.model.WebService.saveEditImpl(WebService.java:3971)
         at oracle.jdeveloper.webservices.model.WebService.mav$saveEditImpl(WebService.java)
         at oracle.jdeveloper.webservices.model.WebService$1.run(WebService.java:3817)
         at oracle.jdeveloper.webservices.model.GeneratorUI$GeneratorAction.run(GeneratorUI.java:446)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:595)
    GRAVE: JPublisher error: please check assembler settings, database connection and database schema. Use debug=true for details.
    and when use J2EE 1.3 (Oracle) version WEb Service get this error:
    java.lang.NullPointerException
    at oracle.jdevimpl.webservices.generator.WrapperClassGenerator.generate(WrapperClassGenerator.java:262)
    at oracle.jdevimpl.webservices.generator.SPWebServiceGenerator$1.run(SPWebServiceGenerator.java:285)
    at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
    at java.lang.Thread.run(Thread.java:595)
    ..... Is this a BUG????
    please help!

    OK, This is the PL/SQL package:
    Function:
    FUNCTION Obtener_paises RETURN res_webservice AS
    v_respuesta res_webservice;
    i PLS_INTEGER:=1;
    CURSOR C_paises IS
    SELECT cpais, tpais
    FROM paises
    ORDER BY tpais;
    BEGIN
    v_respuesta := res_webservice(null,null);
    v_respuesta.error := res_error(null,null,null);
    v_respuesta.error.cerror := 0;
    v_respuesta.error.cerror_ora := 0;
    v_respuesta.error.terror := null;
    v_respuesta.datos := res_datos ();
    FOR v_pais IN C_paises LOOP
    v_respuesta.datos.extend;
    v_respuesta.datos(i) := reg_datos(null,null);
    v_respuesta.datos(i).codigo := v_pais.cpais;
    v_respuesta.datos(i).descripcion := v_pais.tpais;
    i := i + 1;
    END LOOP;
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
    RETURN v_respuesta;
    EXCEPTION
    WHEN OTHERS THEN
    v_respuesta.error.cerror := 1;
    v_respuesta.error.cerror_ora := SQLCODE;
    v_respuesta.error.terror := substr(SQLERRM,1,80);
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
    RETURN v_respuesta;
    END Obtener_paises;
    TYPES USED:
    CREATE OR REPLACE
    TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
    CREATE OR REPLACE
    TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
    CREATE OR REPLACE
    TYPE res_datos AS TABLE OF reg_datos;
    CREATE OR REPLACE
    TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
    Thanks in advanced...
    Could happen this bacause of these defined types???

  • Error when publishing a PL/SQL package as a Webservice

    Hi all,
    I am using the JDeveloper (10.1.3.1.0) to publish a PL/SQL package as a Webservice, and I am having some troubles on the generation process.
    The problem that I am facing is on the generated code for the database side, where some methods have a “$GET_” at the end of its name.
    This “$GET_” is handled by the database as a special word, and the package can’t be compiled.
    If the ‘$’ character is removed from all the methods, the package can be compiled and the Webservice works fine.
    What’s wrong? Is there a bug on the generation process of the JDeveloper?
    Regards,
    Rui Torres

    OK, This is the PL/SQL package:
    Function:
    FUNCTION Obtener_paises RETURN res_webservice AS
    v_respuesta res_webservice;
    i PLS_INTEGER:=1;
    CURSOR C_paises IS
    SELECT cpais, tpais
    FROM paises
    ORDER BY tpais;
    BEGIN
    v_respuesta := res_webservice(null,null);
    v_respuesta.error := res_error(null,null,null);
    v_respuesta.error.cerror := 0;
    v_respuesta.error.cerror_ora := 0;
    v_respuesta.error.terror := null;
    v_respuesta.datos := res_datos ();
    FOR v_pais IN C_paises LOOP
    v_respuesta.datos.extend;
    v_respuesta.datos(i) := reg_datos(null,null);
    v_respuesta.datos(i).codigo := v_pais.cpais;
    v_respuesta.datos(i).descripcion := v_pais.tpais;
    i := i + 1;
    END LOOP;
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
    RETURN v_respuesta;
    EXCEPTION
    WHEN OTHERS THEN
    v_respuesta.error.cerror := 1;
    v_respuesta.error.cerror_ora := SQLCODE;
    v_respuesta.error.terror := substr(SQLERRM,1,80);
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
    RETURN v_respuesta;
    END Obtener_paises;
    TYPES USED:
    CREATE OR REPLACE
    TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
    CREATE OR REPLACE
    TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
    CREATE OR REPLACE
    TYPE res_datos AS TABLE OF reg_datos;
    CREATE OR REPLACE
    TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
    Thanks in advanced...
    Could happen this bacause of these defined types???

  • DB connect Datasource is giving error when executing infopackage from SQL

    Hi,
    I have created DB connect data source for SQL data base. Whenever I will try to execute the Infopackage , it is giving below error and when I checked status of job in data source, it stays in yellow.
    SQL error "99" with message: "[Microsoft][SQL Server Native Client 10.0]Numeric
    Message no. RSDS_ACCESS023
    Any suggestion in this.... Thanks.
    Regards
    Deepa.

    Yes, I resolved it.
    Please ask your admin guys do following steps - it will resolve the issue:
    3. Possible problem areas
    a) Datetime data type in source system tables
    The Datetime DB data type and similar (timestamp, smalldatetime) are not used in SAP installations. This type of data cannot be transferred consistently into the BW system without additional activities.
    Solution:
    You must create a view in the source system to transform the data. Since a field of the type DateTime actually represents two SAP Basis types (DATES, TIMES), you must split it into a maximum of two fields, as appropriate:
      create view <VIEWNAME> as
      select
      VD_1_D = convert(varchar(4), datepart(yyyy, d_1))
             + case len(convert(varchar(2), datepart(mm, d_1)))
                  when 1 then '0' + convert(varchar(1), datepart(mm, d_1))
                  else convert(varchar(2), datepart(mm, d_1))
                  end
             + case len(convert(varchar(2), datepart(dd, d_1)))
                  when 1 then '0' + convert(varchar(1), datepart(dd, d_1))
                  else convert(varchar(2), datepart(dd, d_1))
                  end,
      VT_1_T =  case len(convert(varchar(2), datepart(hh, t_1)))
                  when 1 then       /* Hour Part of TIMES */
                        case convert(varchar(2), datepart(hh, t_1))
                          when '0' then '24'    /* Map 00 to 24 ( TIMES ) */
                          else '0' + convert(varchar(1), datepart(hh, t_1))
                        end
                  else convert(varchar(2), datepart(hh, t_1))
                  end
             + case len(convert(varchar(2), datepart(mi, t_1)))
                  when 1 then '0' + convert(varchar(1), datepart(mi, t_1))
                  else convert(varchar(2), datepart(mi, t_1))
                  end
            + case len(convert(varchar(2), datepart(ss, t_1)))
                  when 1 then '0' + convert(varchar(1), datepart(ss, t_1))
                  else convert(varchar(2), datepart(ss, t_1))
                  end
      from <TABLENAME>
    The t_1 Basis field in the table is converted into a DATES field VT_1_D      and a TIMES field VT_1_T. During the generation of the VT_1_T field, the value for 00:00 hours is also converted to 24:00 hours. This conversion may be omitted if not required.
    b) Float data type in source system tables
    In accordance with the IEEE standard regulations, MS SQL Server supports a value range of 1x10E-307 to +go- 1x10E+308. This also applies to the corresponding ABAP data type. However, the BW database in question may restrict this. Depending on the system, a restriction to 1x10E-25 is possible.
    c) Nvarchar data type in source system tables
    The length information displayed is twice as big as the number of characters you specified when you created the column.
    d) Writing names in the source system
    Since the R/3 kernel used in BW can only process table and column names written in upper case, on the source system, you must create DB views that convert the original names in accordance with this rule.
    e) Code page and sort sequence of the source system
    R/3 kernel-based systems such as BW basically assume that the database being used was created using code page cp850 and with the sort sequence 'bin2'.
    The configuration of the source system may differ. If the sort sequence is different, operations for string search (like) and area search (between, >, <) on character fields may return different results.
    Solution:  There is currently no solution.
    If you use multibyte code pages in the source system to save data with character sets of more than 256 characters (Kanji, Hiragana, Korean, Chinese and so on), the characters may be corrupted as a result.
    Solution:  There is currently no solution.
    f) Authorizations and visible objects
    BW DB Connect uses a remote server as a source system to extract data. The data already exists in that remote system. To use BW DB Connect, you will create a new login and new views which the SAP BW system will use when connecting.
    You must remember only the DB objects (tables and views), which directly belong to the new database login are visible.
    You cannot use a login that belongs to the Sysadmin server role, (for example 'sa').
    To create the new login and views:
    1. Create a new login and map it to a user in the database with membership in db_ddladmin
    2. Grant the new user (SELECT at least) access to the original data tables.
    3. Login as this new login and create the views in the database/schema of that user, referring to the original (source) data tables.
    4. Specify this new login in the data extraction and this login/user will read from his own views in his own schema.
    5. Optionally you can switch the new user's role to db_datareader which is sufficient for reading data. Further changes to the remote system e.g. new views or changed views will require the db_ddladmin role again.

  • Error when i fetch the external table in oracle 9i ?

    External table is created.
    But, when i select the external table , it is thrwing the following error.
    I have given READ and WRITE permission to the oracle directory.
    And, i having the flat file with comma delimited data.
    SQL> create table mohan_ext (
    2 EMPNO NUMBER(5) ,
    3 JOB VARCHAR2(15),
    4 SALARY NUMBER(8,2),
    5 MGR NUMBER(5) ,
    6 HIREDATE DATE,
    7 DEPTNO NUMBER(5)
    8 )
    9 organization external
    10 (type oracle_loader
    11 default directory ext_dir
    12 access parameters (records delimited by newline
    13 fields terminated by ','
    14 missing field values are null
    15 (
    16 EMPNO NUMBER(5:5) ,
    17 JOB VARCHAR2(15:15),
    18 SALARY NUMBER(8,2:8,2),
    19 MGR NUMBER(5:5) ,
    20 HIREDATE DATE,
    21 DEPTNO NUMBER(5:5)
    22 )
    23 )
    24 LOCATION('flat.txt'));
    Table created.
    SQL> select * from mohan_ext;
    select * from mohan_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "identifier": expecting one of: "comma, char, date, defaultif,
    decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ),
    unsigned, varrawc, varchar, varraw, varcharc, zoned"
    KUP-01008: the bad identifier was: NUMBER
    KUP-01007: at line 5 column 11
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

    You may need to scrub some of the data prior to using it as an external table. For instance, ensure that you do not have any extra commas lingering around somewhere within the data as this could cause mapping issues with the data. I've used this process hundreds of times, and more often than not there is an extra comma somewhere that is causing the issue.

  • Returning multiple pl/sql tables to VB using ADO + Oracle's OLE DB

    Windows XP
    VB 6
    ADO 2.7
    Oracle 9i Client (OLE DB 9.2.0.1)
    Oracle DB 8.1.7.2
    I have just upgraded a VB5/NT (RDO + MS ODBC for Oracle) app to VB6/XP (ADO + Oracle's OLE DB). The calls to stored procedures that returns tables are not working now. I get following error:
    -214721900 ORA-06550: line 1, column 42:
    PLS-00201:identifier 'LO_AUDIT_ID_TBL' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please provide hint/help.

    Yes, the LO_AUDIT_ID_TBL is a variable (of table type) being returned from the stored procedure.
    I tried changing case of table is in pl/sql.
    I tried removing the table(s) from the Call statement...
    and I get error message that there are missing parameters.
    THANKS SO MUCH FOR YOUR HELP.
    I have been reading OLE DB User's guide in which there are examples of Ref Cursors and has no documentation regarding how to achieve same using tables (in stead of Ref Curs). I am also looking for documentation that would describe all different Registry attributes that could be turned on or off to do things, but have not been able to find any.
    I am trying to use the PLSQLRSet to retrieve rowsets from pl/sql tables. You can see that in my VB code below, in GetSPResultSet function.
    The VB Code is:
    Public Function Retrieve() As ADODB.Recordset
    Dim inparam(-2 To -1) As Variant 'set to be ignored by GetSPResultSet method
    Dim outparam(0) As Variant
    Dim strSQL As String
    strSQL = "{ CALL PckPLAudit.Sel_Smmry( ?,{resultset 1000, lo_audit_id_tbl, lo_audit_dt_tbl, lo_audit_type_tbl, " & _
    "lo_audit_status_tbl, lo_qty_selected_tbl, lo_qty_deselect_tbl, lo_qty_sent_tbl, lo_qty_follow_tbl, " & _
    "lo_qty_received_tbl, lo_qty_ncpl_tbl, lo_qty_security_tbl, lo_qty_closed_tbl, lo_qty_sentsec_tbl}, {resultset 1, lo_res_tbl} ) }"
    Set rdoRs = mConnection.GetSPResultSet(strSQL, inparam(), outparam())
    BuildCollection
    Set Retrieve = rdoRs
    End Function
    Public Function GetSPResultSet(ByVal szSQL As String, InParam() As Variant, OutParam() As Variant) As ADODB.Recordset
    '============================================================================
    'submits a call to a stored procedure that returns table output parameters.
    'out params are interpreted as ADODB.Recordset
    'szSQL : SQL call to stored procedure
    'InParam() : array of input parameter values
    'OutParam() : array of output parameter values set in this function
    '============================================================================
    Dim qry As New ADODB.Command
    Dim ParamIn As ADODB.Parameter
    Dim ParamOut As ADODB.Parameter
    Dim RS As ADODB.Recordset
    Dim inti As Integer
    Dim intj As Integer
    Dim blnret As Boolean
    Dim mErrors As New cErrors
    Dim retVal As Double
    'Dim itmp As Integer
    Dim ParmType As DataTypeEnum
    Dim i
    On Error GoTo errGetSPResultSet
    blnret = True
    Set qry = New ADODB.Command
    qry.ActiveConnection = mrdoCn
    qry.CommandType = adCmdText
    qry.CommandText = szSQL
    'load rdoParameter object(s) from InParam array if InParam exists
    For inti = 0 To UBound(InParam)
    'qry.Parameters(i).Value = InParam(inti)
    Set ParamIn = New ADODB.Parameter
    Select Case TypeName(InParam(inti))
    Case "Integer"
    ParmType = adDouble
    Case "Double"
    ParmType = adDouble
    Case "String"
    ParmType = adChar
    Case "Null"
    ParmType = adDouble
    Case "Date"
    ParmType = adDate
    Case "Long"
    ParmType = adDouble 'jks 12/19/2002
    End Select
    Set ParamIn = qry.CreateParameter(ParamIn, ParmType, adParamInput)
    ParamIn.Value = InParam(inti)
    If TypeName(InParam(inti)) = "Null" Then
    ParamIn.Size = 0
    Else
    ParamIn.Size = Len(InParam(inti))
    End If
    qry.Parameters.Append ParamIn
    Next
    For intj = 0 To UBound(OutParam)
    Set ParamOut = New ADODB.Parameter
    Select Case TypeName(OutParam(intj))
    Case "Integer"
    ParmType = adDouble
    Case "Double"
    ParmType = adDouble
    Case "String"
    ParmType = adChar
    Case "Null"
    ParmType = adEmpty
    Case "Empty"
    ParmType = adDouble
    Case "Date"
    ParmType = adDate
    Case "Long"
    ParmType = adDouble 'jks 12/19/2002
    End Select
    Set ParamOut = qry.CreateParameter(ParamOut, ParmType, adParamOutput, 255)
    qry.Parameters.Append ParamOut
    Next
    'execute the stored procedure call
    qry.Properties("PLSQLRSet") = True
    Set RS = qry.Execute() 'rdOpenStatic, rdConcurReadOnly
    qry.Properties("PLSQLRSet") = False'
    For intj = 0 To UBound(OutParam)
    OutParam(intj) = qry.Parameters.Item(inti)
    inti = inti + 1
    Next
    If OutParam(0) <> 0 Then
    If OutParam(0) = 999 Then
    i = mErrors.DisplayError(Val(OutParam(0)), "SAM")
    Else
    MsgBox "Database returned error code " & OutParam(0) & "." & vbCrLf & " Unable to complete operation. "
    End If
    blnret = False
    End If
    If blnret Then
    Set GetSPResultSet = RS
    Else
    Set GetSPResultSet = Nothing
    End If
    Set RS = Nothing
    Set qry = Nothing
    Set ParamIn = Nothing
    Set ParamOut = Nothing
    exitGetSPResultSet:
    Exit Function
    errGetSPResultSet:
    blnret = ProcessError(Err)
    If Not blnret Then Set GetSPResultSet = Nothing
    Resume exitGetSPResultSet
    End Function
    The stored procedure is:
    CREATE OR REPLACE PACKAGE BODY D5750PGM.PckPLAudit IS
    PROCEDURE Sel_Smmry (
         lo_res_cd          out     number,
         LO_AUDIT_ID_TBL          out     pckclaudit.audit_id_tbl%type,
         lo_audit_dt_tbl          out     pckclaudit.audit_dt_tbl%type,
    lo_audit_type_tbl     out     pckclaudit.audit_type_tbl%type,
         lo_audit_status_tbl     out     pckclaudit.audit_status_tbl%type,
         lo_qty_selected_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_deselect_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_sent_tbl          out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_follow_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_received_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_ncpl_tbl          out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_security_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_closed_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_qty_sentsec_tbl     out     pckclaudit.audit_smmry_qty_tbl%type,
         lo_res_tbl          out     pcktbtable_type.res_tbl%type
    IS
    BEGIN
         PckAudit.Sel_Smmry (pckclglobal.lg_pl_proc, lo_res_cd,
         lo_audit_id_tbl,
         lo_audit_dt_tbl,
    lo_audit_type_tbl,
         lo_audit_status_tbl,
         lo_qty_selected_tbl,
         lo_qty_deselect_tbl,
         lo_qty_sent_tbl,
         lo_qty_follow_tbl,
         lo_qty_received_tbl,
         lo_qty_ncpl_tbl,
         lo_qty_security_tbl,
         lo_qty_closed_tbl,
         lo_qty_sentsec_tbl,
         lo_res_tbl
    END Sel_Smmry;
    END PckPLAudit;
    also, pckclaudit.audit_id_tbl%type is defined as
    TYPE audit_id_tbl_type IS TABLE OF disb_audit.disb_audit_id%TYPE
         INDEX BY BINARY_INTEGER ;
    and disb_audit.disb_audit_id%TYPE is defined as
    CREATE TABLE D5750.DISB_AUDIT
    DISB_AUDIT_ID NUMBER(9,0) NOT NULL,
    AUDIT_DT DATE NOT NULL,
    AUDIT_CODE_TYPE_ID VARCHAR2(5) NOT NULL,
    AUDIT_CODE_ID VARCHAR2(2) NOT NULL,
    CRTN_ID VARCHAR2(8) NOT NULL,
    CRTN_DT_TM DATE NOT NULL,
    etc.

  • Error when opening connection in SQL Developer 3.1

    I just downloaded SQL Dev 3.1 and had it copy my preferences from 3.0.0.4. Now when I try to open a connection I get the error message in the logging page:
    SEVERE     29     9453     oracle.dbtools.raptor.utils.Connections     For input string: ""
    This prevents me from executing any sql. When I try to see table data I get another error: SEVERE     32     47     oracle.dbtools.raptor.oviewer.table.GridDataEditor     java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    My 3.0 version works just fine. Any ideas?

    I finally got this to work. I had to remove all versions of SQL developer and then had to directory C:\Documents and Settings\(user_id)\Application Data\SQL Developer and remove the preferences for the old versions as well. Once I did this and downloaded 3.1 zip and extracted it now works.

  • Fatal error when trying to add derived table

    Hello,
    I'm new at desiging a universe. I get the following a fatal error when trying to add a derived table to my universe:
    1 processor x Family 15 Model 0 Stepping 0
    Windows 2000 Workstation  v5.1 build 2600 (S)
    Physical Total/Avail: 2.097.151 Kb / 2.004.940 Kb
    Temp directory C:\DOCUME1\xxxxxx\LOCALS1\Temp\ (1 Kb available)
    'Unknown' video card
       1280 x 768 in true color
    (doesn't make sense to me)
    I use an ODBC connection that connects to a MySQL database. When I test the connection it's fine.
    I am trying to add a derived table because it seems that my universe cannot produce LEFT OUTER JOINS.  I read somewhere that I should set my ansi92 parameter to YES instead of NO. But, everytime I re-open my universe, it sets itself automatically to NO again.
    My utlimate goal is :
    For example, list ALL the people, left join my table to their websites, but return ALL the people, even if they don't have a website.
    I dont' understand, my join should be simple enough.
    Anybody knows what could be causing all these restrictions ?
    Thanks for you help.
    Edited by: Sose Canadian on Feb 9, 2009 9:40 PM

    Hi Sose,
    In BusinessObjects (Universe) Designer, the outer join option in a join is not available and is dimmed when using a Generic ODBC connection.
    Try Following Solutions:
    Solution : 1
    When using an ODBC connection the odbc.prm must be modified on the machine where BusinessObjects Designer is used.
    Use the following steps to modify odbc.prm:
    1. Locate odbc.prm in the following folder:
    \Business Objects\Business Objects Enterprise 11\win32_x86\dataAccess\Connection Server\odbc
    2. Open odbc.prm in a text editor and modify the parameter 'EXT_JOIN' so its value is 'YES' instead of 'NO'.The outer join option is now available in BusinessObjects Designer.
    If the outer join option is still not available after following the steps above. open odbc.prm in a text editor and modify the parameter OUTERJOINS_GENERATION. Change its value from 'NO' to either 'ANSI92' or 'ODBC'.
    Solution : 2
    This can occur when user is using a non-database specific middleware such as generic ODBC. Generic ODBC allows creating a successful connection and universe, however will not allow the Outer Join option.
    The syntax for outer joins is specific to each database and the Generic ODBC driver only lets you access standard common features of all ODBC data sources.
    Ensure that you are using the database specific middleware to create the connection.
    I Hope this Helpsu2026.
    Thanksu2026.
    Pratik

Maybe you are looking for