If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Using Space(n) function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-11, 03:14
reddy_546 reddy_546 is offline
Registered User
 
Join Date: May 2010
Location: Hyderabad, India
Posts: 16
Using Space(n) function

Here I am using Space() function as below:

select space(51) as Name, SEQ into #Temp from Member.

In the above query it is inserting space(1) instead of 51 spaces.

Can any one help me out in the same?

Thanks in advance!!
__________________
-PavanKumar M Reddy
Reply With Quote
  #2 (permalink)  
Old 01-28-11, 07:52
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
That is because the target table is created with a varchar column
instead use:
select convert(char(50),'') as Name, SEQ into #Temp from Member
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On