?
Solved

PLS-00049: bad bind variable

Posted on 2003-02-27
2
Medium Priority
?
14,126 Views
Last Modified: 2011-08-18
Hi everyone

I am having this problem:

I created a view that referencing 3 tables:

CREATE VIEW TURBINE_USER AS
SELECT A.RESOURCE_KEY AS USER_ID,
       A.USERNAME AS LOGIN_NAME,
       A.PASSWORD AS PASSWORD_VALUE,
       B.GIVEN_NAME AS FIRST_NAME,
       B.FAMILY_NAME AS LAST_NAME,
       C.MEDIUM_NUMBER AS EMAIL,
       'CONFIRMED' AS CONFIRM_VALUE,
       NULL AS MODIFIED,
       NULL AS CREATED,
       NULL AS LAST_LOGIN,
       NULL AS DISABLED,
       NULL AS OBJECTDATA,
       NULL AS PASSWORD_CHANGED      
FROM JONAS.RESOURCE_TABLE A, JONAS.PERSONAL_INFORMATIONS B, JONAS.COMMUNICATION_MEDIUM C
WHERE A.PERSONAL_INFORMATIONS_KEY = B.PERSONAL_INFORMATIONS_KEY
AND A.RESOURCE_KEY = C.RESOURCE_KEY (+)  
AND C.TYPE (+) = 32
AND C.CATEGORY (+) = 3;

Then after I created a trigger type 'INSTEAD OF UPDATE':

CREATE OR REPLACE TRIGGER JETSPEED.TURBINE_USER_UPDATE_TRIGGER
INSTEAD OF UPDATE
ON TURBINE_USER
REFERENCING NEW AS NEW OLD AS OLD

BEGIN
 DECLARE AA NUMBER;

 BEGIN
  SELECT JONAS.RESOURCE_TABLE.PERSONAL_INFORMATIONS_KEY
  INTO AA
  FROM JONAS.RESOURCE_TABLE
  WHERE JONAS.RESOURCE_TABLE.RESOURCE_KEY = :OLD.USER_ID;

  UPDATE JONAS.COMMUNICATION_MEDIUM SET JONAS.COMMUNICATION_MEDIUM.MEDIUM_NUMBER = :NEW.EMAIL WHERE COMMUNICATION_MEDIUM_KEY = :OLD.USER_ID;

  UPDATE JONAS.PERSONAL_INFORMATIONS SET JONAS.PERSONAL_INFORMATIONS.GIVEN_NAME = :NEW.FIRST_NAME WHERE PERSONAL_INFORMATIONS_KEY = :AA;

  UPDATE JONAS.PERSONAL_INFORMATIONS SET JONAS.PERSONAL_INFORMATIONS.FAMILY_NAME = :NEW.LAST_NAME WHERE PERSONAL_INFORMATIONS_KEY = :AA;

  UPDATE JONAS.RESOURCE_TABLE SET JONAS.RESOURCE_TABLE.RESOURCE_KEY = :NEW.USER_ID WHERE RESOURCE_KEY = :OLD.USER_ID;

  UPDATE JONAS.RESOURCE_TABLE SET JONAS.RESOURCE_TABLE.USERNAME = :NEW.LOGIN_NAME WHERE RESOURCE_KEY = :OLD.USER_ID;

  UPDATE JONAS.RESOURCE_TABLE SET JONAS.RESOURCE_TABLE.PASSWORD = :NEW.PASSWORD_VALUE WHERE RESOURCE_KEY = :OLD.USER_ID;
 END;
END;

When I compile it I got the following message:

Numiro de ligne = 11 Numiro de colonne = 133 Texte d'erreur = PLS-00049: bad bind variable 'AA'

Numiro de ligne = 12 Numiro de colonne = 133 Texte d'erreur = PLS-00049: bad bind variable 'AA'

I really don't understand why?

PERSONAL_INFORMATIONS_KEY type is NUMBER

Need help please

Thanks in advance!

JL
0
Comment
Question by:Jean-Luc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
asimkovsky earned 300 total points
ID: 8036355
Take the colons out from in front of the AA variables throughout the code.



Andrew
0
 

Author Comment

by:Jean-Luc
ID: 8036433
Thank you Andrew

I am fairly new with Oracle. Right after I posted the question I found the problem with one of my colleague at work.

Thanks again!!

JL
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question