ratheesh nellikkal


{ City } mumbai
< Country > india
* Profession * db2 dba
User No # 47577
Total Questions Posted # 0
Total Answers Posted # 13

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 88
Users Marked my Answers as Wrong # 21
Questions / { ratheesh nellikkal }
Questions Answers Category Views Company eMail




Answers / { ratheesh nellikkal }

Question { HCL, 12929 }

what are the componenets of struts?


Answer

Struts is based on MVC design pattern,struts components can
be catagorised in to model, view and controller.
model-all the business components and data are coming under
this catagory
view-jsp,html are part of view
controller-ActionServlet of struts is the part of
controller component

Is This Answer Correct ?    3 Yes 1 No

Question { TCS, 24735 }

who will run the execute method in struts?


Answer

Action Servlet

Is This Answer Correct ?    11 Yes 5 No


Question { Wipro, 7487 }

how the error can be showed in the jsp page in struts?


Answer


Is This Answer Correct ?    11 Yes 1 No

Question { Patni, 22784 }

its a ActionForm controller or model?


Answer

Actually model is designed to handle business logic and
data.
Action Form is basically carrying the data from view to
Action Class,so it is coming under model.

Is This Answer Correct ?    16 Yes 8 No

Question { Atos Origin, 11895 }

How to insert more than one record using insert?


Answer

U could probably go for a bulk insert also.
try this option

insert into schema.table1
select * from schema.table2;

Cheers,
Ratheesh Nellikal

Is This Answer Correct ?    0 Yes 1 No

Question { Wipro, 8843 }

How we create a tables in DB2 ?Previously client has using
7 letters for user id,now he wants to increase the letters
from 7 to 12 for user id.How we can do it?


Answer

Hi Ram Prajapati ,

In db2 (esp in version 9.5) it is poosible to increase the
size of a column without loosing the data.
But u can not decrease the size.

Cheers ,
Ratheesh Nellikkal

Is This Answer Correct ?    1 Yes 0 No

Question { 14192 }

How we create a tables in db2,what is the process/syntax to
create a table with example plz?


Answer

Answer posted by Dba is correct.
But in real time schenario we should be more specific.
eg:
CREATE TABLE SCHEMA.TABLENAME
(column1 DATATYPE,
column2 DATATYPE,
column3 DATATYPE)
IN tablespace_name
INDEX IN index_tablespace;

so try to follow this syntax (u can have more options with
this command like u can even specify the tablespace name wr
do u want to store ur LONG object 'LONG IN
long_tablespace' )

Cheers,
Ratheesh Nellikal

Is This Answer Correct ?    6 Yes 0 No

Question { 20194 }

Can a primary key have null values? If we try to insert a
null value in a primary key column, will it work or give an
error code?


Answer

In DB2 you can not create a primary key on a column which
is not 'not null'.
If you are trying to create a primary key on a column which
is not 'not null' then dbb2 will return an error like this

SQL0542N "feild_name" cannot be a column of a primary key
or unique key because it can contain null values.
SQLSTATE=42831

But once u alter the table and set the column to 'NOT NULL'
then you can make it as primary key.

Now if u r trying to insert an null value to ur primary key
column then db2 will trows an error like

SQL0407N Assignment of a NULL value to a NOT NULL
column "TBSPACEID=5, TABLEID=404, COLNO=0" is not allowed.
SQLSTATE=23502.

In short you can not make a column which can hold 'NULL'
value as your primary key and you can not insert a 'NULL'
value into your primary key feild.

Cheers,
Ratheesh Nellikal

Is This Answer Correct ?    7 Yes 1 No

Question { Wipro, 9321 }

if suppose i am having an ACCOUNT table with 3 coloumns ACC.
NO,ACC. NAME,ACC. AMOUNT . If a unique index is also
defined on ACC.NO and ACC.NAME then write a query to
retrieve account holders records who have more than 1 ACC.


Answer

Hi All,

Here u already have a unique index defined on ACC.NO and ACC.NAME feilds.
Unique index will not allow more than one value for this particular field (Correct me if I am wrong).
Then hw can we get more that one a/c no for a person in this scenario ?

So the answer will be, u can not store more than one a/c number for a person since u have a unique indexes on these table.

Regards,
Ratheesh Nellikal

Is This Answer Correct ?    1 Yes 2 No

Question { CTS, 9702 }

I have some 3 particular fields ..i want to know which all
tables have those 3 fields. Is there any way to identify..
can we know by quering system tables..


Answer

select name ,tbname ,typeschema,source_tabname from
sysibm.syscolumns where name='coloumn name'

This statement will work.
You can try this command also.

select tabname,colname
from syscat.columns
where COLNAME='ID'
and tabschema='MYSCHEMA'

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 9600 }

i want to delete 20th million record how ?


Answer

Hi All,

I don't think RR and ROWCOUNT works in DB2 for LUW.
So you could go for another option.
Row_number() Over() function you can use for this puspose.

Eg.
delete from (
select row_number() over() as row_num from
TEST.TABLE_TEST )
where row_num=20000000;

where TEST is my schema name and
TABLE_TEST is my test table.

Cheers Guys.
Ratheesh Nellikkal

Is This Answer Correct ?    0 Yes 0 No

Question { Verizon, 6604 }

wt is view ? wht r the restrictions for view ?


Answer

A view we can treat it as a virtual table.
It doesn't have any physical existance.

A View can be created entirely from a single table or from
a number of tables with appropriate joins.

The mail Restriction in a view is that if a view made up of
more than one table then it can not update it.
(Obviously if the base table is not exists the db2 will
trow an error and u can not create the view)

Is This Answer Correct ?    9 Yes 0 No

Question { Valtech, 11084 }

wht happens if we close cursor with cursor with hold option?


Answer

Once u issued a close cursor statement , it will get closed.
You can not access it after that until u open it again.
In that case your procedure will exit with an error message
like
"SQL0501N The cursor specified in a FETCH or CLOSE
statement is not open. SQLSTATE=24501"

With hold option doesn't make any difference in this case.


But if you are doing a commint operation in between your
transactions then a cursor declared with 'with hold' option
will not get closed.

Is This Answer Correct ?    23 Yes 2 No