473,394 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

I am creating this stored procedure. but I am not able to solve these errors.

Here is my code :
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE BranchAppProc
  2. (BranchIN IN Branch.Branchname.Branchname%TYPE,
  3. BranchPOPUIN IN Branch.Branchname.Branchpopulation%TYPE)
  4. IS
  5. BranId Branch.branchID%TYPE;
  6. BranRec Branch%ROWTYPE;
  7. CURSOR BranCur
  8.  IS
  9. SELECT * FROM Services LEFT JOIN Application ON
  10. Services.ApplicationID=Application.ApplicationID
  11. WHERE BranchID=BranchID;
  12. BranInfoRec BranCur%ROWTYPE;
  13. NO_APP_FOUND_EX EXCEPTION;
  14. BEGIN
  15. SELECT * INTO BranRec FROM Branch 
  16. WHERE
  17. Coalesce(BranchName.BranchName)=BranchIN;
  18. dbms_output.put_line('---------------------------------------------------------');
  19. dbms_output.put_line('Branch Details');
  20. dbms_output.put_line('---------------------------------------------------------');
  21. dbms_output.put_line('Branch Name:'||BranRec.branchName.branchname||' '||BranRec.BranchName.BranchPopulation);
  22. dbms_output.put_line('Branch Address:'||BranRec.BranchAddr);
  23. dbms_output.put_line('Branch City:'||BranRec. BranchCity);
  24. dbms_output.put_line('BranchZip:'||BranRec. BranchZip);
  25. dbms_output.put_line('char(10)');
  26. dbms_output.put_line('---------------------------------------------------------');
  27. dbms_output.put_line('Branch Details');
  28. dbms_output.put_line('---------------------------------------------------------');
  29. OPEN BranCur;
  30. FETCH BranCur INTO BranInfoRec;
  31. IF BranCur %NOTFOUND=TRUE THEN
  32. RAISE NO_APP_FOUND_EX;
  33. END IF;
  34. LOOP
  35. EXIT WHEN BranCur%NOTFOUND;
  36. dbms_output.put_line('App Id:'|| BranInfoRec.APPLICATIONID);
  37. dbms_output.put_line('AppName:'|| BranInfoRec.APPLICATIONNAME);
  38. dbms_output.put_line(‘App Start Date:'|| BranInfoRec.APPLICATIONSTARTDATE);
  39. dbms_output.put_line(‘Dept:'|| BranInfoRec.DEPT);
  40. dbms_output.put_line('---------------------------------------------------------');
  41. END LOOP;
  42. CLOSE BranCur;
  43. EXCEPTION
  44. when NO_DATA_FOUND then
  45. dbms_output.put_line('No record found for customer');
  46. when NO_APP_FOUND_EX then
  47. dbms_output.put_line('There are no accounts for the customer');
  48. END;
  49.  


errors:

LINE/COL ERROR
-------- -----------------------------------------------------------------
15/1 PL/SQL: SQL Statement ignored
17/10 PL/SQL: ORA-00904: "BRANCHNAME"."BRANCHNAME": invalid identifier
23/1 PL/SQL: Statement ignored
23/47 PLS-00302: component 'BRANCHCITY' must be declared
36/1 PL/SQL: Statement ignored
36/46 PLS-00302: component 'APPLICATIONID' must be declared
Dec 12 '09 #1
3 2844
debasisdas
8,127 Expert 4TB
what is this in your code ?

Branch.Branchname.Branchname%TYPE
Dec 12 '09 #2
nbiswas
149 100+
I think the following are the problematic areas

BranchIN IN
Expand|Select|Wrap|Line Numbers
  1. Branch.Branchname.Branchname%TYPE
,
BranchPOPUIN IN
Expand|Select|Wrap|Line Numbers
  1. Branch.Branchname.Branchpopulation%TYPE
)

BranchIN IN Branch.Branchname.Branchname%TYPE,
BranchPOPUIN IN Branch.Branchname.Branchpopulation%TYPE)

dbms_output.put_line('Branch Name:'||
Expand|Select|Wrap|Line Numbers
  1. BranRec.branchName.branchname
||' '||
Expand|Select|Wrap|Line Numbers
  1. BranRec.BranchName.BranchPopulation
);
Dec 14 '09 #3
Got it .................thanks a lot for help.
Dec 14 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
0
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone....
1
by: Paul | last post by:
Hi, I wish to be able to add tables to a sql server database at runtime from my asp.net application. As well as creating fields I also wish to be able to create indexes on selected fields and to...
12
by: Lucky | last post by:
Hi guys! i want to create one cursor in the t-sql. the problem is i want to use stored procedure instead of select command in cursor. can anyone tell me how can i use stored procedure's o/p to...
1
by: Ir0neagle | last post by:
I am generating upgrade/new install scripts for my project. I am able to do this in oracle and sql server but an running into problems in db2. What I am trying to do is to use some logic to only...
1
by: sshankar | last post by:
Hi, New to Stored procedure. Basically just installed DB2 v8.1.0.36 Was trying to build a stored procedure.. It is giving following error.. Looks like some error related to configuration...
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
0
by: mersis | last post by:
I have a very very annoying problem. I want to create a stored procedure, that creates a table and does various things with it. Before creating a stored procedure I check if the table is there. If it...
3
by: Darkside12 | last post by:
Hi, I'm trying to build a dynamic query by form. The idea is that a user can select a table in the database via a combo box and this will then change all of the text box labels on the form to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.