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 first published in August 2006

Dig deeper on Using Oracle PL-SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close