A problem with inconsistent datatypes

Whenever I try inserting a new record of type t_cliente_societa in my Cliente table, I get ORA-00932 inconsistent datatypes error and I'm not able to find the reason.
Could anyone help me? Thanks in advance.
I'll post my SQL code here. please ignore member functions for I havent' included the code necessary to create the needed tables.
I defined some types useful for storing informations about the entities I have to deal with.
The main type is t_cliente and its subtypes are t_cliente_pers and t_cliente_soc.
I use polymorphism to insert records based on subtypes instancies into a table based on supertype.
When I would add a new t_cliente_pers record, first I add it into Persona table and then into Cliente table.
The latter contains a REF to Persona for I have several "persons" who aren't "clients" and I use a single table to store them all.
create or replace TYPE t_indirizzo AS OBJECT (
via VARCHAR(45),
numero NUMBER(4),
cap INTEGER(5),
citta VARCHAR(30),
provincia VARCHAR(30),
regione VARCHAR(30),
MEMBER FUNCTION indirizzoCompleto RETURN VARCHAR
create or replace TYPE t_telefono AS OBJECT (
num_tel NUMBER(15)
create or replace TYPE t_telefono_array IS VARRAY(3) OF t_telefono
create or replace TYPE t_anagrafica AS OBJECT (
nome VARCHAR(45),
cognome VARCHAR(45),
sesso CHAR(1),
cod_fiscale VARCHAR(16),
data_nascita DATE
create or replace TYPE t_ragioneSociale AS OBJECT (
nome_soc VARCHAR(45),
data_cost DATE,
part_iva NUMBER(11)
create or replace TYPE t_persona AS OBJECT (
dati_anagrafici t_anagrafica,
indirizzo t_indirizzo,
email VARCHAR(45),
telefono t_telefono_array
create or replace TYPE t_societa AS OBJECT (
ragione_sociale t_ragioneSociale,
indirizzo t_indirizzo,
email VARCHAR(45),
telefono t_telefono_array,
persona_rif t_persona
create or replace TYPE t_cliente AS OBJECT (
cod_cliente NUMBER(8),
MEMBER FUNCTION incFatti RETURN NUMBER,
MEMBER FUNCTION incSubiti RETURN NUMBER,
MEMBER FUNCTION incFattiPeriodo RETURN NUMBER,
MEMBER FUNCTION incSubitiPeriodo RETURN NUMBER,
MEMBER FUNCTION nomeCliente RETURN VARCHAR,
MEMBER FUNCTION tipoCliente RETURN VARCHAR
) NOT FINAL
CREATE OR REPLACE TYPE BODY t_cliente AS
MEMBER FUNCTION incFatti RETURN NUMBER
IS incidenti NUMBER;
BEGIN
SELECT count(i. cod_incidente) INTO incidenti
FROM Incidenti i, Mezzi m
WHERE SELF.cod_cliente = m.possessore.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = ‘c’;
RETURN (incidenti);
END;
MEMBER FUNCTION incSubiti RETURN NUMBER
IS incidenti NUMBER;
BEGIN
SELECT count(i. cod_incidente) INTO incidenti
FROM Incidenti i, Mezzi m
WHERE SELF.cod_cliente = m.possessore.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = ‘s’;
RETURN (incidenti);
END;
MEMBER FUNCTION incFattiPeriodo (da DATE, a DATE) RETURN NUMBER
IS incidenti NUMBER;
BEGIN
SELECT count(i. cod_incidente) INTO incidenti
FROM Incidenti i ,Mezzi m
WHERE SELF. cod_cliente = m.possessore.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = ‘c’ AND (i.data BETWEEN da and a);
RETURN (incidenti);
END;
MEMBER FUNCTION incSubitiPeriodo (da DATE, a DATE) RETURN NUMBER
IS incidenti NUMBER;
BEGIN
SELECT count(i. cod_incidente) INTO incidenti
FROM Incidenti i ,Mezzi m
WHERE SELF. cod_cliente = m.possessore.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = ‘s’ AND (i.data BETWEEN da and a);
RETURN (incidenti);
END;
MEMBER FUNCTION nomeCliente RETURN VARCHAR
IS
BEGIN
RETURN TO_CHAR(cod_cliente);
END;
MEMBER FUNCTION tipoCliente RETURN VARCHAR
IS
BEGIN
RETURN (‘u’);
END;
END ;
create or replace TYPE t_cliente_pers UNDER t_cliente (
persona REF t_persona,
OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
) NOT FINAL
CREATE OR REPLACE TYPE BODY t_cliente_pers AS
MEMBER FUNCTION nomeCliente RETURN VARCHAR
IS nc VARCHAR(90) ;
BEGIN
SELECT concat(p.dati_anagrafici.nome, concat(' ',p.dati_anagrafici.cognome)) INTO nc
FROM d;
RETURN (nc);
END;
MEMBER FUNCTION tipoCliente RETURN VARCHAR
IS
BEGIN
RETURN (‘p’);
END;
END ;
create or replace TYPE t_cliente_soc UNDER t_cliente (
societa t_societa,
OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
) NOT FINAL
CREATE OR REPLACE TYPE BODY t_cliente_soc AS
MEMBER FUNCTION nomeCliente RETURN VARCHAR
IS
BEGIN
RETURN (ragione_sociale.nome_soc);
END;
MEMBER FUNCTION tipoCliente RETURN VARCHAR
IS
BEGIN
RETURN (‘s’);
END;
END ;
CREATE TABLE persona OF t_persona(
dati_anagrafici NOT NULL,
indirizzo NOT NULL,
email NOT NULL,
telefono NOT NULL,
PRIMARY KEY (dati_anagrafici.cod_fiscale)
CREATE TABLE cliente OF t_cliente(
PRIMARY KEY (cod_cliente)
CREATE SEQUENCE seqCliente
START WITH 1
INCREMENT BY 1
MINVALUE 1
NOMAXVALUE
NOCYCLE;
And finally this is the instruction that gives me problems.*
INSERT INTO cliente VALUES(
t_cliente_soc(
seqCliente.NEXTVAL,
t_societa(
t_ragioneSociale('Adecco', '01-gen-1999', '12345678901'),
t_indirizzo('Milano', '18', '21100', 'Varese', 'Varese', 'Lombardia'),
'[email protected]',
t_telefono_array(t_telefono('0332563214')),
t_persona(
t_anagrafica('Giulia', 'Macchi', 'f', 'MCCGLA80C23L682L', '23-gen-1980'),
t_indirizzo('Tofane', '2', '23026', 'Arona', 'Novara', 'Piemonte'),
'[email protected]',
t_telefono_array(t_telefono('0322123456'), t_telefono('3337894561'))
/

I eliminated the entire database and recreated everything. Now it works... Thanks anyway.

Similar Messages

  • Problem with number datatype dimension in BIB

    Hi,
    I've got a problem. When I create dimension with number datatype and I assign it to my cube, I cannot use my cube with my BIB presentation object - such as Crosstab. Is this possible only with varchar dimensions?

    It should work, but it would be helpful if you could specify more information, for example which errormessage you are seeing and where.

  • Problem with inconsistent print dialogue box/Aperture and Elements?

    I just purchased an Epson r1900. In Aperture everything is great! I can pull up icc profiles and the new print dialogue box features all the epson papers (glossy, Matte, Art, CD) in menus with submenus. But in Photoshop Elements 6, I get an old dialogue box which only shows the old Epson papers-Photo. Photo glossy, matte. There is no way, for instance, to choose Velvet art-and that is what I am using. It is driving me nuts. I have thrown out preferences, updated drivers, updated applications, fixed permissions...you name it. same thing in Apple Pages. Why am I not seeing the same dialogue box? Is this not OS controlled? The R1900 is always chosen. ( I do have an older printer as well, but definitely not selected.
    any guidance appreciated!
    thanks
    Nancie

    I have the same problem since I installed Snow Leopard. I have upgraded to the newest canon driver for my Canon Pixma IP5200 printer. Calibrating seems to no longer have a reliable impact on my prints. Also Aperture under SL will not save my preset information for media type, paper source or print quality in the print settings.
    I am assuming this is a bug related to SL and hopefully will be addressed soon... It is very frustrating as I have waisted a lot of time ink and photo paper in the days since I have moved up to SL
    When will we see a fix?

  • A Problem with custom Datatype

    Hi,
    I have a container i've defined that is passed between different sequnces as a parameter.
    As shown i the first window, there is a parameter of type BMR_RESET_REQUESTS.
    HOWEVER, in the second window it does not appear in the list of the custom data types of that file.
    How can that be??
    Thanks, Danny

    Hi,
    Not sure why its happened, but I can help correct it.
    Open the sequence file in notepad.exe or your favourite text editor.
    Find the lines
    [DEF, BMR_RESET_REQUESTS]
    %LOCATION = ""
    (its down the bottom of the file.
    Change the location to read
    [DEF, BMR_RESET_REQUESTS]
    %LOCATION = "UserTypes"
    Do the same for the line
    [DEF, port_to_reset]
    %LOCATION = ""
    to read as
    [DEF, port_to_reset]
    %LOCATION = "UserTypes"
    Now save the file and open in SeqEditor. Your Custom type should now appear.
    Regards
    Ray farmer
    Regards
    Ray Farmer

  • Problem with DATATYPES, in a UNION

    Hello,
    I m trying to disply a custom message when no data found using the below structure. Unfortunately I ve got a problem with the datatypes I m trying to union
    I ve tried various datatypes in the 2nd SELECT but the problem remain. Please help.
    SELECT HOSP_NAME "HOSPITAL", DOC_SUR "SURNAME", DOC_NAME "NAME", d.DOC_ID ID, Diagnosis
    FROM HOSPITAL h, DOCTOR d, (SELECT d.DOC_ID, COUNT (d.DIAGN_ID) Diagnosis
    FROM PATIENT_DIAGNOSIS d
    GROUP BY d.DOC_ID)
    WHERE Diagnosis > 1
    UNION ALL
    SELECT TO_CHAR('test'),TO_CHAR('test'),TO_CHAR('test'),TO_CHAR('test'), 0
    FROM DUAL
    WHERE NOT EXISTS (HOSP_NAME "HOSPITAL", DOC_SUR "SURNAME", DOC_NAME "NAME", d.DOC_ID ID, Diagnosis
    FROM ΝΟΣΟΚΟΜΕΙΟ h, ΙΑΤΡΟΣ d, (SELECT d.DOC_ID, COUNT (d.DIAGN_ID) Diagnosis
    FROM PATIENT_DIAGNOSIS d
    GROUP BY d.DOC_ID)
    WHERE Diagnosis > 1);
    ORA-01790: expression must have same datatype as corresponding expression
    01790. 00000 - "expression must have same datatype as corresponding expression"

    HOSP_NAME "HOSPITAL", DOC_SUR "SURNAME", DOC_NAME "NAME", d.DOC_ID ID, DiagnosisWhat is the data type of these columns
    TO_CHAR('test'),TO_CHAR('test'),TO_CHAR('test'),TO_CHAR('test'), 0What are you doing here 'test' is already a character. Why are you using TO_CHAR?

  • Problems with Pro*C and the double datatype

    Hi!
    I'm working with Pro*C 8.1.7 on HPUX 11.0, but I've a problem
    with the datatype double.
    On runtime, I got a Bus Error (core dumped) when try assign a
    double bind_variable (Pro*C) with a double variable (ANSI_C)
    For example:
    typedef struct xxxx
    float item_ANSI_C;
    double variable_ANSI_C;
    } xxxx;
    void procedure_name()
    EXEC SQL BEGIN DECLARE SECTION;
    xxxx *POINTER;
    double double_bind_variable_PRO*C;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL WHENEVER SQLERROR DO (...);
    for (i = 0; ; i++)
    EXEC SQL WHENEVER NOT FOUND DO break;
    EXEC SQL FETCH cursor INTO (...),
    :double_bind_variable_PRO*C,
    POINTER.item_ANSI_C = other_bind_variable_PRO*C;
    (***)POINTER[i].variable_ANSI_C = double_bind_variable_PRO*C;
    (***): In this point the program throw BusError(core dumped).
    However, the float datatype does not.
    ------- End Example -------------
    Somebody have any solution for this problem? Please.
    Thanks, in advance.
    Alex.

    Hi Franz,
    Though it's a bit late, I'll leave this trace for those who follow.
    IRecordset also has Fields->Item.
    What might work is:
    IField * field;
    field = rec->Fields->Item(0);
    field->get_Value(0); (or something similar for your environment).                
    I couldn't find any documentation either.
    The C++ examples are not overwhelming, are they?
    Worse, they are not supported. Otherwise SBO-support is very hilfsbereit.
    Cheers,
    Evert

  • Problem with version sets in Elements 12

    I have just started using elelments 12.  I have been having problems with inconsistency in forming version sets.  Some sets forms as expected.  However, quite often after editing, when returning to Organizer the edited picture is not in a version set with the original and in fact is not even visible.  I can get to the edited version only through the "Open" tab in the Editor.  I have check the appropriate "Save in version set" in the save menu. Suggestions? 

    Seems you have the same problem :
    http://forums.adobe.com/thread/1309160?start=0&tstart=0
    The source of the problem is not clearly found today. It seems that happens on previously converted catalogs.
    A workaround seems to have been found : killing the autoanalyzer.exe process in the task manager.

  • Data slice inconsistency problem with hierarchy nodes

    Hi Experts,
    We want to lock planning tables from function. We create the appropriate data slices but there are problems with (material group) hierarchy nodes.
    If I give the node as input variable to the function it causes inconsistency in the data slice. If I choose and add this node to the lock in modeler, the problem is the same.
    We are using the following variables to create a data slice:
    0VERSION
    0VTYTYPE
    0COMP_CODE
    ZGRMAT (developed material group)
    Z_YEARCR (developed yera created)
    The problem also exist if I set an another type of node e.g. destination country (0RECIPCNTRY) instead of material group.
    For me, the problem seems to be generic.
    Do you have any idea?
    Many thanks in advance
    Peter

    There is a note related to this proble:
    Note 1070608 - Lowflag field is not valid
    The implementation of this note resolves the problem.
    Peter

  • Problems with java constructor: "inconsistent data types" in SQL query

    Hi,
    I tried to define a type "point3d" with some member functions, implemented in java, in my database. Therefor I implemented a class Point3dj.java as you can see it below and loaded it with "loadjava -user ... -resolve -verbose Point3dj.java" into the database.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    package spatial.objects;
    import java.sql.*;
    public class Point3dj implements java.sql.SQLData {
    public double x;
    public double y;
    public double z;
    public void readSQL(SQLInput in, String type)
    throws SQLException {
    x = in.readDouble();
    y = in.readDouble();
    z = in.readDouble();
    public void writeSQL(SQLOutput out)
    throws SQLException {
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(z);
    public String getSQLTypeName() throws SQLException {
    return "Point3dj";
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    public static Point3dj create(double x, double y, double z)
    return new Point3dj(x,y,z);
    public double getNumber()
         return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);
    public static double getStaticNumber(double px, double py, double pz)
         return Math.sqrt(px*px+py*py+pz*pz);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Additionally, I created the corresponding type in SQL by
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CREATE OR REPLACE TYPE point3dj AS OBJECT EXTERNAL NAME
    'spatial.objects.Point3dj' LANGUAGE JAVA USING SQLDATA (
    x FLOAT EXTERNAL NAME 'x',
    y FLOAT EXTERNAL NAME 'y',
    z FLOAT EXTERNAL NAME 'z',
    MEMBER FUNCTION getNumber RETURN FLOAT
    EXTERNAL NAME 'getNumber() return double',
    STATIC FUNCTION getStaticNumber(xp FLOAT, yp FLOAT, zp FLOAT) RETURN FLOAT
    EXTERNAL NAME 'getStaticNumber(double, double, double) return double')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    After that I tried some SQL commands:
    create table pointsj of point3dj;
    insert into pointsj values (point3dj(2,1,1));
    SELECT x, a.getnumber() FROM pointsj a;Now, the problem:
    Everything works fine, if I delete the constructor
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    in the java class, or if I replace it with a constructor that has no input arguments.
    But with this few code lines in the java file, I get an error when executing the SQL command
    SELECT x, a.getnumber() FROM pointsj a;The Error is:
    "ORA-00932: inconsistent data types: an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class expected, an Oracle type that could not be converted to a java class received"
    I think, there are some problems with the input argument of the constructor, but why? I don't need the constructor in SQL, but it is used by a routine of another java class, so I can't just delete it.
    Can anybody help me? I would be very glad about that since I already tried a lot and also search in forums and so on, but wasn't successful up to new.
    Thanks!

    Dear Avi,
    This makes sense when it is a short code sample (and i think i've done that across various posts), but sometime this is too long to copy/paste, in these cases, i refer to the freely available code samples, as i did above on this forum; here is the quote.
    Look at examples of VARRAY and Nested TABLES of scalar types in the code samples of my book (chapter 8) http://books.elsevier.com/us//digitalpress/us/subindex.asp?maintarget=companions/defaultindividual.asp&isbn=9781555583293&country=United+States&srccode=&ref=&subcode=&head=&pdf=&basiccode=&txtSearch=&SearchField=&operator=&order=&community=digitalpress
    As you can see, i was not even asking people to buy the book, just telling them where to grab the code samples.
    I appreciate your input on this and as always, your contribution to the forum, Kuassi

  • 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

  • Error 'Inconsistent datatypes' with Java classes

    Hi,
    I have some Java classes loaded in Oracle 8.1.6, mapped as Object Types, so when I create one object from PL/SQL, JVM ought to create the matching Java object, communicating via the SQLData interface.
    Unfortunately, after the code:
    pippo:=OraMailer('mail.server.com','mymail');
    that creates the PL/SQL object, any code that use member procedures or function wrapping instance methods of the Java class fails with the error 932: Inconsistent datatypes.
    I looked for a mistake in my PL/SQL and Java code, but no error was found.
    It is very important: help me!!!
    Thx

    So here is what you are doing:
    ArrayList results = //get employees from database
    ListIterator langIt = results.listIterator();
    while (langIt.hasNext()) {
      Employee emp = langIt.next();
      String name2 = emp.getName();
      String SSNo = emp.getSSNum();
      results.add(name2);
      results.add(SSNo);
    }So you get a list or Employee objects, then you get an iterator over the list. For each Employee in the list you add the name and SSNo as Strings back to the same list. From the API for ConcurrentModificationException the exception can be thrown when you modify a collection while iterating over the collection - which is precisely what you are doing.
    The ListIterator interface allows you to modify the list through its own methods. Try using:
      langIt.add(name2);
      langIt.add(SSNo);instead.
    Why are you taking the name and SSNo out of the Employee object and placing them back in the same List anyway? That makes no sense to me.

  • SCCM 2012 Update Group inconsistency Problem with Red marked Updates

    Hi everybody,
    we have a big Problem with our SCCM 2012 R2 CU3 Enviroment, regarding of Update Groups which got out of sync.
    we have a SCCM Site Infastructure with one CAS and 4 Primary Sites and on every Site is the SUP Role installed.
    I don't know when this failure occours but i think it was after the CU3 Installation. The Installation itself went smooth without any Errors or Warnings.
    The Problem is as following. We have some updates in Update Groups (all of them are Core XML Updates) which are out of sync and marked red as an invalid Update on 2 Primary Sites. On the CAS Site and the 2 other Primary SItes they are marked as green (downloaded
    yes and deployed yes)
    We have no Replication issues regarding the Replication Status (everything is synchronized to 100%) and the Replication Link Analyzer does also show no Problems at all.
    I now deleted the Deployments and the SW Update Group waited until the replication was fine and created a new one and downloaded these patches on one of the Primary Sites which had shown this Failure.
    The Result was not good. It looks like before. On the CAS and 2 Primary Sites the Deplyment is shown as downloaded but on the other 2 Sites the Status is again Downloaded=no.
    Does anybody have any idea what to do now ? I checked objmgr.log and rcmctr. log but found nothing what shows me the way in the right direction.
    Thx for your time, and it would be fine if anybody can share knowledge about this failure and how to fix it.
    All other Ideas are also welcome.
    Thx a lot in advance and have a nice bug free day :-)
    Bastian

    Hi,
    Please try to manually synchronize software updates from the CAS and monitor the WSUSCtrl.log, WCM.log and wsyncmgr.log on the CAS and Primary sites.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Problem while importing table with blob datatype

    hi i am having a database 9i on windows xp and dev database 9i on AIX 5.2
    while i am taking export of normal tables and trying to import i am successful.but when i am trying to import a table with blob datatype it is throwing "tablespace <tablespace_name> doesn't exist" error
    here how i followed.
    SQL*Plus: Release 9.2.0.1.0 - Production on Mon Oct 8 14:08:29 2007
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Enter user-name: test@test
    Enter password: ****
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    SQL> create table x(photo blob);
    Table created.
    exporting:
    D:\>exp file=x.dmp log=x.log tables='TEST.X'
    Export: Release 9.2.0.1.0 - Production on Mon Oct 8 14:09:40 2007
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Username: pavan@test
    Password:
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    Current user changed to TEST
    . . exporting table X 0 rows exported
    Export terminated successfully without warnings.
    importing:
    D:\>imp file=x.dmp log=ximp.log fromuser='TEST' touser='IBT' tables='X'
    Import: Release 9.2.0.1.0 - Production on Mon Oct 8 14:10:42 2007
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Username: system@mch
    Password:
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP and Oracle Data Mining op
    tions
    JServer Release 9.2.0.6.0 - Production
    Export file created by EXPORT:V09.02.00 via conventional path
    Warning: the objects were exported by PAVAN, not by you
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    import server uses US7ASCII character set (possible charset conversion)
    . importing TEST's objects into IBT
    IMP-00017: following statement failed with ORACLE error 959:
    "CREATE TABLE "X" ("PHOTO" BLOB) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS "
    "255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "TESTTB"
    "S" LOGGING NOCOMPRESS LOB ("PHOTO") STORE AS (TABLESPACE "TESTTBS" ENABLE "
    "STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE STORAGE(INITIAL 65536 FREE"
    "LISTS 1 FREELIST GROUPS 1))"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'TESTTBS' does not exist
    Import terminated successfully with warnings.
    why it is happening for this table alone?plz help me
    thanks in advance

    Here is exerpt from {
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:378418239571}
    =============================================
    Hi Tom,
    I have a dump file containing blob datatypes, when i import the dump file in a schema it gives an
    error stating that the tablespace for Blob datatype does not exists. My question is how do i import
    the dump file in the default tablespace of the importing user.
    Followup March 2, 2004 - 7am US/Eastern:
    You'll have to precreate the table.
    do this:
    imp userid=u/p tables=that_table indexfile=that_table.sql
    edit that_table.sql, fix up the tablespace references to be whatever you want to be, run that sql.
    then imp with ignore=y
    for any MULTI-SEGMENT object (iot's with overflows, tables with lobs, partitioned tables, for
    example), you have to do this -- imp will not rewrite ALL of the tablespaces in that
    multi-tablespace create -- hence you either need to have the same tablespaces in place or precreate
    the object with the proper tablespaces.
    Only for single tablespace segments will imp rewrite the create to go into the default if the
    requested tablespace does not exist.
    ===================================================
    To summarize: precreate target table when importing multi-segment tables

  • PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER

    Hi all,
    Wondering if you could assist? I'm exploring User Types and having a small problem. I'm getting the above error for a user type I have created which I'm calling in a function. Here's what my code looks like which I'm running the 'scott' schema for testing purposes
    SQL> CREATE OR REPLACE TYPE NBR_COLL AS TABLE OF NUMBER;
    2 /
    Type created.
    SQL> create or replace FUNCTION first_rec_only
    2 (
    3 NUM_ID IN NUMBER
    4 ) RETURN NUMBER IS
    5 v_num NBR_COLL;
    6 BEGIN
    7 select deptno into v_num from dept;
    8 RETURN v_num(v_num.FIRST);
    9 END first_rec_only;
    10 /
    Warning: Function created with compilation errors.
    SQL> show errors
    Errors for FUNCTION FIRST_REC_ONLY:
    LINE/COL ERROR
    7/4 PL/SQL: SQL Statement ignored
    7/11 PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got
    NUMBER
    SQL>
    Any clues to what I'm doing wrong? Cheers.

    The deptno column is a number, you cannot directly select a number into your type, you need to use your type's constructor.
    Something like:
    CREATE OR REPLACE FUNCTION first_rec_only (NUM_ID IN NUMBER) RETURN NUMBER IS
       v_num NBR_COLL;
    BEGIN
       SELECT nbr_coll(deptno) INTO v_num from dept;
       RETURN v_num(v_num.FIRST);
    END first_rec_only;Note that although this will compile, it will throw ORA-01422: exact fetch returns more than requested number of rows when you run it. you need to either use the input parameter as a predicate on your query against dept, use rownum = 1 in the query or use bulk BULK COLLECT INTO, depending on what exactly you want to accomplish.
    John

  • Function issue:  inconsistent datatypes?

    Hi all.
    I'm having an issue with a function that converts coordinates to a spatial data type.
    My database version is:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE     11.2.0.2.0     Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Here's my package that I'm using
    create or replace package make_geometry
    as
                function get_geometry_from_coords (p_coords in clob  )
              return sdo_geometry;
    end;
    create or replace package body make_geometry
    as
              function get_geometry_from_coords (p_coords in clob)
              return sdo_geometry
              is
                 v_geometry sdo_geometry;
              begin
                 --with t as (select p_coords coords from dual)
              select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
                                  ,cast(multiset(
                                      select ordset
                                     from (
                                            select regexp_substr( regexp_replace(
                                                                                replace(p_coords,chr(10))
                                                                                 ,' {1,}',',')
                                                                  ,'[^,]+',1,level)  ordset
                                                  ,rownum rn
                                              from dual
                                                               connect by level <= length(regexp_replace(regexp_replace(
                                                                                                   replace(p_coords,chr(10))
                                                                                                   ,' {1,}',','),'[^,]+')) + 1
                                            where mod(rn,3) <> 0
                        ) as sdo_ordinate_array))
                  into v_geometry
                  from dual;
                  return v_geometry;
              end;
    end;
    /basically, it takes a list of coordinates, in the following format:
    with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,-12.379271400499997,0 ' coords from dual)replaces the spaces with commas and splits the resultant string by comma, then removes the third coordinate in each set (sets delimited by spaces in above example) and converts the result to sdo_geometry type.
    This logic is not where my problem is occurring
    If I run the query found in the package separately, it works fine:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,
    -12.379271400499997,0 ' coords from dual)
      2            select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
      3                                ,cast(multiset(
      4                                    select ordset
      5                                   from (
      6                                          select regexp_substr( regexp_replace(
      7                                                                              replace(coords,chr(10))
      8                                                                               ,' {1,}',',')
      9                                                                ,'[^,]+',1,level)  ordset
    10                                                ,rownum rn
    11                                            from t
    12                                                             connect by level <= length(regexp_replace(regexp_replace(
    13                                                                                                 replace(coords,chr(10))
    14                                                                                                 ,' {1,}',','),'[^,]+')) +
    1
    15                                                               )
    16                                          where mod(rn,3) <> 0
    17                      ) as sdo_ordinate_array))
    18                from dual;
    MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),CAST(MULTISET(SELECTORDSETFROM(SELECTREGEXP_SUBSTR(REGE
    XP_REPL
    SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(130.882141, -12.37759, 130.881893, -12.378
    438, 13
    0.881649, -12.379271, NULL))but if I call the function:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378
    -12.379271400499997,0 ' coords from dual)
      2  select make_geometry.get_geometry_from_coords(coords)
      3    from t;
    select make_geometry.get_geometry_from_coords(coords)
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    ORA-06512: at "HR.MAKE_GEOMETRY", line 13If I change the package to expect varchar2 the above example coordinate list works fine, but obviously that doesn't work when the coordinate list exceeds 4000 characters.
    any thoughts?

    not sure that is the problem:
    SQL> create table foo (mr_clob clob);
    Table created.
    SQL>
    SQL> insert into foo values ('testing'||chr(10)||'testing');
    1 row created.
    SQL>
    SQL> select replace(mr_clob,chr(10),'blah') from foo;
    REPLACE(MR_CLOB,CHR(10),'BLAH')
    testingblahtesting
    1 row selected.

Maybe you are looking for

  • I know my Apple Id (not .mac) and password but I can't logon to ichat.  I keep getting a message of password not matched.  Do I need to create a new account for Ichat?

    I know my Apple Id (it isn't ".mac") and password but I can't log on to ichat.  I keep getting a message of password not matched.  I saw somewhere that my Apple id is the same as my ichat account.  Do I need to create a new account for Ichat?  I've a

  • OS X Server and PHP

    Hi, please help... I installed OS X Server on Mavericks and php isn't run... Why? Previously ran...  index.php page reads HTML, but not include php file... "php include". Thank You.

  • PhotoShop CS4 Feather Effect

    Windows Ultimate PhotoShop CS4 Dear friends I have a picture , which is cut from one side and I wanna smoothen the cut side by adding a "feather Effect" to make it look more natural I did this many times befor , but for some reason I can't remember h

  • Aplication manager gives error Code: U43M1U49

    Hello, i had running CS6 fine and up to date. Then i downloaded Photoshop elements 11 trial and installed to chek it out. After uninstalling that the problems began. So i uninstalled CS6, did run the Adobe creative suite cleaner and reinstalled CS6.

  • New Apple Keyboard with MacBook Pro

    Hi - I got the new Apple keyboard today and in spite of other users opinion - I like it very much. It is small and very silent. I had a good feeling for the touch from the start. I love the new keys for multimedia, especially those for iTunes. Only c