Invalid data type

Hello

I have the following tables:


create table wine cellars
(winecellarname varchar2 (50) primary key,)
location varchar2 (50).
owner varchar2 (50).
Phone varchar2 (50).
Museum char(1),
BLOB of logo
);

create table wines
(winetype, varchar2 (50))
winecathegory varchar2 (50).
year number 4.
winecellarname varchar2 (50).
VARCHAR2 (50) of origin;
primary key (winetype, winecathegory, year, winecellarname).
Foreign key (winecellarname) references winecellarname on delete cascade
);

But in the line which belongs to the sentence: create vdt TOAD gives me the following error: error on line 13. ORA-00902: invalid data Type

I don't understand the reason for this error and I can fix it.

Thank you. Concerning

Found the problem:

create table vino
( tipovino varchar2(50),
categoriavino varchar2(50),
anovendimia number(4),
nombrebodega varchar2(50),
denominacionorigen varchar2(50),
precio/lproduc number(5),
litrosproduc number(10),
precio/lpublico number(5),
primary key (tipovino,categoriavino,anovendimia,nombrebodega),
foreign key (nombrebodega) references bodega on delete cascade
)
/

' Precio/lproduc' and "price/lproduc" columns contain a ' / ', which is not legal!

Try this:

create table vino
( tipovino varchar2(50),
categoriavino varchar2(50),
anovendimia number(4),
nombrebodega varchar2(50),
denominacionorigen varchar2(50),
precio_lproduc number(5),
litrosproduc number(10),
precio_lpublico number(5),
primary key (tipovino,categoriavino,anovendimia,nombrebodega),
foreign key (nombrebodega) references bodega on delete cascade
)
/

and it works perfectly. (See where I replaced ' / ' by '_' in two of these column names?)

Hope that helps,

-Mark

PS The reminder! Don't forget to close the issue and awarded points accordingly.

Tags: Database

