MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The data types of corresponding columns are not compatible

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
wishlister
Beginner


Joined: 08 Mar 2007
Posts: 16
Topics: 3

PostPosted: Thu Mar 08, 2007 4:59 pm    Post subject: The data types of corresponding columns are not compatible Reply with quote

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') then
INSERT INTO emp(empno, NAME, typ, ans, comm)
VALUES (@empno, @NAME, @typ, @ans, @comm);
FETCH Cur INTO @empno, @NAME, @typ, @ans, @comm;
end if;

error//The data types of corresponding columns are not compatible in a fullselect that includes a set operator or in the multiple rows of a VALUES clause of an INSERT or fullselect.
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Thu Mar 08, 2007 5:46 pm    Post subject: Reply with quote

how you define the Cur CURSOR?
what's the data type of the 4th and 5th field of the CURSOR?
is it match with (@rate, @hrs) and (@ans, @comm)?
Back to top
View user's profile Send private message
wishlister
Beginner


Joined: 08 Mar 2007
Posts: 16
Topics: 3

PostPosted: Thu Mar 08, 2007 6:21 pm    Post subject: Reply with quote

DECLARE @rate decimal(9,2);
DECLARE @hrs decimal(9,2);
DECLARE @ans decimal(9,2);
DECLARE @comm char(50);
DECLARE Cur CURSOR
Back to top
View user's profile Send private message
wishlister
Beginner


Joined: 08 Mar 2007
Posts: 16
Topics: 3

PostPosted: Thu Mar 08, 2007 6:35 pm    Post subject: Reply with quote

how and where will i cast values? in what statements?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group