3

I have an SQL statement and I would like to have an alias with a space. For example:

select name as User name from users;

I tried different syntaxes but it fails.

select name as "User name" from users;
select name as 'User name' from users;
select name as {User name} from users;
select name as [User name] from users;

database version: Firebird 2.5

Help me please

9
  • Are you running these statements directly from the command line? Commented Oct 9, 2017 at 11:43
  • If you were running this on dialect 3 from the command line, then you might have had an option to make this work: stackoverflow.com/questions/35574477/… Commented Oct 9, 2017 at 11:46
  • i running it in command line and in IBExpert. Commented Oct 9, 2017 at 12:15
  • You are using 2.x so I don't think this is possible. Commented Oct 9, 2017 at 12:15
  • I think the easiest way out of this is to heed Gordon's warning and just avoid spaces. If you follow the link I pasted above, it appears that the 2.x dialog does not support double escaping, so you might be out of luck even if you wanted to do it. Commented Oct 9, 2017 at 12:28

1 Answer 1

5

I would advise you to simply stop wanting the space -- it is a hassle to deal with delimited identifiers in any database.

But, as the documentation explains, Firebird does not necessarily support them:

  • Delimited identifiers are available in Dialect 3 only. For more details on dialects, see SQL Dialect.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.