NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
This object is used to render a SQL query string as a syntax-highlighted block of HTML on a web page. It utilizes the highlight.js library to perform the syntax highlighting.
The necessary JavaScript and CSS files (highlight.min.js and highlight/default.min.css) are automatically added to the page resources when the Process method is called.
The Process method takes a single primary parameter:
# Assuming 'obj' is an instance of ObjProcessText
sql_statement = "SELECT user_id, username FROM users WHERE is_active = 1;"
html_output = obj.Process(sql_query=sql_statement)
# The 'html_output' variable will now contain the HTML and JavaScript
# needed to render the highlighted SQL on a web page.
The returned value is an HTML string containing a <pre><code class='sql'> block with the SQL, and a <script> tag to initialize the highlighting.