Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    78

    Unanswered: PLS-00382: expression is of wrong type

    Hai

    I create table with objects .I want to insert the data through stored .I created stored procedure but unable to create its give the below error message .


    CREATE OR REPLACE TYPE ADDRESS AS OBJECT (
    ADDRESS VARCHAR2(100),
    CITY VARCHAR2(30),
    STATE VARCHAR2(30),
    REGION VARCHAR2(30),
    POSTAL_CODE VARCHAR2(12),
    COUNTRY VARCHAR2(30),
    HOME_PHONE VARCHAR2(12),
    WORK_PHONE VARCHAR2(12),
    FAX_NUMBER VARCHAR2(12),
    ALTERNATIVE_PHONE VARCHAR2(12),
    DATE_UPDATED DATE);


    CREATE TABLE CLIENT(
    CLIENT_ID NUMBER(10) PRIMARY KEY,
    CLIENT_ADDRESS ADDRESS)

    CREATE SEQUENCE CLIENT_SEQ START WITH 1 INCREMENT BY 1 MAXVALUE 100000
    NOCYCLE NOCACHE;

    CREATE OR REPLACE PROCEDURE CLIENT_P(V_ID IN OUT NUMBER,V_ADD IN VARCHAR2,V_CITY IN VARCHAR2,
    V_STATE IN VARCHAR2,
    V_REGION IN VARCHAR2,V_POSTAL_CODE IN VARCHAR2,V_COUNTRY IN VARCHAR2,V_HOME_P IN VARCHAR2,
    V_WORK_P IN VARCHAR2,V_FAX_NUM IN VARCHAR2,V_ALTERNATIVE_P IN VARCHAR2,V_DATE_UPDATE IN DATE)
    IS
    BEGIN
    IF V_ID=0 THEN
    SELECT CLIENT_SEQ.NEXTVAL INTO V_ID FROM DUAL;
    END IF;

    INSERT INTO CLIENT VALUES(V_ID,V_ADD,V_CITY,V_STATE,V_REGION,V_POSTAL _CODE,V_COUNTRY,V_HOME_P,
    V_WORK_P,V_FAX_NUM,V_ALTERNATIVE_P,V_DATE_UPDATE);
    END;



    Warning: Procedure created with compilation errors.

    SQL> SHOW ERR
    Errors for PROCEDURE CLIENT_P:

    LINE/COL ERROR
    -------- ------------------------------------------------
    10/1 PL/SQL: SQL Statement ignored
    10/32 PLS-00382: expression is of wrong type

  2. #2
    Join Date
    Feb 2003
    Posts
    6
    Mohan,

    Hope this will solve your problem.

    CREATE OR REPLACE PROCEDURE CLIENT_P(V_ID IN OUT NUMBER,V_ADD IN VARCHAR2,V_CITY IN VARCHAR2,
    V_STATE IN VARCHAR2,
    V_REGION IN VARCHAR2,V_POSTAL_CODE IN VARCHAR2,V_COUNTRY IN VARCHAR2,V_HOME_P IN VARCHAR2,
    V_WORK_P IN VARCHAR2,V_FAX_NUM IN VARCHAR2,V_ALTERNATIVE_P IN VARCHAR2,V_DATE_UPDATE IN DATE)
    IS
    BEGIN
    IF V_ID=0 THEN
    SELECT CLIENT_SEQ.NEXTVAL INTO V_ID FROM DUAL;
    END IF;
    INSERT INTO CLIENT VALUES(V_ID, ADDRESS( V_ADD,V_CITY,V_STATE,
    V_REGION,V_POSTAL_CODE,V_COUNTRY,V_HOME_P, V_WORK_P,
    V_FAX_NUM,V_ALTERNATIVE_P,V_DATE_UPDATE));
    END;

    Based on your script you made an error on inserting rows on a nested table.


    In return, do you have a d2kwutil library or have heard of it where can I get one?


    Thanks.



    Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •