tags:

views:

41

answers:

3

How can i append a whitespace character- for example   /   (non-breaking space) to a field value querying oracle server?

I tried

SELECT myfield || ' ' FROM mytable

but this is interpreted as a variable with the name #160.

+2  A: 

Use the command

set define off

to prevent Oracle from using the & to denote a variable substitution.

Of course that just keeps it from keying off the & symbol. You could use the chr( ) function to insert a character with that binary equivalent value that you want.

Dougman
+2  A: 

simply doing

select sysdate || ' ' from dual

works for me. Does this not work for you?

Jay
+2  A: 

You could also use the CHR function:

SELECT myfield || CHR(160) FROM mytable
Jeffrey Kemp
Yes CHR() is the best way to accomplish what i needed. Dougman just was a bit faster ;-)
Filburt
well, that's your choice, no worries :)
Jeffrey Kemp