Author |
Message |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 7:11 pm Subject: union in stored procedure |
how will i join the two tables(MIS_t and HR_t) in one table |
Topic: The data types of corresponding columns are not compatible |
wishlister
Replies: 3
Views: 1548
|
Forum: Database Posted: Thu Mar 08, 2007 6:35 pm Subject: The data types of corresponding columns are not compatible |
how and where will i cast values? in what statements? |
Topic: The data types of corresponding columns are not compatible |
wishlister
Replies: 3
Views: 1548
|
Forum: Database Posted: Thu Mar 08, 2007 6:21 pm Subject: The data types of corresponding columns are not compatible |
DECLARE @rate decimal(9,2);
DECLARE @hrs decimal(9,2);
DECLARE @ans decimal(9,2);
DECLARE @comm char(50);
DECLARE Cur CURSOR |
Topic: The data types of corresponding columns are not compatible |
wishlister
Replies: 3
Views: 1548
|
Forum: Database Posted: Thu Mar 08, 2007 4:59 pm Subject: The data types of corresponding columns are not compatible |
if(typ='A') then
INSERT INTO emp(empno, NAME, typ, rate, hrs)
VALUES (@empno, @NAME, @typ, @rate, @hrs);
FETCH Cur INTO @empno, @NAME, @typ, @rate, @hrs;
elseif(typ='B') ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 4:23 pm Subject: union in stored procedure |
create type EMP as
(empno char(6),
name varchar(50),
dtype varchar(11))
ref using integer
mode db2sql
create type HR under EMP as
(rate decimal(9,2),
hrs decimal(9,2))
mode db2sql
... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 2:00 pm Subject: union in stored procedure |
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0506melnyk/
under listing 3.
that's what im trying..
i want to combine salesperson and engineer tables in one table with their res ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 1:40 pm Subject: union in stored procedure |
oic.. now, it runs but when i call the stored proc it produces an error: A value cannot be assigned to a host variable in the SELECT, VALUES, or FETCH statement because the data types are not compatib ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 1:24 pm Subject: union in stored procedure |
what do u mean by x type? |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 1:08 pm Subject: union in stored procedure |
oic.. now, it runs but when i call the stored proc it produces an error: A value cannot be assigned to a host variable in the SELECT, VALUES, or FETCH statement because the data types are not compatib ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 12:58 pm Subject: union in stored procedure |
tnx! i know it will work but now, im having problem with my field names..
SELECT no, NAME, type, rate, hrs from HR
UNION
SELECT no, NAME, type, sal, bonus from MIS;
//error: The data types ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 12:48 pm Subject: union in stored procedure |
another question..
cursor1 is for the first table and cursor2 for the second table. is it right to use different cursors? or can i use only one cursor? |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 12:43 pm Subject: union in stored procedure |
db2 ESE
for
SELECT <statement>;
OPEN Cursor1;
FETCH <statement>;
WHILE SQLSTATE = '00000' Do
INSERT INTO <statement>;
FETCH <statement>;
END WHILE;
close Cursor1; ... |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 12:25 pm Subject: union in stored procedure |
can u give me an example? union of 2 select statements where there is cursor also.. ty! the samples in the link did not help |
Topic: union in stored procedure |
wishlister
Replies: 19
Views: 7847
|
Forum: Database Posted: Thu Mar 08, 2007 12:05 pm Subject: union in stored procedure |
how will i perform UNION of SELECT statements in stored procedure? |
Topic: stored proc on typed tables |
wishlister
Replies: 2
Views: 1470
|
Forum: Database Posted: Thu Mar 08, 2007 12:02 pm Subject: stored proc on typed tables |
how can i perform union of those two tables? |
|