ORA 28267: invalid namespace value executing sql on table in different db

I have a procedure in a package, in which I need to execute a select statement on a different db, for which I created a db link. Executing this in my IDE (sqldeveloper) works fine and returns expected value. But when I invoke this package via jdbc, it fails with the above sql exception. Looking at the error documentation/help was not useful so far.
The statement looks like this:
srcSqlstmt := 'select count(*) from ' || srctabname || '@' || srcDBName || ' where ' || columnname || ' is not null';
where srcDBName is a database link that I created, to another database which contains srctabName.
Appreciate any tips on resolving this. Thanks !

It appears that you've established a connection through the listener to one database and are trying to make a call-out to another. This is like a external procedure call but your call doesn't know how to reach the other listener. Why don't you create a view using a database link? Then, the call out would know where to go?
I recently blogged some database link stuff if you need syntax. You can find it here:
http://blog.mclaughlinsoftware.com/2008/09/01/cows-dont-fly-and-lobs-dont-resolve-across-a-db_link/

Similar Messages

  • ORA-28267: Invalid NameSpace Value Using DB Link

    Hi ,
    Getting the
    ORA-28267: Invalid NameSpace Value
    RA-02063: preceding line from dblink12
    I am trying to access the dblink through a datasource and I am using a managedBean in session scope to do it.
    The code for accessing db link through managed bean is ,
    Connection con = new ConnectionHandler().getConnection();
    String sql = " select name from table@dblink12";
    Statement stmt = null;
    ResultSet rs = null;
    String retValue = null;
    try
    stmt = con.createStatement();
    rs = stmt.executeQuery(sql);
    SelectItem item = null;
    if (rs.next()) {
    retValue = rs.getString("name");
    finally
    ConnectionHandler.close(rs, stmt, con);
    System.out.println("retValueARU: " + retValue);
    It works when I am trying to run through jDeveloper but not in the standalone weblogic installation.
    Any help will be appreciated.
    Thanks

    Thank you for your kindly answer,
    I forgot to say that oracle agent it's a standalone Oracle agent configured as in OBE documentation to run on port 20910 (and it's working)
    OraclediAgent it's an ODI JEE agent running on port 8001 (and it's generating the Invalid NameSpace Value error but only for the interface SQL_as_Source and with the dblink inside the query).
    Antonio

  • ORA-28267: Invalid NameSpace Value after upgrade to 11.1.1.5

    Hi Guys,
    So after we upgraded to 11.1.1.5 to fix an issue which effected 6 out of our 350 source tables in interfaces, we've hit a problem now which is effecting all 350 interfaces.
    We are using a dblink from our 11.2.0.2 DWH to a 10.2.0.2 source database. When ODI goes to load the target table (reading from a C$_ collection view with the db link in it) Im hitting ORA-28267: Invalid NameSpace.
    A little digging suggests it might be down to the jdbc driver.
    In my 11.1.1.3 install I see this :
    /oracledi/agent/drivers/ojdbc6.jar
    in my 11.1.1.5 install I see this :
    oracledi/agent/drivers/ojdbc6dms.jar
    I've tried the obvious of renaming the ojdbc6dms.jar to a backup and copying in the 11.1.1.3 driver ojdbc6.jar in in its place but I see no change (restarted agent)
    Can anyone suggest anything ? Do I need to start messing with classpaths in odiparams.sh ?
    I have logged an SR already, waiting to jump through the usual hoops before I start getting suggestions.
    Thanks in advance,
    Alastair

    OK I swapped out 4 occurances of the driver :
    11gODI/modules/oracle.jdbc_11.1.1/ojdbc6dms.jar
    11gODI/odi_misc/ojdbc6dms.jar
    11gODI/oracledi/agent/drivers/ojdbc6dms.jar
    11gODI/oracledi/client/jdev/extensions/oracle.odi.navigator/lib/ojdbc6dms.jar
    with the ojdbc6.jar from the 11.1.1.3 install ( I got mine here : /oracledi/agent/drivers/ojdbc6.jar )
    And it seems to be working fine now.

  • "ORA-28267 Invalid NameSpace" with APEX 4.0.1 and WebLogic server

    Hi all,
    I have a page that has a simple query as Region Source. It all worked fine on Apex 3.2 with the iAS mod pl/sql gateway.
    Query goes like this:
    select servername, a.capture_name, a.status, a.source_database, a.captured_scn, a.applied_scn, b.state_changed_time, b.state
    from DBA_CAPTURE@DBLNK_STRM_PADATARP a, V$STREAMS_CAPTURE@DBLNK_STRM_PADATARP b
    where a.CAPTURE_NAME (+)= b.CAPTURE_NAME
    (it reads out Oracle Streams status over a database link)
    After migrating the page to Apex 4.0.1 and WebLogic (Oracle 11g SOA suite) frontend, the Apex page now gives the "ORA-28267 Invalid NameSpace" error for some strange reason.
    Apex will now not validate the query in the edit region source page.
    I think maybe the problem lies with the WebLogic setup, but exactly what it might be eludes me.
    Anyone able to shed any light on this?
    Regards,
    -Haakon-

    Must have to do with the java based Apex Listener in conjunction with WebLogic and the execution of queries over database links.
    Workaround was to create a materialized view in Apex database and select from that instead.

  • Invalid NameSpace Value when Using DB Link

    I am receiving the following error within apex when I try to access data across a database link:
    failed to parse SQL query:
    ORA-28267: Invalid NameSpace Value
    ORA-02063: preceding line from DB_LINK
    When I access the same data using a database tool like Toad, I do not get the error.
    We are using:
    Apex 4.0.1
    Clustered WebLogic 10.3.4
    APEX_LISTENER_VERSION     1.0.2.238.15.24
    Database information
    CORE 11.2.0.1.0 Production
    NLSRTL Version 11.2.0.1.0 - Production
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
    I have a different database link that works just fine, the only difference between the db links that I know of is that the one with the error has select/insert/update/delete and the one that works has select only.
    Has anybody ever seen this?
    Thanks,
    Michelle

    Carl,
    Ok. Here's the results. Using a PL/SQL region with the function throws the same error (string buffer too small).
    So I checked the length of company_name and the longest string value is 47.
    Then I checked the _XL function and got the same error.  This is even showing in SQL Workshop's SQL Commands.
    SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY_XL(
    1,
    company_num,
    'SELECT company_num, company_name FROM pmd.company@CORP'
    FROM pmd.company@CORP
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Thank you,
    Ben

  • ORA-39001: invalid argument value dbms_datapump.open

    Hello,
    I'm trying to import objects in a tablespace from a remote database.
    The link source.de is working, but the dbms_datapump.open statements fails with below errors
    SQL> var h number;
    SQL> exec :h := dbms_datapump.open (operation => 'IMPORT',job_mode => 'TABLESPACE', remote_link => 'source.de');
    BEGIN :h := dbms_datapump.open (operation => 'IMPORT',job_mode => 'TABLESPACE', remote_link => 'source.de'); END;
    ERROR at line 1:
    ORA-39001: invalid argument value
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 2953
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 4603
    ORA-06512: at line 1
    When I describe dbms_datapump.open:
    FUNCTION OPEN RETURNS NUMBER
    Argument Name Type In/Out Default?
    OPERATION VARCHAR2 IN
    JOB_MODE VARCHAR2 IN
    REMOTE_LINK VARCHAR2 IN DEFAULT
    JOB_NAME VARCHAR2 IN DEFAULT
    VERSION VARCHAR2 IN DEFAULT
    COMPRESSION NUMBER IN DEFAULT
    Anyone familier with this problem?
    Regards,
    Tim

    ORA-39001: invalid argument value, could be because of the db_link (is not seen by the owner of the code, by the schema which has the rights to run the code).
    You can take a look at:
    <p>
    http://www.oracle-home.ro/Oracle_Database/10g_New_Features/Schema_refresh_DP.html</p>

  • Checkbox and ORA-20507: Invalid numeric value #:# for column

    Hi All,
    I'm facing problems Checkboxes in a form.
    I created a form and report on a table. one of the fields on the form is a checkbox and when ever I want to create a new record or update with more than one value for the checkkbox I obtain the following error:
    ORA-20507: Invalid numeric value #:# for column COLUMN_NAME Where by #:# is numbers
    I think the error occurs at the processes of get_pk and process_row_of_......
    how should I change the processes to accommodate the checkbox values.
    Kind regards
    Mel

    Hi Roel,
    Colunm = number
    LOV Definition
    select product display, prod_num return from product_category_vw
    where prod_num not in (select p.prod_num from product_user_tb p, user_tb u
    where p.user_num = u.user_number
    and u.user_name = :APP_USER)
    ORDER BY 1column = number
    LOV Definition
    select school d, sch_id r from school_tbRegards
    Mel

  • Getting ORA-01722 - Invalid number error in SQL

    I am trying to run a query like
    SELECT NVL (ic.industryclassdesc, 'NULL') industryclass,
    NVL (hci.updated_by, 'NULL') updatedby,
    NVL (hci.operation, 'NULL') operation,
    hci.audittimestamp audittimestamp
    FROM xxx_company_inxxxx hci, xxx_industry ic
    WHERE hci.company_id = 9079496
    AND ic.industryclassid = hci.industryclass_id
    ORDER BY DECODE (hci.operation, 'D', 'X', hci.operation), hci.audittimestamp
    And getting the error - ORA-01722 - Invalid number.
    But the columns - ic.industryclassid, hci.industryclass_id and also hci.company_id are 'Number' datatype and also not nullable.
    Can anyone suggest a approch

    SELECT NVL (ic.industryclassdesc, 'NULL')
    > industryclass,
    NVL (hci.updated_by, 'NULL') updatedby,
    NVL (hci.operation, 'NULL') operation,
    hci.audittimestamp audittimestamp
    xxx_company_inxxxx hci, xxx_industry ic
    WHERE hci.company_id = 9079496
    AND ic.industryclassid = hci.industryclass_id
    BY DECODE (hci.operation, 'D', 'X', hci.operation),
    hci.audittimestamp
    And getting the error - ORA-01722 - Invalid number.
    Do not enter 'String' in the nvl function,if the column is number datatype,
    venki
    null

  • ORA-02070: Error when updating a SQL Server table thru an Oracle View

    I have a SQL Server table TIMESHEET which contains a number of VARCHAR and NUMERIC columns plus a DATETIME column.
    Only the DATETIME column is giving me trouble.
    On the ORACLE side I have a view which selects from the SQL Server table but in order to get the SELECT to work, I had to either put a CAST or TO_DATE function call around the DATETIME field
    Below is the relevant part of the 2 view definitions I have tried
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    CAST("PeriodEnding" AS DATE) as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support CAST in this context
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    TO_DATE("PeriodEnding") as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support TO_DATE in this context
    If I don't include either the TO_DATE() or CAST() then I get
    Select Error: ORA-28527: Heterogeneous Services datatype mapping error
    ORA-02063:preceding line from OLEMSQLSANTDAS6
    Does anyone have any idea how to update a SQL Server DATETIME column thru an ORACLE view?

    You can't cast accross heterogenious databases and there is no need to. HSODBC treats SQL Server DATETIME column as DATE. For example, I have SQL Server table:
    CREATE TABLE [Ops].[T_JobType](
         [JobType] [varchar](50) NOT NULL,
         [JobDesc] [varchar](200) NULL,
         [InsertDt] [datetime] NOT NULL CONSTRAINT [InsertDt_00000006]  DEFAULT (getdate()),
         [InsertBy] [varchar](128) NOT NULL CONSTRAINT [InsertBy_00000006]  DEFAULT (user_name()),
         [LastUpdated] [datetime] NOT NULL CONSTRAINT [LastUpdated_00000006]  DEFAULT (getdate()),
         [LastUpdatedBy] [varchar](128) NOT NULL CONSTRAINT [LastUpdatedBy_00000006]  DEFAULT (user_name()),
    CONSTRAINT [T_JobType_PK] PRIMARY KEY CLUSTERED
         [JobType] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON [DATA01FG]
    ) ON [DATA01FG]Now on Oracle side I do:
    SQL> desc "Ops"."T_JobType"@pbods
    Name                                      Null?    Type
    JobType                                   NOT NULL VARCHAR2(50)
    JobDesc                                            VARCHAR2(200)
    InsertDt                                  NOT NULL DATE
    InsertBy                                  NOT NULL VARCHAR2(128)
    LastUpdated                               NOT NULL DATE
    LastUpdatedBy                             NOT NULL VARCHAR2(128)
    SQL> select "InsertDt" from "Ops"."T_JobType"@pbods;
    InsertDt
    18-AUG-08
    09-OCT-08
    22-OCT-09
    18-AUG-08
    19-NOV-08
    SQL> SY.

  • ORA-01722: invalid number caused with SQL using bind variable

    Hi,
    Im am hoping that someone can help me resolve a problem thats only just services and is being experienced on quite a few clients.
    our application uses C++ exes and makes OCI calls to the database.
    what has happened in the last week or so, there has been quite a few invalid number errors being received on a prod server but strangly enough we cannot reproduct the error on our UAT system.
    The sql is using bind variables and the information in the trace file shows that a number is being used for the bind variable, here is an extract from one trace file:
    for some schemas, the bind variable value is some currupted value, i think:
    oacdty=01 mxl=32(21) mxlc=00 mal=00 scl=00 pre=00
    oacflg=03 fl2=1206001 frm=01 csi=178 siz=32 off=0
    kxsbbbfp=9a8d62b8 bln=32 avl=03 flg=05
    value="Â*d"
    but on another schema, the value used is:
    Bind#0
    oacdty=01 mxl=32(32) mxlc=00 mal=00 scl=00 pre=00
    oacflg=03 fl2=1206001 frm=01 csi=178 siz=32 off=0
    kxsbbbfp=c5f92718 bln=32 avl=04 flg=05
    value="2101"
    however both produce invalid number errors.
    I am relatively inexperienced as a DBA so would appreciate as much help as i can get.

    Could you post your sql statement that is being run.
    Also post the query plan from your uat system and the one from your production system (They are likely to be different)
    You can export the stats from your production system and run them in your uat system. If you do this, then the execution plans should be the same on both systems(dbms_stats) and if you have the same data you should run into the same problem on uat as in production.
    The root cause of this type of problem is having a column in a table which holds values which are of different datatypes. Typically there is a condition in the where clause which indicates that for example only numeric columns should be retrieved from the column which holds multiple data types. However since the optimizer is free to rewrite the query any way it sees fit, (It does not necessarily execute in the order the sql statement is written) it does not filter this data first, and therefore you hit non-numeric data and run into the invalid number error.
    You can use little techniques like using an inline view with rownum in the column list, to perform the first filter. This ensures that the inline view is executed on its own, rather than being merged (materialized) with the rest of the query.
    A quick temporary solution is to use a comparison like to_char(column_name) = variable
    Make sure your comparisons are correct and it doesn't negatively impact on performance of the query

  • ORA-01722  Invalid Number while executing the Query

    Hi Friends,  need your valuable suggestions.
    We have a DSO with a   characteristic info object  ZDAT (DATA TYPE DATS)  with a reference from 0DATE.
    I am able to see the data of the info object ZDAT using LIST CUBE on the DSO.
    While using this info object ZDAT in the query moniter or bex analyzer it shows the  following errors.
    EORA-01722: invalid number .
    EError reading the data of InfoProvider.
    EError while reading data; navigation is possible   
    I>> Row: 71 Inc: NEXT_PACKAGE Prog: CL_SQL_RESULT_SET.
    Kindly please help me on this issue.

    Hello soumya
    Can you check if you have any NULL values in ZDAT in from LISTCUBE?
    If yes, check the note below
    https://service.sap.com/sap/support/notes/1327167.
    If null value is your problem, you can change the query setting for not to show the null values. Just add a filter in ZDAT to exclude "NULL"
    Regards
    Anindya

  • ORA-31038: Invalid number value: "NaN"

    Hi Experts,
    we are struggling with double fields in certain xml-files. In this files, the fields contain 'NaN', what should be standard conform according to IEEE (http://www.w3.org/TR/xmlschema-2/#double). The problem appears as we are trying to load these files into the xmltype-columns in the database.
    Thanks in advance
    Michael

    Michael
    XMLTYPE column, which has a XML-Schema underneathI guess that the XMLType column has an object-relational storage. If yes, per default a double is stored with a NUMBER datatype. If it is the case, you have to modify the XML Schema to use something like the following:
    <xs:element name="n" type="xs:double" xdb:SQLType="BINARY_DOUBLE"/>With this setting a BINARY_DOUBLE will be used instead of a NUMBER and, therefore, the error will be avoided.
    HTH
    Chris Antognini
    Troubleshooting Oracle Performance, Apress 2008
    http://top.antognini.ch

  • Executing sql from table with in plsql procedure

    I wonder if anyone can help.
    I have a table that stores sql statements. They are actually a set of rules that I want to apply to my application. My intention is to execute the statement in plsql.
    EG a sql statment held in the table might be:
    'select count(id) from item where item_id = ' || constants_pkg.c_test_item || ' and client_id = ' || client_id_in
    I am trying to call this from a plsql procedure, I’ve CUT OUT some of the procedure task_rec.rule holds the statement above. The procedure is failing “invalid SQL statement”, I think the client_id_in may not be evaluating as the variable, passed into the procedure and constants_pkg.c_test_item not being taken from the constants pkg.
    EG.
    PROCEDURE create_additional_info_list(
    client_id_in IN client.id%TYPE,
    IS
    result VARCHAR2(100);
    BEGIN
    EXECUTE IMMEDIATE
    task_rec.rule
    INTO result;
    END;
    If I was to do below the code would work ok. However I require the rule to come from the table.
    EXECUTE IMMEDIATE
    'select count(id) from item where item_id = ' || constants_pkg.c_test_item || ' and client_id = ' || client_id_in
    INTO result;
    Is there anyway constants_pkg.c_test_item and client_id_in can be evaluated as variables?

    Not that I've tried this but, if possible, change the SQL in the table to have bind variable; e.g.,
    'select count(id) from item where item_id = :1 and client_id = :2 ';
    Then in the procedure
    execute immediate task
    INTO result
    USING constants_pkg.c_test_item ,
    client_id_in ;

  • How to execute sql from table

    For a migration I have created a sql script that puts the full statement to be executed in a specific table column
    I'm now looking for a way how to execute those statements.
    Table structure like: oldName, newName, sqlStatement, id, otherField, otherField2
    Instead of the full statement(sqlStatement) it would also be possible to use the oldName, newName and id field if that simplifies the problem.
    The reason for building the statement and running that one is a) to validate upfront b) a self join is applied to the query result table to prevent some items for update.
    The initial idea was to take the sql statements and execute them as a sql script but that process is pretty slow.

    user2833655 wrote:
    For a migration I have created a sql script that puts the full statement to be executed in a specific table column
    I'm now looking for a way how to execute those statements.That is wrong, tables are for data not executable code
    Re: ref cursor - result set not known
    http://en.wikipedia.org/wiki/Data_%28computing%29
    >
    Data is often distinguished from programs. A program is a sequence of instructions that detail a task for the computer to perform. In this sense, data is thus everything that is not program code.
    >
    user2833655 wrote:
    The initial idea was to take the sql statements and execute them as a sql script but that process is pretty slow.This alternative will just make it difficult, complicated and unreliable as well.

  • Parameter value in RZ11 and table TPFET differs

    Hello!
    In order to check the value of several parameters in a SAP system we have in place a procedure that analyze that value against the table TPFET. In general it works pretty well (as far as you also consider the values defined in the kernel of SAP whenever there is not information in TPFET) but we have found one or two cases where the data look wrong.
    In particular, for 2 SAP systems we found that the value for an specific parameter was fill with some value in TPFET (login/multi_login_users but i guess the parameter is not relevant) but thru RZ11 the value looks empty (more precisely, the standard value, the profile value and the current value were empty). The only thing "strange" in TPFET for this value was that the column PSTATE shows "M" value.
    So the questions are:
    1) Do know why TPFET value differs from RZ11 one?
    2) What does "M" means in TPFET-PSTATE?
    Thanks in advanced,
    Félix

    Hi Felix,
    1) Do know why TPFET value differs from RZ11 one?
           There is a two tables  TPFYPROPTY   and TPFET. 
            1. TPFYPROPTY - In this table all standard values ( profile parameter values) will come by default ( RZ11).
            2. TPFET - This table is related to you RZ10 profile parameter values
    2) What does "M" means in TPFET-PSTATE?
                      M means Modified standard values in RZ10 profile parameters
    find below link
    Difference between maintaining parameter values... | SCN
    Thanks
    Siva

Maybe you are looking for

  • The format of XML file returned from web service

    Hi everyone, My web service (build in asp.net 2.0 with C#) returns the following xml file which is not what I want. <Root> <Root2> <Person> .... </Person> <Person> .... </Person> <Person> .... </Person> </Root2> </Root> But I want my web service to r

  • The headphone jack on my macbook pro is not working?

    There is no red light coming from the jack. I tried resetting my SMC. I used headphones with an external mic and the mic works, but still no sound from the headphones. The computer recognizes when they are plugged in and will switch off the internal

  • Batch valuation whilst goods receipt to purchase order

    Hi Experts, I've assigned and valuated a batch class to a raw material. Batch management is activated for the material. When posting goods receipt to a purchase order the system creates a batch but without valuation. My expectation is that the system

  • Itunes Malfunction

    Recently my itunes just stopped working, and now when I click to open it an error pops up sayin"Itunes connot open because required files are missing. Please re-install." So I went to apple.com to download most recent itunes and when I try to install

  • Ubuntu server 9.04 or 8.10

    hello linux gurus we have been using redhat since long time, but we plan to change and switch from redhat to ubuntu server can you suggest and advise what are pros and crons using ubuntu server along with oracle database 10g is some one has experienc