IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL CODE -420 with VALUE CLAUSE


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amit_Singh47

New User


Joined: 15 May 2013
Posts: 22
Location: India

PostPosted: Tue Jun 11, 2013 12:55 pm
Reply with quote

SELECT
S.MEMBER_ID
, VALUE (A.GROUP,' ')
, VALUE (A.SUBGROUP,' ')
, VALUE (S.LAST_NAME,' ')
, S.CUMBH_FIRST_NAME
, VALUE (S.DATE_OF_BIRTH,'0001-01-01')
, VALUE (S.SSN_NO,' ')
, VALUE (S.SEX_CD,' ')
FROM
ACCOUNT_MEMBER A,
SUBSCRIBER S
WHERE
MEMBER_ID > 0
WITH UR;

this query on execution gives -420 sql code, which says "THE VALUE OF A CHARACTER STRING ARGUMENT WAS NOT ACCEPTABLE TO THE FUNCTION".

However all the fields on which I have used VALUE clause are defined as CHAR in the TABLE except Date_of_Birth which is defined as DATE in TABLE. I am currently using DB2 version 8.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 1:59 pm
Reply with quote

Try this

Code:
SELECT
S.MEMBER_ID
, VALUE (A.GROUP,' ')
, VALUE (A.SUBGROUP,' ')
, VALUE (S.LAST_NAME,' ')
, S.CUMBH_FIRST_NAME
, VALUE (S.DATE_OF_BIRTH,DATE('0001-01-01'))
, VALUE (S.SSN_NO,' ')
, VALUE (S.SEX_CD,' ')
FROM
ACCOUNT_MEMBER A,
SUBSCRIBER S
WHERE
MEMBER_ID > 0
WITH UR;
Back to top
View user's profile Send private message
Amit_Singh47

New User


Joined: 15 May 2013
Posts: 22
Location: India

PostPosted: Tue Jun 11, 2013 2:45 pm
Reply with quote

Hi Pandora,

this is not working too...can u please suggest something else?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 2:47 pm
Reply with quote

When you mean not working what is the error that you get?
Back to top
View user's profile Send private message
Amit_Singh47

New User


Joined: 15 May 2013
Posts: 22
Location: India

PostPosted: Tue Jun 11, 2013 3:20 pm
Reply with quote

same -420 error
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 3:33 pm
Reply with quote

Can you recheck the data type of these fields

Code:
, VALUE (A.GROUP,' ')
, VALUE (A.SUBGROUP,' ')
, VALUE (S.LAST_NAME,' ')
, VALUE (S.SSN_NO,' ')
, VALUE (S.SEX_CD,' ')


Quote:
-420 THE VALUE OF A STRING
ARGUMENT WAS NOT ACCEPTABLE
TO THE function-name FUNCTION
Explanation:
A string argument did not conform to the requirements
of the function. For example, a character string passed
to the DECIMAL function did not conform to the rules
for forming an SQL integer or decimal constant.
System action:
The statement cannot be processed.
Programmer response:
Change the argument value so that it conforms to the
requirements of the function as specified in SQL
Reference.
SQLSTATE:
22018
Back to top
View user's profile Send private message
Amit_Singh47

New User


Joined: 15 May 2013
Posts: 22
Location: India

PostPosted: Tue Jun 11, 2013 4:06 pm
Reply with quote

Pandora, i understand your concern,
but the datatypes are as follows:

group : char(15)
subgroup : char(15)
last name : char(26)
ssn : char(10)
sex : char(01)
Back to top
View user's profile Send private message
Amit_Singh47

New User


Joined: 15 May 2013
Posts: 22
Location: India

PostPosted: Tue Jun 11, 2013 4:29 pm
Reply with quote

the problem got solved guys...
there was a mistake not in the value clause
but the ordering of attribute names
in the FETCH was incorrect.

thanks for your inputs everyone. icon_biggrin.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 4:48 pm
Reply with quote

Ah ok .. Glad you figgured it out icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top