View previous topic :: View next topic
|
Author |
Message |
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi All,
My requirement is as follows,
I want to create a table which has a column of 120 byte varchar,i want to fill default value as 40 spaces.Is it possible to give 40 spaces in to that??
Regards,
Bipin Peter |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Bipin,
In the Create table
WITH DEFAULT ' '
You can do it.
Can i know why 40 spaces by default for VARCHAR that too.
Sushanth |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I think the CREATE Table statement for the VARCHAR column would be
this would be the same as
Code: |
HIRE_TYPE VARCHAR(50) WITH DEFAULT 'New Hire'
|
the first would generate a textlength of 40 for the varchar(120)
the second would generate a textlength of 8 for the varchar(50).
Sushanth, if that is what you tried to show, you need the bbcode to maintain the spaces,
otherwise you would have generated a textlength of 1 for the varchar(120) |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Yes Dino. |
|
Back to top |
|
|
|