Home » SQL & PL/SQL » SQL & PL/SQL » Re: PLS-00201: identifier 'BRANCH.BRANCH' must be declared
Re: PLS-00201: identifier 'BRANCH.BRANCH' must be declared [message #18368] Tue, 29 January 2002 12:10
sokeh
Messages: 77
Registered: August 2000
Member
sorry i am late coming into this forum.
here are a few observations. we can atleast having a starting point from which to operate till your code is working.
Looking at this:
CREATE OR REPLACE Procedure Mis_WorkFlowCapital_test
(v_start_date DATE,v_end_date DATE)

AS

BEGIN

Insert into mis_wrkflow_cap
(
branch,
received,
prequota,
batched,
scanned_received,
captured,checked,
rules,
returned,
disburse,
active,
pre_reject,
rejected,
capture_date
)

Select branch.branch,
received.capital,
prequota.capital,
batched.capital,
scanned_received.capital,
captured.capital,
checked.capital,
rules.capital,
returned.capital,
disburse.capital,
active.capital,
pre_reject.capital,
rejected.capital,
SYSDATE
end;
You can see that:
1, there are more fields on the insert than on select. This is minor.
2, you are doing it wrong.
You can't use the field from insert as the superset of the select.
In other words, branch.branch is not right.
Your table structure from insert into .. should be fairly similar as the select from with a common join key.
such as insert into first_table(field1, field2...)
select field1,field2.. from the second_table
where first_table.common_key = second_table.common_key.
what it appears like, at least on the first insert/select statement, is that the value you are selecting from comes from one field - capital.
Branch would have been a good candidate as pk/fk btw the two tables but one branch has size 5 while the other has size 10 looking at your table structure.
branch number(5)
branch number(10)

Examine your table structure more.
If you have a spec/requirement, without compromising privacy rights, we will like to see it.
Previous Topic: creating procedure or function with no parameter
Next Topic: update and insert
Goto Forum:
  


Current Time: Tue Jun 02 04:11:50 CDT 2020