Getting ORA-00932 with any object table
Hi, I'm new to Oracle and it's enormous community so I apologize in advance for posting
in the wrong place or for giving not enough information.
As I just said, I'm new to Oracle therefore I'm following the [introductory guide|http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14260/adobjint.htm#sthref102] and trying the examples it gives one-by-one.
I used to use MySql in the past but now I need to use a more stable and scalable database that allows
the storage of objects.
I'm using Oracle 10.g XE on a GNU/Linux computer (Ubuntu 8.10)
Let's start with the question:
in the Example 1-6 the following code is given:
CREATE TYPE emp_person_typ AS OBJECT (
name VARCHAR2(30),
manager REF emp_person_typ );
Type created.
CREATE TABLE emp_person_obj_table OF emp_person_typ;
Table created.
INSERT INTO emp_person_obj_table
SELECT emp_person_typ ('Bob Jones', REF(e))
FROM emp_person_obj_table e
WHERE e.name = 'John Smith';
1 row(s) inserted.Executing these queries return successfull messages.
But when I try to retrieve the records by using this query:
select * from emp_person_obj_table;or when accessing the "Data" tab of that table in the Object Browser"
I get this error:
(error report:)
ORA-00932: inconsistent datatypes: expected NUMBER got REF RESMAN.EMP_PERSON_TYPAll queries are executed in the Application Express (2.1.0.00.39) query runner.
I think I did everything in the right manner, although the code is just copy-pasted from the guide, so I can't realize
why this annoying error is still appearing when accessing that table.
I noticed that executing the same selection query as above in the SQL*Plus CLI works as expected
and returns a resultset.
Thanks in advance for any reply.
Since the query works in SQL*Plus, I would tend to assume that this is a limitation of the APEX query runner. If you post over in the APEX forum, someone may be able to confirm that or suggest a way of working around it.
Do you need to use the APEX query runner? Could you use SQL*Plus or SQL Developer instead?
Justin
Similar Messages
-
ORA-00932 Using Structured XML Table
Hello,
I'm having a problem in trying to create and use a Structured XML Table.
I have created very small sample that illustrates my problem:
I have registered the following schema:
<schema
targetNamespace="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd"
xmlns:jjm="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<complexType name="JjmType">
<choice maxOccurs="unbounded">
<element name = "Key" type = "string"></element>
<element name = "Type" type = "string"></element>
<element name = "AccessID" type = "string"></element>
</choice>
</complexType>
<element name ="Jjm" type="jjm:JjmType"/>
</schema>'
Then I created the following table:
CREATE TABLE JJM_SCHEMA of XMLType
XMLSCHEMA "http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd"
ELEMENT "Jjm";
Then I inserted the following row:
insert into JJM_SCHEMA values(xmltype('<Jjm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
<Key>anp</Key>
<Type>User</Type>
<AccessID>TSL2</AccessID>
</Jjm>'));
Then I do the following query:
SELECT
extract(value(x),
'/Jjm[Type="User"]') AS jjmXML FROM JJM_SCHEMA x
WHERE existsNode(value(x),'/Jjm[Type="User"]') = 1;
I get this error:
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected UDT got CHAR
However, if I remove the Xpath predicate [Type="User"] from the "extract()" function and WHERE clause...
SELECT
extract(value(x),
'/Jjm') AS jjmXML FROM JJM_SCHEMA x
WHERE existsNode(value(x),'/Jjm') = 1;
The query works.
Also, If I change the schema from <choice maxOccurs="unbounded"> to <sequence>... either query works.
I need the "choice" type element to work with the Xpath predicate. Am I missing something?
Thanks in advance.
Jim McDowallJim
Which version of the database are you using...
Testing with 9.2.0.4.0 I had to add an xmlns declaration to the instance document before I could insert it into the table
<Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd" xsi:noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
<Key>anp</Key>
<Type>User</Type>
<AccessID>TSL2</AccessID>
</Jjm>
However once that was done I get the following.
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Aug 20 15:40:32 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> spool testcase.log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> set pages 10000
SQL> set feedback on
SQL> set lines 132
SQL> --
SQL> SELECT extract(value(x),'/Jjm[Type="User"]') AS jjmXML
2 FROM JJM_SCHEMA x
3 WHERE existsNode(value(x),'/Jjm[Type="User"]') = 1
4 /
JJMXML
<Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
<Key>anp</Key>
<Type>User</Type>
<AccessID>TSL2</AccessID>
</Jjm>
1 row selected.
Elapsed: 00:00:02.07
SQL> SELECT extract(value(x),'/Jjm') AS jjmXML
2 FROM JJM_SCHEMA x
3 WHERE existsNode(value(x),'/Jjm') = 1;
JJMXML
<Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
<Key>anp</Key>
<Type>User</Type>
<AccessID>TSL2</AccessID>
</Jjm>
1 row selected.
Elapsed: 00:00:00.00
SQL> /
JJMXML
<Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
<Key>anp</Key>
<Type>User</Type>
<AccessID>TSL2</AccessID>
</Jjm>
1 row selected.
Elapsed: 00:00:00.00
SQL> quit -
How to get the List of Database Objects (Table/View) for a given APEX Page.
Hi,
I have an application and that consist of pages like page1,2,3,.....
*1.* I want a report which can give me the list of all the Pages1,2,3,....
I am using the following query to acheive this.... THIS IS FINE..
select a.workspace, a.owner, a.application_name, b.page_id, b.page_name
from apex_applications a,
apex_application_pages b
where a.workspace = b.workspace
and a.application_id = b.application_id*2. Now, I want for each individual page*, the list all the database objects (tables/views), which that page is using.
I am using ALL_DEPENDENCIES , but I am not getting the result.
So, want to know if there any view/table, where I can get the Application Pages & there database object list...
Thanks,
DeepakHari,
Thanks for the response.
The view APEX_APPLICATION_PAGE_DB_ITEMS will only give me the table name related to any Page Items defined to that page..It will not give me all the database objects..
suppose we have a Page, having a report based on multiple tables and there is no Page items defined on that page, we will not have any value in this ....DB_ITEMS table. same thing if we have define some PL|SQL(using some table/view) in a Process, that will not be populated in .....DB_ITEMS table. I want some thing like all the database objects (table/views/function/procedure/.....) for a particular Page ID.
Thanks,
Deepak -
Get ORA-00932 inconsistent datatype when passing parameter in tableadapter
I have to build a Dataset to use as source for Microsoft rdlc-Report.
In the Dataset I create a tableadapter using plain SQL.
In my SELECT-Command I have to pass a Date parameter:
I've tested a SELECT like in the following example:
SELECT a.field1, a.field2, field3
FROM table a
WHERE a.createdate < :IN_DATE In the tableadapter query-builder I get data, but after storing the command I get following error-message:
ORA-00932 inconsistent datatypes expected date got number
Later I have to pass the Date parameter in a Function like
SELECT a.field1, a.field2, getvalue(a.field3,:IN_DATE) FROM table aIm using ODP.NET 11g on a 10g Oracle DB server.
Is there a possibility to pass a Date parameter?
I hope anyone has a tipp...
RoswithaCheck the OracleParameter here: http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/cook_masteringdotnet.html
Ming Man -
Getting "ORA-00932: inconsistent datatypes: expected - got CLOB"
Hi:
I've got a stored procedure that is attempting to open a cursor for a SQL string and getting an error. The query in the string is only a select (i.e. I'm not updating anything). I'm not doing a bind because the sole reason for doing any of this is just to validate the SQL. I am given some XML and I translate it into SQL and before saving the XML off because I want to verify that it actually translates into valid SQL. The validation test is dmbs_sql.parse().
I've tried using varchar2 and CLOB as the sql string argument but still get the error. What is the inconsistency that Oracle is complaining about?
Oracle 10.2.0.3 on RHEL 4 (64 bit)
Thanks
PROCEDURE SaveXML(XMLClob in CLOB, status out integer) IS
chandle INT;
sqlString VARCHAR2(4000);
errorString VARCHAR2(300) := 'NO ERRORS.' ;
xmldata XMLType; -- The XMLType format of the XML to transform
xsldata XMLType; -- The XMLType format of the stylesheet to apply
stylesheetClob CLOB; -- The stylesheet in CLOB form.
BEGIN
status := -1;
-- Before saving, convert the XML to SQL and parse it to verify that it will in
-- fact be able to be represented later as a valid SQL query.
-- Get the stylesheet from the stylesheet table.
select stylesheet into stylesheetClob from saved_query_stylesheets
where name = 'SAVED_QUERY.XSL' and rownum = 1
order by version desc;
xmldata := XMLType.createXML(XMLClob);
xsldata := XMLType.createXML(stylesheetClob);
sqlString := rto_char(dbms_xmlgen.convert(xmldata.transform(xsldata).getStringVal(),
dbms_xmlgen.ENTITY_DECODE) ) ;
-- dbms_output.put_line('Length of query string is ' || length(sqlString));
if(length(sqlString) <= 0) then
dbms_output.put_line('NO sqlString obtained!');
return;
end if;
begin -- catch the exception in this block
dbms_output.put_line('SaveXML(): parsing XML now.');
-- The parse command wants a cursor
chandle := dbms_sql.open_cursor;
Dbms_sql.parse(chandle, sqlString, DBMS_SQL.NATIVE);
DBMS_SQL.CLOSE_CURSOR(chandle);
status := 0;
dbms_output.put_line('SaveXML() successful!! Returning...');
EXCEPTION
WHEN OTHERS THEN
DBMS_SQL.CLOSE_CURSOR(chandle);
DBMS_OUTPUT.PUT_LINE('Exception occurred and caught! ' || SQLERRM);
end ;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Exception occurred ' || SQLERRM);
status := 0;
END SaveXML;Do you mean
select dbms_lob.SUBSTR(stylesheet ,1,2000) into stylesheetClob from saved_query_stylesheets
where name = 'SAVED_QUERY.XSL' and rownum = 1
order by version desc;
I modified it to be dbms_lob.SUBLSTR(stylesheet,1,4000)...
and now I get a different errror.
Exception occurred ORA-30625: method dispatch on NULL SELF argument is disallowed
This makes me think that internally there is an extract on an empty node or something, i.e., it's data related?
Update: I think I'm getting the 30625 error because one of my clobs is null and I'm getting the final query string by using (among other things) a command that includes getStringVar().
SQLQuery := dbms_xmlgen.convert(xmldata.transform(xsldata).getStringVal(), dbms_xmlgen.ENTITY_DECODE);So I guess I'll track that down :)
SUBSTR(
STR1 CLOB CHARACTER SET ANY_CS,
POS NUMBER, -- starting position
LEN NUMBER := 2147483647) -- number of characters
RETURN CLOB CHARACTER SET STR1%CHARSET;
Edited by: Gaff on Apr 21, 2009 10:55 AM -
Impossible to create an index with an object table
Is it possible to use object tables with Oracle Spatial ?
With Oracle 8.1.7.0.0, here is the example where I encounter a problem (this example works of course with an equivalent relational table) :
create or replace type zonegeo as object (
id integer, definitionGeo MDSYS.SDO_GEOMETRY
create table essaigeo of zonegeo (id PRIMARY KEY)
OBJECT ID PRIMARY KEY;
INSERT INTO USER_SDO_GEOM_METADATA
VALUES ('ESSAIGEO','DEFINITIONGEO',
MDSYS.SDO_DIM_ARRAY(
MDSYS.SDO_DIM_ELEMENT('X', 47680.000, 1197822.000, 0.005),
MDSYS.SDO_DIM_ELEMENT('Y', 1620431.000, 2677441.000, 0.005)
NULL -- SRID
CREATE INDEX ESSAIGEO_SPATIAL_IDX
ON ESSAIGEO(DEFINITIONGEO)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS ('SDO_LEVEL = 6);
ERREUR ` la ligne 1 :
ORA-29855: erreur d'exicution de la routine ODCIINDEXCREATE
ORA-13203: ichec de lecture de la table USER_SDO_GEOM_METADATA
ORA-13203: ichec de lecture de la table USER_SDO_GEOM_METADATA
ORA-06512: ` "MDSYS.SDO_INDEX_METHOD", ligne 8
ORA-06512: ` ligne 1In Oracle 8.1.7 you cannot embed a geometry type in another type and index it.
In 9i, you can , but not in the way you've defined it, i.e. you have to create a regular
table, and have a column of type zonegeo, and make a few other changes, i.e.:
create or replace type zonegeo as object (
id integer, definitionGeo MDSYS.SDO_GEOMETRY
create table essaigeo (zone zonegeo);
INSERT INTO USER_SDO_GEOM_METADATA
VALUES ('ESSAIGEO','ZONE.DEFINITIONGEO',
MDSYS.SDO_DIM_ARRAY(
MDSYS.SDO_DIM_ELEMENT('X', 47680.000, 1197822.000, 0.005),
MDSYS.SDO_DIM_ELEMENT('Y', 1620431.000, 2677441.000, 0.005)
NULL -- SRID
CREATE INDEX ESSAIGEO_SPATIAL_IDX
ON ESSAIGEO(ZONE.DEFINITIONGEO)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS ('SDO_LEVEL = 6); -
Is event handling possible with any object?
can i set a event notification to any object? say for example if i have a multidimensional array of strings can i associate a event handler with it so that when a different application or part of a code changes it's contents i can fire a method?
consider the scenario
initially...
String userId[][]=new String[R][C];
public MyServer()
userId[0][0] = "mr00047";
userId[0][1] = "false";
userId[1][0] = "dider7";
userId[1][1] = "false";
userId[2][0] = "thegreendove";
userId[2][1] = "false";
}now at some point the content of the userId array changes
for(int i=0;i<3;i++)
if(temp.equals(MyServer.userId[0]))
flag=true;
MyServer.userId[i][1]="true"; // I want to fire a method from this point
break;
can any body tell me how can i do it? please help!!!This could help you: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Observable.html
-
Hi,
i'm getting ora-22922 nonexistent LOB value with
apex_collection.create_collection_from_query('coll_name','select a,b,c from testtable','NO');
what is going wrong?
please help !!
thx in advance !!!Hi Dila,
unless you let us know what
TESTTABLEexactly is, we probably can't help you. -
Nested table update gets ORA-00904 with ExecuteSQL, error-free in TOAD
I'm trying to run an UPDATE query through the ExecuteSQL method
of the oraDatabase object. The catch seems to be that this one
affects a nested table (field to be updated is a table itself).
This SQL runs perfectly in T.O.A.D. ...
UPDATE B457.AIRLINE a SET
a.rental_cust_code=B457.RENTCUSTCODELIST(rentcustcodes
('45645'),rentcustcodes('1234'),rentcustcodes('234234')) WHERE
a.AIRLINE_CODE='RCR'
...but, it produces the "SQL execution error, ORA-00904: invalid
column name" when run using ExecuteSQL.
Do I need to use a different syntax?and the complete example
SQL> create or replace TYPE t_indirizzo AS OBJECT (
2 via VARCHAR(45),
3 numero NUMBER,
4 cap INTEGER(5),
5 citta VARCHAR(30),
6 provincia VARCHAR(30),
7 regione VARCHAR(30)
8 );
9 /
Type created.
SQL>
SQL>
SQL> create or replace TYPE t_telefono AS OBJECT (
2 num_tel NUMBER(15)
3 );
4 /
Type created.
SQL>
SQL> create or replace TYPE t_listaTelefono AS TABLE OF t_telefono
2 /
Type created.
SQL>
SQL> create or replace TYPE t_cliente AS OBJECT (
2 cod_cliente NUMBER(8),
3 indirizzo t_indirizzo,
4 email VARCHAR(30),
5 telefono t_listaTelefono
6 ) NOT FINAL;
7 /
Type created.
SQL>
SQL> CREATE TABLE cliente OF t_cliente(
2 cod_cliente NOT NULL,
3 indirizzo NOT NULL,
4 email NOT NULL,
5 PRIMARY KEY (cod_cliente)
6 ) nested table telefono store as numTelCli_tab
7 return as value
8 /
Table created.
SQL> -
I had to purchase a new Mac Book Pro. When I tried to download Adobe Flash Player, it wouldn't take any of my passwords. I had to change my Apple ID last week, but nothing worked. Can I reset my Adobe Flash Player password and if so, how do I do that? Thanks
Hi Donna,
Please see What userid & password do I need to install Flash Player? for info on the password being requested.
Maria -
Help with error select case statement (ORA-00932: inconsistent datatypes)
Hi,
I'm struggling to get my sql query work on Oracle..
I have a table MyTable with 5 columns ( Column1, Column2, Column3, Column4, Column5 ) all are of type NVARCHAR2.
I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2.
For example
If a row contains the following values,
Column 2 = a.b
Column 3 = 123
Column 4 = xyz
then column CA = a.b/123/xyz where column CA = temp column
If either Column 3 or Column 4 is empty/null, then I don't need to append value for that column..
For example
Column 2 = a.b
Column 3 = either NULL or ''
Column 4 = xyz
then CA = a.b/xyz where column CA = temp column
similarly..
Column 2 = a.b
Column 3 = 123
Column 4 = either NULL or ''
then CA = a.b/123 where column CA = temp column
Here is my query..
select MyTable.Column1 as CA0,
MyTable.Column2 as CA1,
MyTable.Column3 as CA2,
MyTable.Column4 as CA3,
MyTable.Column5 as CA4,
MyTable.Column2 + CASE WHEN MyTable.Column3 > '' THEN '/' + MyTable.Column3 ELSE '' END + CASE WHEN MyTable.Column4 > '' THEN '/' + MyTable.Column4 ELSE '' END CA
from MyTable;
This query works just fine against SQL Server db, but gainst Oracle I'm getting
ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
00932. 00000 - "inconsistent datatypes: expected %s got %s"
Could you please let me know what I'm doing wrong. I need to get this query working on both SQL Server and Oracle..
Please let me know your suggestions and thoughts..
Cheers,I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2. In Oracle, you can do it this way - no need to do all kinds of difficult things:
select col2||col3||col4
from tbl -
Unable to expand table (or 'any' object) node - permissions issue?
I am the dba for a database and hence have access to the system user. When I connect to the db through SQL Developer, I can expand the table node under any user and list tables. As I can with any object node.
I now want to create an admin user that has restricted capabilities, one of which will be to view objects, such as tables etc..
(I will ultimately do this via a role to allow multiple users to have the admin capabilities, but for now have just created an admin_user userid).
However, when I connect to the database using this admin_user userid, I am unable to expand any object node.
I have played with different permissions, granting 'select any dictionary', 'select_catalog_role', 'select on dba_tables' but the user still can not view any objects via the appropriate node. eg. attempting to go to Other Users - username - Tables just shows nothing. (There are no filters).
However the admin_user can run a SQL command to view the tables. eg. Select * from dba_tables, will list all tables for all users within the database. So they DO appear to have the appropriate access.
So why can't they see the tables in the tables node?
Is there some piece of configuration within SQL Developer itself that I have overlooked?
CheersI am the dba for a database and hence have access to the system user. When I connect to the db through SQL Developer, I can expand the table node under any user and list tables. As I can with any object node.
I now want to create an admin user that has restricted capabilities, one of which will be to view objects, such as tables etc..
(I will ultimately do this via a role to allow multiple users to have the admin capabilities, but for now have just created an admin_user userid).
However, when I connect to the database using this admin_user userid, I am unable to expand any object node.
I have played with different permissions, granting 'select any dictionary', 'select_catalog_role', 'select on dba_tables' but the user still can not view any objects via the appropriate node. eg. attempting to go to Other Users - username - Tables just shows nothing. (There are no filters).
However the admin_user can run a SQL command to view the tables. eg. Select * from dba_tables, will list all tables for all users within the database. So they DO appear to have the appropriate access.
So why can't they see the tables in the tables node?
Is there some piece of configuration within SQL Developer itself that I have overlooked?
Cheers -
ORA-00932 when trying to pass ARRAY from Java SP to PL/SQL
Hi all
I am trying to pass ARRAYs back and forth between PL/SQL and Java stored procedures. But I keep getting:
ORA-00932: inconsistent datatypes: expected a return value that is an instance of a user defined Java class convertible to an Oracle type got an object that could not be converted
Here's my PL/SQL:
create or replace type CONTENTP.sentences_array as VARRAY(1000) of CLOB
-- I've also tried .. as TABLE of CLOB and varray/table of VARCHAR2
declare
proc_clob CLOB;
arr SENTENCES_ARRAY;
begin
SELECT document_body
into proc_clob
from documents
where document_id = 618784;
arr := processdocument.sentencesplit (proc_clob);
end;
PROCESSDOCUMENT package definition:
CREATE OR REPLACE PACKAGE CONTENTP.PROCESSDOCUMENT AS
FUNCTION sentenceSplit(Param1 CLOB)
return SENTENCES_ARRAY
AS
LANGUAGE java
NAME 'com.contentp.documents.ProcessDocument.sentenceSplit(oracle.sql.CLOB) return oracle.sql.ARRAY';
FUNCTION removeHTML(Param1 CLOB)
return CLOB
AS
LANGUAGE java
NAME 'com.contentp.documents.ProcessDocument.removeHTML(oracle.sql.CLOB) return oracle.sql.CLOB';
end;
Java sentenceSplit code:
public static oracle.sql.ARRAY sentenceSplit ( CLOB text) throws IOException, SQLException
Connection conn = new OracleDriver().defaultConnection();
String[] arrSentences = sent.getsentences ( CLOBtoString (text) );
ArrayDescriptor arrayDesc =
ArrayDescriptor.createDescriptor ("SENTENCES_ARRAY", conn);
ARRAY ARRSentences = new ARRAY (arrayDesc, conn, arrSentences);
return ARRSentences;
I have confirmed that the String[] arrSentences contains a valid string array. So the problem seems to be the creation and passing of ARRSentences.
I have looked at pages and pages of documents and example code, and can't see anything wrong with my declaration of ARRSentences. I'm at a loss to explain what's wrong.
Thanks in advance - any help is much appreciated!I am trying to do something similar but seems like getting stuck at registerOutParameter for this.
Type definition:
CREATE OR REPLACE
type APL_CCAM9.VARCHARARRAY as table of VARCHAR2(100)
Java Stored Function code:
public static ARRAY fetchData (ARRAY originAreaCds, ARRAY serviceCds, ARRAY vvpcs) {
Connection connection = null;
ARRAY array = null;
try {
connection = new OracleDriver ().defaultConnection();
connection.setAutoCommit(false);
ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", connection);
String[] result = new String [2];
result[0] = "Foo";
result[1] = "Foo1";
array = new ARRAY (adString, connection, result);
connection.commit ();
return array;
} catch (SQLException sqlexp) {
try {
connection.rollback();
} catch (SQLException exp) {
return array;
Oracle Stored Function:
function FETCH_TRADE_DYN_DATA (AREA_CDS IN VARCHARARRAY, SERVICE_CDS IN VARCHARARRAY,VV_CDS IN VARCHARARRAY) return VARCHARARRAY AS LANGUAGE JAVA NAME 'com.apl.ccam.oracle.js.dalc.TDynAllocation.fetchData (oracle.sql.ARRAY, oracle.sql.ARRAY, oracle.sql.ARRAY) return oracle.sql.ARRAY';
Java Code calling Oracle Stored Procedure:
ocs = (OracleCallableStatement) oraconn.prepareCall(queryBuf.toString());
ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", oraconn);
String[] originAreaCds = sTDynAllocationVO.getGeogAreaCds();
ARRAY areaCdArray = new ARRAY (adString, oraconn, originAreaCds);
ocs.registerOutParameter(1, OracleTypes.ARRAY);
ocs.setArray (2, areaCdArray);
String[] serviceCds = sTDynAllocationVO.getServiceCds();
ARRAY serviceCdsArray = new ARRAY (adString, oraconn, serviceCds );
ocs.setArray (3, serviceCdsArray);
String[] vvpcs = sTDynAllocationVO.getVesselVoyagePortCdCallNbrs();
ARRAY vvpcsArray = new ARRAY (adString, oraconn, vvpcs);
ocs.setArray (4, vvpcsArray);
ocs.execute();
ARRAY results = ocs.getARRAY(1);
Error I get:
Parameter Type Conflict: sqlType=2003
Thanks for help in advance. -
Replace function and ORA-00932 Help
Hi ,
We have field name PARAM of type LONG
values of PARAM are :
1)345
2)[email protected]
3)http://ghf.hq.fde.com:9211/psp/VADEV/EMPLOYEE/FIN/c/
4)kennedy
I am getting ORA-00932 Inconsistent data types expected number got LONG when i ran below SQL .
update tbl_parms set param = 'http://efs.hq.def.com/psp'
where param like 'http%';
Please someone could help in fixing this error .
Also ,I am interetsed to just replace http://ghf.hq.fde.com:9211 with http://efs.hq.def.com
can we do with REPLACE or SUBSTRING functions ? the length of URL may vary .
bye,
KarYou can't refer to LONG columns in WHERE clause
"LONG columns cannot appear in WHERE clauses or in integrity constraints"
see http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adfnstyp.htm#435338
You should think about migrating from LONG to CLOB. But in the mean time, the easiest solution may be to
- dump tbl_parms into a file
- delete the lines you don't need to change
- edit the rows you want to change using an editor (regular expressions will help your search and replace):
- apply as an update script eg
UPDATE TBL_PARMS
SET PARAM='the complete value for a parameter'
WHERE PARAM_ID=3Are any of your parameters longer than 4000 chars? If not, consider simply making a version of the table with PARAM varchar2(4000) andupdating there, using REPLACE, SUBSTR etc.
create table new_params
( id number not null, param varchar2(4000))
begin
for x in (select id, param from tbl_parms)
loop
insert into new_params (id, param) values (x.id, x.param);
end loop;
end;
/HTH
Regards Nigel -
Hello,
I have some problems with dbms_xmlschema.registerschema
My database is: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
My XSD schema is (SEPA pain.002.001.03.xsd) also available on this url: http://code.google.com/p/leontestbed/source/browse/trunk/bc2/sample/Schema/pain.002.001.03.xsd?r=241
After
begin
DOK_XML_UTIL.p_vnesi_xsd_blob(401941242); -- store a XSD on file system from blob field
dbms_xmlschema.registerschema(
schemaurl => 'http://localhost/TEST1.XSD',
schemadoc => bfilename('ETAX_LOAD','TEST1.XSD'),
csid => nls_charset_id('AL32UTF8'));
commit;
end;I get:
ORA-31084: error while creating table "INIS_PROD"."Document2781_TAB" for element "Document"
ORA-02320: failure in creating storage table for nested table column "XMLDATA"."CstmrPmtStsRpt"."OrgnlPmtInfAndSts"
ORA-01792: maximum number of columns in a table or view is 1000
ORA-02310: exceeded maximum number of allowable columns in table
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 65
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 136
ORA-06512: at line 4
What I'am doing wrong or what is the reason for this error..Arrgghhh.....
begin
DOK_XML_UTIL.p_vnesi_xsd_blob(401941242);
dbms_xmlschema.registerschema(
schemaurl => 'http://localhost/TEST1.XSD',
schemadoc => bfilename('ETAX_LOAD','TEST1.XSD'),
csid => nls_charset_id('AL32UTF8')
, local => true
, genTypes => false
, genTables => false);
commit;
end;sorry...
Maybe you are looking for
-
New Tcode for Subcontracting process
In ECC 6.0 EP4, there is a new Subcontracting functionality regarding the movement types for components. The existing process uses tcode ME2O and movement type 541 is used in order to move components form the plant to the subcontractor in 1 step. Now
-
I have added a pie chart to a page with about 14 diffirent categories. The problem is that the label overlaoe each ther for that category whose data is relativley less then other category e.g cat1 2 cat2 100 cat3 200 So the label of cat1 will overlap
-
Putting Iphoto Originals folder back into Iphoto
I was looking for my imported photo files in iPhoto and found them using spotlight. I moved the "Originals" folder in order to access it more easily and was unable to return it to its original place in iPhoto. This is because the icon in my HD is not
-
Thank You. GodBless.
-
I have an odd sample rate problem: I have put in some music at 44.1 (while all other audio is at 48kHz.) At most points this is, surprisingly, not an issue. But if I haved 4 channels of 48kHz sound then EITHER the 44.1 sound OR the 48kHz sound will n