Q
Problem solve Get help with specific problems with your technologies, process and projects.

What is the line feed character in SQL?

What is the line feed character in SQL and what is the ASCII value of it?

What is the line feed character in SQL and what is the ASCII value of it?

SQL itself doesn't use line feed characters because the line feed character, like the space and the carriage return character, is considered "white space." SQL treats all consecutive "white space" characters as a single space.

Therefore, this query --

 select foo from bar where fap = 'qux'

is interpreted the same way as this query --

 select foo from bar where fap = 'qux'

However, the former style (multi-line, with indentation) is a lot easier to read and understand than the single-line monolithic query style, especially for larger queries.

The only time you'd need to know its ASCII value is when, for example, you're searching for data values containing a line feed character. In that case, you are looking for a single byte with the binary value 0110, which is equivalent to decimal 10 or hexadecimal 0A. In standard SQL, you can use "X" notation to represent hexadecimal characters. For example,

 select username, body from comments where body like '%' || x'0A' || '%'

This finds all comments where the body contains a line feed character.

This was last published in June 2007

Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close