Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Why did a colon character stop working while generating an HTML Email in SQL?

PhilMan2Mar 10 2022

I recently upgraded to Oracle 21c. Throughout multiple Oracle releases I have a stored procedure that generates an Email automatically. It was working fine. However, after the upgrade, the stored procedure stopped working. The procedure doesn't give an error in SQL Developer, but the Email is never created. The error is in generating an "href" to an APEX application. The web site identified within the href has a colon to specify the port. Here's a code snippet.

l_html_footer := 
'Please input your data as soon as you can.<br /><br />' ||
'Click here for the application: ' ||  
'<a href="https://my_domain.com:9090/ords/f?p=105">' || 
'https://my_domain.com:9090/ords/f?p=105<br />' ||
'</a><br />' || 
'</div>' ||
'</body>' ||
'</html>';

If I remove the colon prior to the port number, the Email is created and received, but of course the URL is wrong and clicking on that href link generates an error.

'https://my_domain.com9090/ords/f?p=105<br />' ||

Oddly enough, the colon after the "https" can remain and doesn't have to be removed.
The Email is sent using calls to:
utl_smtp.open_data
utl_smtp.write_data
utl_smtp.close_data
How do I include a colon in the body of the URL so that I can indicate the proper port?

Comments
Post Details
Added on Mar 10 2022
8 comments
335 views