Similar Questions

  • ORA-00902: invalid data type on xmltable

    Hello

    I learn XMLTABLE but not able to run the following queries,

    with xml11g as
    (
    select '<?xml version="1.0"?>
    <purchaseorder orderdate="1999-10-20">
      <shipto country="us">
        <name>alice smith</name>
        <street>123 maple street</street>
        <city>mill valley</city>
        <state>ca</state>
        <zip>90952</zip>
      </shipto>
      <billto country="us">
        <name>robert smith</name>
        <street>8 oak avenue</street>
        <city>old town</city>
        <state>pa</state>
        <zip>95819</zip>
      </billto>
      <comment>hurry, my lawn is going wild!</comment>
      <items>
        <item partnum="872-aa">
          <productname>lawnmower</productname>
          <quantity>1</quantity>
          <usprice>148.95</usprice>
          <comment>confirm this is electric</comment>
        </item>
        <item partnum="926-aa">
          <productname>baby monitor</productname>
          <quantity>1</quantity>
          <usprice>39.98</usprice>
          <shipdate>1999-05-21</shipdate>
        </item>
      </items>
    </purchaseorder>' myxml from dual
    )
    select s.*, b.*
    from xml11g t,
      xmltable ('/purchaseorder' passing
        xmlparse(document t.myxml)
        columns
          "shipto" xml,
          "billto" xml
        ) x,
        xmltable ('/shipto' passing x."shipto"
          columns
            "name" char(20),
            "street" char(40),
            "city" char(40),
            "state" char(2),
            "zip" number(10)
        ) s,
        xmltable ('/billto' passing x."billto"
          columns
            "name" char(20),
            "street" char(40),
            "city" char(40),
            "state" char(2),
            "zip" number(10)
        ) b;
    
    

    It is showing me special suite

    < zip > 90952 < / zip >

    *

    ERROR on line 10:

    ORA-00902: invalid data type

    Please guide me what I'm missing here.

    Thanks and greetings

    Alexander gelin

    For me the (slightly modified) works:

    [sql]

    with xml11g as
    (
    Select ' 
     
       
        Alice Smith 
        123 maple Street 
        Mill Valley 
        CA 
        90952 
       
       
        Robert Smith 
        8 Oak avenue 
        old town 
        PA 
        95819 
       
      Hurry, my lawn is going wild
    !                 lawn mower        1        148.95        confirm this is electric                    baby monitor        1        39.98        1999-05-21            "double myxml. ) Select *. of xml11g t.   XMLTable ('/ purchaseorder' by the way)     xmlParse (document t.myxml)     columns       "shipto" XMLtype,       "billto" XMLtype     )     x,     XMLTable ("' / shipto' passing x." ShipTo")       columns         'name' char (20)         , 40 "Street."         'city' 40,         'State' (2) tank.         "zip" INTEGER     + 1 ,     XMLTable ("' / billto' passing x." BillTo")       columns         'name' char (20),         40 "Street."         'city' 40,         'State' (2) tank.         "zip" INTEGER    

    ) b ;

    [SQL]

  • From a function table: invalid data type error

    Hello

    I'm a ORA-00902: invalid data type error when I try to call the function from a select statement below. Here, I am leaving an array from a function.
    create or replace package pkg10
    as
    
    type tabletype1 is table of table1%rowtype
    index by binary_integer;
    
    function func1 return tabletype1;
    
    end pkg10;
    create or replace package body pkg10
    as
    
    function func1 return tabletype1 
    is
        v_tab1 tabletype1;
        idx integer;
    begin 
    
        idx := 1;
        
        for i in (select * from table1)
        loop
            v_tab1(idx).name1 := i.name1;
            v_tab1(idx).key := i.key;
            idx := idx+1;
            
        end loop;
    
    return v_tab1; 
    
    end func1; 
    
    end pkg10;
    select * from table(pkg10.func1);
    Please point out to me where I'm wrong.

    Thank you

    Sathya Vamsi says:
    Hello

    I'm a ORA-00902: invalid data type error when I try to call the function from a select statement below. Here, I am leaving an array from a function.

    create or replace package pkg10
    as
    
    type tabletype1 is table of table1%rowtype
    index by binary_integer;
    
    function func1 return tabletype1;
    
    end pkg10;
    
    create or replace package body pkg10
    as
    
    function func1 return tabletype1
    is
    v_tab1 tabletype1;
    idx integer;
    begin 
    
    idx := 1;
    
    for i in (select * from table1)
    loop
    v_tab1(idx).name1 := i.name1;
    v_tab1(idx).key := i.key;
    idx := idx+1;
    
    end loop;
    
    return v_tab1; 
    
    end func1; 
    
    end pkg10;
    
    select * from table(pkg10.func1);
    

    Please point out to me where I'm wrong.

    Thank you

    you try to use a data type of PL/SQL as part of an SQL statement. is NOT authorized.

  • I get an error-invalid data type

    DECLARE
    CURSOR med_rec_cur
    IS
    SELECT *.
    OF temp_records_med;

    p_success NUMBER;
    strQuery VARCHAR2 (10000);
    v_count NUMBER;
    v_filename temp_records_med.filename%TYPE;

    TYPE med_rec_tab IS TABLE OF temp_records_med % ROWTYPE;

    ErrNum NUMBER;

    Slno_tab TYPE IS a TABLE OF VARCHAR2 (100);

    v_med_rec_tab med_rec_tab;
    dml_errors EXCEPTION;
    v_slno NUMBER;
    v_all_slno VARCHAR2 (1000);
    v_slno_tab slno_tab;
    tba_slno temp_records_med.slno%type;

    BEGIN
    OPEN med_rec_cur.

    LOOP
    BEGIN
    EXTRACTION med_rec_cur
    LOOSE COLLECTION v_med_rec_tab LIMIT 1000;

    FORALL I IN 1... v_med_rec_tab. COUNT SAVE EXCEPTIONS
    INSERT INTO meddetail
    VALUES v_med_rec_tab (i)
    RETURN slno BULK COLLECT INTO v_slno_tab;

    EXCEPTION
    WHEN dml_errors
    THEN
    v_all_slno: = ', '. To_char (v_all_slno);
    END;

    EXIT WHEN med_rec_cur % NOTFOUND;
    END LOOP;

    CLOSE Med_rec_cur;

    INSERT INTO BOSSDRAGON - INVALID DATA TYPE
    SELECT * FROM TEMP_RECORDS_MED WHERE SLNO NOT IN (SELECT tba_slno FROM)
    (TABLE (CAST (v_slno_tab AS slno_tab) tba_slno))) ;

    END;

    Published by: user8731258 on Sep 6, 2010 23:14

    Casting will not change the fact that you have a local collection type in a SQL statement, which is not allowed. You can create a stand-alone type with CREATE TYPE? Or use something like SYS. DBMS_DEBUG_VC2COLL that is already defined.

    You don't need a CAST explicitly in the TABLE expressions after around Oracle 8i.

  • table (cast - invalid data type problem

    Hi all

    Baseline scenario:

    --------------------------
    PACKAGE
    --------------------------
    create or replace
    PACKAGE C2_PAYMENT_DOC IS

    Bin_array TYPE TABLE IS NUMBER
    INDEX OF DIRECTORY;

    FUNCTION test_fun (l_doc_id IN integer) RETURN bin_array;
    --------------------------
    PACKAGE_BODY
    --------------------------
    create or replace
    package C2_PAYMENT_DOC as body

    Bin_array test_fun (l_doc_id-IN integer) FUNCTION RETURNS IS
    l_gross bin_array;
    Start
    c2_purchase_invoice.get_inv_gross_amount (l_doc_id, l_gross (1));
    Return l_gross;
    end;
    END;
    --------------------------
    QUERY
    --------------------------
    Select * from Table (Cast (c2_payment_doc.test_fun (1) as bin_array));

    The query result is ORA-00902: invalid data type
    How can I make the valid select statement?
    Thanks in advance,
    Bartek

    You cannot use local collection types in SQL. You must create a bin_array of type like nested SQL table type. In addition, depending on the version you will not cast:

    SQL> CREATE OR REPLACE
      2    TYPE bin_array
      3      AS TABLE OF NUMBER
      4  /
    
    Type created.
    
    SQL>  create or replace
      2   PACKAGE C2_PAYMENT_DOC IS
      3  FUNCTION test_fun(l_doc_id IN integer) RETURN bin_array;
      4  end;
      5  /
    
    Package created.
    
    SQL> create or replace
      2  package body C2_PAYMENT_DOC as
      3
      4  FUNCTION test_fun (l_doc_id IN integer) RETURN bin_array IS
      5  l_gross bin_array := bin_array();
      6  begin
      7      l_gross.extend;
      8      l_gross(1) := l_doc_id;
      9  return l_gross;
     10  end;
     11  END;
     12  /
    
    Package body created.
    
    SQL> select * from Table(Cast(c2_payment_doc.test_fun(1) As bin_array));
    
    COLUMN_VALUE
    ------------
               1
    
    SQL> select * from Table(c2_payment_doc.test_fun(1))
      2  /
    
    COLUMN_VALUE
    ------------
               1
    
    SQL> 
    

    SY.

  • Creating a table: invalid data type

    Hello

    I want to create two tables, which is why the following script:

    create table wine cellars
    (winecellarname varchar2 (50) primary key,)
    location varchar2 (50).
    owner varchar2 (50).
    Phone varchar2 (50).
    Museum char(1),
    BLOB of logo
    );


    create table wines
    (winetype, varchar2 (50))
    winecathegory varchar2 (50).
    year number 4.
    winecellarname varchar2 (50).
    VARCHAR2 (50) of origin;
    primary key (winetype, winecathegory, year, winecellarname).
    update the foreign key (winecellarname) winecellarname references on Delete on cascade
    );

    But in line 13 of the script, which is the line winetype varchar2 (50), gives the text following error-> invalid data type

    Everyone knows that is the cause? I used Toad as a client to manage the script and Oracle 10 g as a server.

    Thank you. concerning

    Then, when you create tables in Oracle, referencing foreign key, you don t need to use on the update clause to maintain the reference to integrity? This is valid for MySQL Server?

    not sure that your average, but you have to update... use only on the deletion clause.
    read reference to url... I told you

  • table font PL/SQL: ORA-00902: invalid data type

    I m is

    PL/SQL: ORA-00902: invalid data type

    error in


    OPEN FOR PPymtCur
    SELECT *.
    TABLE (CAST (up_gap_tra_reports.myArray AS traArray));

    in my up_gap_tra_reports package.

    CREATE OR REPLACE PACKAGE GAPSDVEL.up_gap_tra_reports
    AS

    TraRecord RECORD TYPE IS
    (
    group1StudEnrol NUMBER (6.1).
    group2StudEnrol NUMBER (6.1).
    pymtAmt gap_payment.NET_AMT%TYPE
    );


    TYPE traArray IS TABLE OF THE traRecord;
    myArray traArray: = traArray();

    END up_gap_tra_reports;

    I have alreay hv declared of type traArray.

    pls help me solve this problem.

    Meghna wrote:
    is it possible to use the collection pl/sql in SQL or refcur without creating it because I'm not able to create the type of database.

    The only way I know is function in pipeline:

    create or replace
      package pkg1
        is
          type traRecord
            is record(
                      ename emp.ename%type,
                      sal   emp.sal%type
                     );
          TYPE traArray IS TABLE OF traRecord;
          function f1
            return traArray
            pipelined;
    end;
    /
    create or replace
      package body pkg1
        is
        function f1
            return traArray
            pipelined
          is
              v_rec traRecord;
          begin
              v_rec.ename := 'Sam';
              v_rec.sal := 1000;
              pipe row(v_rec);
              v_rec.ename := 'John';
              v_rec.sal := 1500;
              pipe row(v_rec);
              v_rec.ename := 'Mary';
              v_rec.sal := 2000;
              pipe row(v_rec);
              return;
        end;
    end;
    /
    

    Now, you can:

    SQL> select * from table(pkg1.f1)
      2  /
    
    ENAME             SAL
    ---------- ----------
    Sam              1000
    John             1500
    Mary             2000
    
    SQL>
    

    Don't forget, it will create the generated system types:

    SQL> select type_name from user_types
      2  /
    
    TYPE_NAME
    ------------------------------
    SYS_PLSQL_73305_9_1
    SYS_PLSQL_73305_DUMMY_1
    SYS_PLSQL_73305_34_1
    
    SQL> desc SYS_PLSQL_73305_9_1
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ENAME                                              VARCHAR2(10)
     SAL                                                NUMBER(7,2)
    
    SQL> desc SYS_PLSQL_73305_DUMMY_1
     SYS_PLSQL_73305_DUMMY_1 TABLE OF NUMBER
    
    SQL> desc SYS_PLSQL_73305_34_1
     SYS_PLSQL_73305_34_1 TABLE OF SYS_PLSQL_73305_9_1
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ENAME                                              VARCHAR2(10)
     SAL                                                NUMBER(7,2)
    
    SQL> 
    

    SY.

  • ORA-00902: invalid data type

    Hello
    What is the problem with my NUMBER data type:
    SQL> create table sale (purchase-no NUMBER (9) CONSTRAINT sale-purchase-no-pk PR
    IMARY KEY , costumer-id NUMBER (9) CONSTRAINT sale-customer-id-nk NOT NULL);
    create table sale (purchase-no NUMBER (9) CONSTRAINT sale-purchase-no-pk PRIMARY
     KEY , costumer-id NUMBER (9) CONSTRAINT sale-customer-id-nk NOT NULL)
                               *
    ERROR at line 1:
    ORA-00902: invalid datatype
    Thank you.

    Your column and constraint names have traits that are not allowed in the names of identifiers.

    Try using instead underscore traits.

  • cfgrid / cfgridupdate error with an invalid data type

    I have a problem using cfgrid controls.

    I get the following error message:
    "Error casting an object of type by an incompatible type. This usually indicates an error in programming in Java, although it could also mean that you tried to use a foreign object in a different way, that it was designed. »

    The error occurs when I run this code:

    < IsDefined ("form.gridEntered") cfif >
    < cfgridupdate grid = "FirstGrid" dataSource = "" #dsn # "Keyonly ="true"tableName ="tblManager">"
    < / cfif >

    It connects to a mySQL 4.1 database.

    I think that the problem is to do with a field, I added called 'Active' of the INT data type (1). I use that as a Boolean value as far as I know, is the nearest equivalent in mySQL.

    In my < cfgrid > I've added the next column.

    < cfgridcolumn name = 'Active' type = 'boolean' display = "Yes" width = "40" header = "On" "BOLD" = "true" / >

    That shows a box and that's the look I want to reach on the grid.
    I think that this causes Java error. What should I do to allow the submission to the grid of this type of data, please?

    Thank you for your time and your help.

    To answer my own question on that...
    cfgridupdate wasn't working so I wrote a regular block of code to make the necessary changes when you submit a grid.

  • ORA-00902 error invalid data type when you use CAST in the PL/SQL Package

    I'm getting ORA - 00902 Datatype not valid error when you use cast in getEmpValues (see code below) method in the package I created.
    I don't know what is the cause of the error. Any help would be appreciated



    CREATE OR REPLACE PACKAGE TEST. TEST_PKG AS

    ARRAY TYPE MyTableType IS NUMBER;
    TYPE REF_CURSOR IS REF CURSOR;

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType;

    PROCEDURE getContactValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR);

    END TEST_PKG;



    CREATE OR REPLACE PACKAGE BODY TEST. TEST_PKG AS

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType
    AS
    l_str LONG default p_str | ',';
    l_n NUMBER;
    myTableType l_data: = myTabletype();

    BEGIN
    LOOP

    l_n: = INSTR (l_str, ",");
    WHEN the OUTPUT (nvl(l_n,0) = 0);
    l_data.extend;
    l_data (l_data.count): = ltrim (rtrim (substr(l_str,1,l_n-1)));
    l_str: = substr (l_str, l_n + 1);
    END LOOP;
    L_data return;
    END;

    /*
    p_ParameterString is a string of the form 3, 6, 8, 9'
    */

    PROCEDURE getEmpValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR)
    AS


    BEGIN


    OPEN FOR P_Cursor1

    SELECT *.
    FROM EMP

    WHERE EMP_ID IN (SELECT *)
    OF THE (SELECT CAST (TEST.) (TEST_PKG.str2tbl (p_ParameterString) as myTableType) double)

    );
    END getEmpValues;

    END TEST_PKG;

    ARRAY TYPE MyTableType IS NUMBER;

    This type must be created outside of the package as a SQL type if it must be used in a select statement.

  • "Not a valid error code" when you create a shared variable of data type custom

    I am trying to create a shared variable with a data type of a 2d double table. I created a custom control that contains a table with a numeric type for this 2d. Manager of distributed system v12 I select 'add a variable', then select 'of the custom control. Once select my control I get the following error: "invalid data type. You want to choose a different data type. Any advice as to why it doesn't work? Thank you.

    This seems to be recorded in the CAR #405941.  All this is a bit strange, but I'll try better possible workaround solutions I can.  I tested a large number of these myself, and here is what I found.

    1. make sure that the custom control you did was created in 2012 of LabVIEW or you save it in an earlier version.  If you save on an earlier version, you may also open the .ctl in LabVIEW 2012 and resave it (I needed to do).  I tried to create my own control in 2012, as well as save the control to a previous version, the two worked, but I don't end up with the same result (I don't understand this, but I wanted to mention it so that you know).

    2. it seems that you are able to make the variable shared by program by modifying the example of the community to adapt to your needs.  If you do not need to create many variables it may be the best option if it works for you.

    I would also try adding the variable of the LabVIEW project, you are working on that.  It wasn't a direct troubleshooting step but there are several ways of doing things in LabVIEW and, sometimes, one of them is working while the other does not.

    Edit: Example of community is here https://decibel.ni.com/content/docs/DOC-16863

  • Version with ControlLogix - link cRIO (implicit messaging), "(Code 16 #0315) problem" connection request error: invalid segment type ""

    I have developed and delivered a system in Germany several years ago.  He worked then.  But the cRIO was damaged and replaced by a newer model, and does not now.  I suspect (and Support technical OR agree) it's a problem of software version, which could be solved with the NOT-MAX Software Installer.  But I do not have access to the system myself, and correspondence is slow and tedious.

    The original system was a cRIO-9073, developed with LabView 2009.  He used the implicit Messaging.  The ID of Instance, sizes, IP addresses, etc everything has worked very well.

    The current system is a cRIO-9074, with LabView DURATION 14.0 (I guess that LV 2014), Scan Engine 4.3, NI - Industrial Communications for Ethernet/IP 14.0.0, etc.  Programs FPGA and processor are responsible and seem to work in the cRIO.  The "EthernetIP Set Assembly Instance Data.vi' will return no error.  But the PLC just pointing out "(Code 16 #0315)" connection request error: invalid segment type "."  We looked at intellectual property (the mistake was different), sizes and body #s.

    The PLC doesn't have to all be modified.

    Anyone know if there is no problem of compatibility with LV-2014 and Ethernet/IP 14.0.0?  Or if there are all the other required packages?

    I am including the NOT-Max reports.

    Hi ZX81

    To help you 2009 application to work with the new cRIO, you must deploy it to the device. You must in order to deploy the cRIO, make sure it has the same versions of software that you used with the old cRIO.

    You can format the cRIO NI MAX and deploy the application of LV, 2009. However, if you do not have access to the cRIO or your client does not have the necessary software, you can deploy the application in another cRIO with software (cRIO same model and same modules as your client) and create a picture of it and send it to your customer so that it can deploy the cRIO even without the software on his computer. The following document explains how to do this.

    Utility of RAD

    WenR

  • Check invalid date and display error message for that forms 10 g or 12 c

    Hi all

    a text element text_fdate is of data type date mask and the format is dd/mm/rrrr

    In this text element that I want to display validation message "you have entered an incorrect date that does not exist.

    When the user enters an invalid date as 30/02/2016 which is not exists.

    What trigger I use and when.

    Florian wrote:

    Hey Hamid,

    GET_ITEM_PROPERTY ('ITEM_NAME', ITEM_IS_VALID);<--it is="" not="">

    Above will work only on the query mode.

    The code works, but the below error code you gave does not work in forms 12 c.

    1. IF ERROR_CODE = 50012 THEN
    2. MESSAGE ("Please enter the correct date.");
    3. MESSAGE ("Please enter the correct date.");
    4. END IF;

    The correct error code is 50004 12 c forms.

    Just change the ERROR_CODE of 50012 to 50004 and it will work.

    I'll check the error code in form 10g and will play with you again.

    I already checked and functional at 10g.

    Hamid

  • Why the rich text editor shows unsupported data type?

    Hello

    I used the rich text editor in my application (for the message box). I used the data BLOB to the type. But, when I click on the button send it shows invalid hexadecimal number and also in back-end, it shows the data type not supported. Why is it so? Need your help.

    --

    Thank you.

    Venky_prs wrote:

    Thanks for the reply. I changed on the CLOB type. Now, the intervention process. But, in the back-end the message column contains HTML format. For this rich text editor, I used the source as the database column type. How can I get the actual message instead of the html format.

    Elements of the rich text editor are used to create HTML text. If you need/want data plain text, then use a Textarea base element.

  • Trying to export DXF for use 'Robo Master Pro', get the description of invalid data.

    Try to export a "DXF" file for use in the 'Robo Master Pro' software, tells me "invalid Data".

    How can I fix it?

    The error happens all by making export, or while trying to import?

    As test try to delete some items, and save it as a copy until it works, yo can have a placed image or a certain type of object at the root of this. If you simply draw a rectangle on a new page in Illustrator, will this work?

Maybe you are looking for