A simple routine appears to be so difficult



IBM's flagship relational database management system

A simple routine appears to be so difficult

Postby veronikaluv » Wed Mar 26, 2008 11:30 pm

Hi!
I need to make a routine that can manage a database table with person's data with different fields: name, surname, return-code ecc.
The routine should be able to Insert, Delete, Select, Update fields in this DB2 table depending on the type of the letter user gives I, U, S, D ecc. But it should also be able to examine for eg. if all the fields are compiled for to be able to do an Insert in a table, or to delete to have at least one field with a value.
I would like to know, what should I define in a main program, what in a routine, do I need to use DCLGEN? Do I need to use a cursor? If I need to use a cursor or not?
veronikaluv
 
Posts: 7
Joined: Sat Feb 16, 2008 10:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: A simple routine appears to be so difficult

Postby dick scherrer » Thu Mar 27, 2008 12:09 am

Hello,

You would write code that performs basic maintenance based on user input. This code in most organizations would be COBOL/CICS/DB2 code. You would design a screen (map) with an action field as well as the fields from the table that you want to display or update.

One decision will have to be whether the user specifies one "person" or if the code might process multiple person rows. If only one person row is to be operated on, you would probably not need a cursor.

If you have no experience with cobol/cics/db2 code, i suggest you talk with some more senior developer(s) in your organization for guidance. The topic is far too broad to teach in a forum like this and there are many site-specific considerations that only someone already familiar with your system will be able to answer.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: A simple routine appears to be so difficult

Postby arunprasad.k » Thu Mar 27, 2008 1:41 am

Looks like an assignment!! ;)

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: A simple routine appears to be so difficult

Postby dick scherrer » Thu Mar 27, 2008 1:48 am

Hi Arun,

It may well be. The main reason for this forum site is for students and freshers.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: A simple routine appears to be so difficult

Postby veronikaluv » Fri Mar 28, 2008 5:29 pm

Yeah, it's an assignment, I don't expect that someone does it for me, but just to discuss about it, because it was explained a bit on the run.
Did you ever thought to organize something like an online course on your website, or maybe more usefull to give real life examples with explanations? It would be excellent for us beginners.
veronikaluv
 
Posts: 7
Joined: Sat Feb 16, 2008 10:26 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2