Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL: ORA-00904: invalid identifier

user4028691Sep 22 2014 — edited Sep 23 2014

Hi,

Ran the following script, and encountered the error.

SQL> create or replace FUNCTION p_CQTicketUsu

  2  (

  3    v_TicketUserID IN NUMBER DEFAULT NULL ,--This is the [CQTicketUsers].TicketUserID generated on Updated

  4    v_TicketID IN NUMBER DEFAULT NULL ,--This is the [CQTicketUsers].TicketID to be Updated

  5    v_AdminUserID IN NUMBER DEFAULT NULL ,--This is the [CQTicketUsers].AdminUserID to be Updated

  6    v_TicketUserTypeID IN NUMBER DEFAULT NULL --This is the [CQTicketUsers].TicketUserTypeID to be Updated

  7  )

  8  RETURN NUMBER

  9  AS

10     v_sys_error NUMBER := 0;

11     v_ERRSQL NUMBER(10,0);

12     v_UpdCount NUMBER(10,0);

13

14  BEGIN

15

16     UPDATE CQTicketUsers

17        SET v_TicketUserID = TicketUserID,

18            v_TicketID = TicketID,

19            v_AdminUserID = AdminUserID,

20            v_TicketUserTypeID = TicketUserTypeID

21        WHERE TicketUserID = v_TicketUserID;

22     v_ErrSQl := v_sys_error ;

23     v_UpdCount := SQL%ROWCOUNT ;

24     IF v_ErrSQL <> 0 THEN

25        RETURN -1;

26     END IF;

27     IF v_Updcount < 1 THEN

28        RETURN -2;

29     END IF;

30     RETURN 0;

31  END;

32   /

Warning: Function created with compilation errors.

SQL> show error

Errors for FUNCTION P_CQTICKETUSU:

16/4     PL/SQL: SQL Statement ignored

20/11    PL/SQL: ORA-00904: "V_TICKETUSERTYPEID": invalid identifier

Please note, I've declared v_TicketUserTypeID in line #6. Kindly advice.

regards,

Shahrir

This post has been answered by Bill Haverberg on Sep 22 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2014
Added on Sep 22 2014
4 comments
1,640 views