dbTalk Databases Forums  

Table name with a blank space inside.

comp.databases.sybase comp.databases.sybase


Discuss Table name with a blank space inside. in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Serguei.Goumeniouk@cibc.ca
 
Posts: n/a

Default Table name with a blank space inside. - 03-25-2009 , 09:57 AM






Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
Regards,
Serguei.

Reply With Quote
  #2  
Old   
Manish Negandhi
 
Posts: n/a

Default Re: Table name with a blank space inside. - 03-25-2009 , 10:27 AM






On Mar 25, 8:57*pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:
Quote:
* *Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
* Regards,
* * Serguei.
looks like the table was created after setting quoted_identifier on.
You can access table using

set quoted_identifier on
go
select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]


Reply With Quote
  #3  
Old   
PDreyer
 
Posts: n/a

Default Re: Table name with a blank space inside. - 03-26-2009 , 02:46 AM



On Mar 25, 6:27*pm, Manish Negandhi <negandhi.man... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 25, 8:57*pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:

* *Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
* Regards,
* * Serguei.

looks like the table was created after setting quoted_identifier on.
You can access *table using

*set quoted_identifier on
*go
*select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]
OR use square brackets

select * from [table x]


Reply With Quote
  #4  
Old   
ThanksButNo
 
Posts: n/a

Default Re: Table name with a blank space inside. - 03-26-2009 , 06:04 PM



On Mar 26, 1:46 am, PDreyer <petrus.dre... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 25, 6:27 pm, Manish Negandhi <negandhi.man... (AT) gmail (DOT) com> wrote:



On Mar 25, 8:57 pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:

Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
Regards,
Serguei.

looks like the table was created after setting quoted_identifier on.
You can access table using

set quoted_identifier on
go
select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]

OR use square brackets

select * from [table x]


Reply With Quote
  #5  
Old   
ThanksButNo
 
Posts: n/a

Default Re: Table name with a blank space inside. - 03-26-2009 , 06:06 PM



On Mar 26, 1:46 am, PDreyer <petrus.dre... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 25, 6:27 pm, Manish Negandhi <negandhi.man... (AT) gmail (DOT) com> wrote:



On Mar 25, 8:57 pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:

Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
Regards,
Serguei.

looks like the table was created after setting quoted_identifier on.
You can access table using

set quoted_identifier on
go
select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]

OR use square brackets

select * from [table x]
For what it's worth, the following is my favorite solution:

1> set quoted_identifier on
2> go
1> sp_rename "table x",table_x
2> go
Object name has been changed.
(return status = 0)
1> set quoted_identifier off
2> go

So there.

\;-)


Reply With Quote
  #6  
Old   
Serguei.Goumeniouk@cibc.ca
 
Posts: n/a

Default Re: Table name with a blank space inside. - 03-31-2009 , 12:44 PM



On Mar 25, 12:27*pm, Manish Negandhi <negandhi.man... (AT) gmail (DOT) com>
wrote:
Quote:
On Mar 25, 8:57*pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:

* *Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
* Regards,
* * Serguei.

looks like the table was created after setting quoted_identifier on.
You can access *table using

*set quoted_identifier on
*go
*select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]
Hi,
Both solutions (set quoted_identifier on AND use of square brackets)
work with Sybase 12.5, but for Sybase 12.0 they do not work.
1. Have you any idea why it does not work with 12.0?
2. Is there any solution I can use at 12.0?
Regards,
Serguei.


Reply With Quote
  #7  
Old   
PDreyer
 
Posts: n/a

Default Re: Table name with a blank space inside. - 04-01-2009 , 02:02 AM



On Mar 31, 7:44*pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:
Quote:
On Mar 25, 12:27*pm, Manish Negandhi <negandhi.man... (AT) gmail (DOT) com
wrote:





On Mar 25, 8:57*pm, Serguei.Goumeni... (AT) cibc (DOT) ca wrote:

* *Dear Experts,
I have a Sybase table with a blank space inside its name. How can I
access data from such a table?
* Regards,
* * Serguei.

looks like the table was created after setting quoted_identifier on.
You can access *table using

*set quoted_identifier on
*go
*select * from "table x"
go

-HTH
Manish Negandhi
[TeamSybase]

* *Hi,
Both solutions (set quoted_identifier on AND use of square brackets)
work with Sybase 12.5, but for Sybase 12.0 they do not work.
1. Have you any idea why it does not work with 12.0?
2. Is there any solution I can use at 12.0?
* Regards,
* * Serguei.- Hide quoted text -

- Show quoted text -

set quoted_identifier on
works for me on 12.0


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.