Q

PL/SQL ignores ASCII null characters

I am trying to send an escape sequence to a dot matrix printer. But the sequence has embedded ASCII null characters (i.e., chr(0)), and PL/SQL seems to ignore the first null and all sequence bytes after. Why is this and what is the workaround?

I am trying to send an escape sequence to a dot matrix printer. But the sequence has embedded ASCII null characters (i.e., chr(0)), and PL/SQL seems to ignore the first null and all sequence bytes after. Why is this and what is the workaround?
Try using chr(32). Chr(32) equals a space.

For example:

select 'ABC' ||chr(32)||chr(32)||'DEF' from dual

Result: 'ABC DEF'

This was last published in August 2006

Dig Deeper on Using Oracle PL-SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close