unusual table name (in SAP) question
Posted in 2012
Topics: General Discussion
Hello IIUG community,
I ran into this issue before but forgot how to get around with it.
I have a table name, for example: /abc/xyz
When I try:
select count(*) from /abc/xyz;it gives me error, so how do you handle this?
Thanks in advance.
On Thu, Mar 8, 2012 at 14:04, Kern Doe <kern_doe@yahoo.com> wrote:
> I ran into this issue before but forgot how to get around with it.
> I have a table name, for example: /abc/xyz
> When I try:
>
> select count(*) from /abc/xyz;> it gives me error, so how do you handle this?
>
>
Set DELIMIDENT (the value doesn't matter much, but DELIMIDENT=1 in the
environment is good).
Then enclose names such as "/abc/xyz" in double quotes, and use single
quotes to represent strings.
SELECT COUNT(*) FROM "/abc/xyz" WHERE "column with spaces" = 'string
with spaces';
(Owner names can be specified as strings in single quotes or as delimited
identifiers in double quotes with or without DELIMIDENT set; other
delimited identifiers - table names, column names, etc - need to be in
double quotes.)
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--e0cb4efe2e54da088e04bac9af67
Thank you Jonathan, it works for me!
This is a great tip which I couldn't find it any where.
Have a great day!
________________________________
From: Jonathan Leffler <jonathan.leffler@gmail.com>
To: ids@iiug.org
Sent: Friday, March 9, 2012 1:41 AM
Subject: Re: unusual table name (in SAP) question [26498]
On Thu, Mar 8, 2012 at 14:04, Kern Doe <kern_doe@yahoo.com> wrote:
> I ran into this issue before but forgot how to get around with it.
> I have a table name, for example: /abc/xyz
> When I try:
>
> select count(*) from /abc/xyz;> it gives me error, so how do you handle this?
>
>
Set DELIMIDENT (the value doesn't matter much, but DELIMIDENT=1 in the
environment is good).
Then enclose names such as "/abc/xyz" in double quotes, and use single
quotes to represent strings.
SELECT COUNT(*) FROM "/abc/xyz" WHERE "column with spaces" = 'string
with spaces';
(Owner names can be specified as strings in single quotes or as delimited
identifiers in double quotes with or without DELIMIDENT set; other
delimited identifiers - table names, column names, etc - need to be in
double quotes.)
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--e0cb4efe2e54da088e04bac9af67
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.