Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136

    Unanswered: ORA-01722: invalid number. Why?

    Hello All!

    Calling the following statement:
    PHP Code:
    Begin
         PRC_ADMIN_CREATES_SW_USER
    ('WORD'9277'A''B');
    END
    i get this error:

    ORA-01722: invalid number
    ORA-06512: at "PRC_ADMIN_CREATES_SW_USER", line 33


    My Code:

    PHP Code:
    CREATE OR REPLACE PROCEDURE PRC_ADMIN_CREATES_SW_USER  
    (         pSwuCat       VIEW_SW_USER.SWU_CATEGORY%TYPE
         
    pSwuUid       VIEW_SW_USER.SWU_UID%TYPE
         
    pFirstName     VIEW_SW_USER.FIRSTNAME%TYPE
         
    )
    AS
           
    SWU       NUMBER;
    BEGIN     
         
    -- 
         -- 
         -- 
             -- 
               --> 
                      --> 
         --  
             -- 
                 --> 
                    --> 
                         

        
    UPDATE VIEW_SW_USER SET SWU_CATEGORY pSwuCatFIRSTNAME pFirstName
               WHERE SWU_UID 
    pSwuUid;
               
        IF 
    SQL%ROWCOUNT 0 THEN
           INSERT INTO VIEW_SW_USER 
    (SWU_CATEGORYSWU_UIDFIRSTNAME
                   
    VALUES (pSwuUidpSwuCatpFirstname);
        
    END IF;
    END;


    SWU_UID = INTEGER


    It would be great if someone could help me!

    Thanks in advance!
    Julia
    Regards,
    Julia

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Please show the output from this query:

    select line, text
    from user_source
    where name = 'PRC_ADMIN_CREATES_SW_USER'
    and line between 31 and 35

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136
    Hello Tony,

    the output is:


    INSERT INTO VIEW_SW_USER (SWU_CATEGORY, SWU_UID, FIRSTNAME, LASTNAME


    The Problem is SWU_UID, but WHY?


    SWU_UID = INTEGER


    Should i change the type of SWU_UID?



    Thanks,
    Julia
    Regards,
    Julia

  4. #4
    Join Date
    Oct 2003
    Posts
    26
    Could it be that you are inserting the values in the wrong order:

    INSERT INTO VIEW_SW_USER (SWU_CATEGORY, SWU_UID, FIRSTNAME)
    VALUES (pSwuUid, pSwuCat, pFirstname);

    Should be pSwuCat then pSwuUid...

    John
    Last edited by ruluckie; 07-28-04 at 09:39.

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    John has spotted it!

  6. #6
    Join Date
    Apr 2004
    Posts
    246
    How is it that your procedure only accepts 3 params, but you're passing 4? Are you sure you've posted the correct code?
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  7. #7
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136
    AAA!!
    John , you are right!

    Could it be that you are inserting the values in the wrong order:

    INSERT INTO VIEW_SW_USER (SWU_CATEGORY, SWU_UID, FIRSTNAME)
    VALUES (pSwuUid, pSwuCat, pFirstname);

    Should be pSwuCat then pSwuUid...
    I'm sorry!

    Thanks to all!
    Julia
    Regards,
    Julia

Posting Permissions

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