Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

varchar dclgen field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Kevin Dcosta

New User


Joined: 01 Jan 2008
Posts: 35
Location: Hyderabad

PostPosted: Sat Sep 20, 2008 5:39 pm    Post subject: varchar dclgen field
Reply with quote

can the length part of a varchar field be set as zero ?
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Sep 20, 2008 6:10 pm    Post subject:
Reply with quote

Yes
Back to top
View user's profile Send private message
Kevin Dcosta

New User


Joined: 01 Jan 2008
Posts: 35
Location: Hyderabad

PostPosted: Sat Sep 20, 2008 7:15 pm    Post subject:
Reply with quote

i have verified thanks for your quick reply.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Sep 20, 2008 11:42 pm    Post subject:
Reply with quote

Your welcome, I'm glad I passed the test.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Sep 21, 2008 12:54 am    Post subject:
Reply with quote

Congratulation Craig.. icon_razz.gif ..!

- Ad
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Mon Sep 22, 2008 10:01 am    Post subject:
Reply with quote

Hi Kevin,
I have a question. Did you set the length as zero while inserting or while selecting?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 22, 2008 12:18 pm    Post subject:
Reply with quote

With a select, it does not matter what value with which the length field has been populated. Db2 will populate the length upon a successful select.

you can set the value to zero for both inserts and updates.
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Mon Sep 22, 2008 1:14 pm    Post subject:
Reply with quote

Hi Dick,
We can set the length value to zero while inserting as well as selecting. But as you said it doesn't matter while we are selecting because the length value will be populated. But while inserting, if we give the value as zero, the value in the text field will not be inserted. So i guess it will be better avoiding setting length to zero.

Corrections are welcome.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 22, 2008 1:22 pm    Post subject:
Reply with quote

Quote:

So i guess it will be better avoiding setting length to zero.


not sure what you are trying to say.

depends on what you want in the char portion............
If you do not want anything and it is not a nullable field, a length of zero could be interpreted as no data as apposed to spaces.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us