Sybernet / Supplied Procedures Reference
Release 3.00
Dec 24, 2006
backwards forwards

SYBSYSTEMPROCS.SP_HTML_ISQL

The Sybernet Interactive SQL and Editor allows you to execute SQL and edit objects in your database. The Navigation window (or frame) allows you to select schemas and objects. The Input window (consisting of the ISQL, Editor, and Grants window) is where you submit commands (SQL or DDL) to Sybase. The Output window (shared by all) is where the output of your results are displayed.

Batch commands can be separated by go or a forward slash. The former is a Sybase convention; the latter is an Oracle convention. Comments (either C-style comments or PL/SQL comments) are unconditionally stripped from the beginning of each command. Redundant batch separators (go or /) are allowed. GO immediately followed by an exclamation mark (go!) means continue to the next command even if the last command failed.

To save real estate the standard menu bar is hidden away in its own frame at the bottom of this screen. Just click on this frame--if you can find it--and drag upwards until the menubar is displayed. The Cancel button is especially useful when you need to terminate a query from hell or a stored procedure that is looping.






The Navigation Window

The left most frame is used to select schemas or owners and objects from your database. At the very top is a drop-down list of those schemas that actually own something, but always includes your schema whether or not you actually own anything. To change schemas, simply select that owner from this list of schemas.

The rest of this window contains a list of object types. Each object type is preceded by a checkbox that when checked indicates you selected this type. Clicking an object type will list the objects of that type in this window. All of these work the same except for Packages (not to be confused with package bodies). When you click Packages, not only are the package specifications displayed, but also each subprogram in that package. The purpose here is to allow you to select just the prototype that you are interested in.

The checkbox next to each object name can mean several things. If it is a permission, it means you have this permission. If it is a role, it means you have this role. If it is a stored procedure, it means this procedure is registered in Sybernet.


The ISQL Window

This window is used for entering adhoc SQL statements. When an object is selected, it too is loaded into this window suitable for execution. That is, if you select a table, its SELECT statement is built; If you select a procedure, its run statement is built. Some objects (like database links or packages) can't be executed. In this case, the window is cleared.

Anytime you submit a query with this window that query is saved in the history list. There are buttons on this screen that allow you to scroll forwards or backwards through this history.

Button Description
Format
 
This drop-down list determines how the output of your query is formatted.
Submit
 
Use this button to submit the current query or selected text.
|<
 
This button scrolls your history list backwards until you click this button again.
<
 
This button scrolls your history list backwards.
>
 
This button scrolls your history list forward.
>|
 
This button scrolls your history list forward until you click this button again.
Xref
 
The Xref button lists dependencies for the current object. It includes those objects that are dependent on the current object as well as objects this object is dependent upon.
Find
 
The Find button allows you to search for objects, columns and parameters in the current schema.
Editor
 
This button enables the Editor window and hides the ISQL window.


The Editor Window

This window is used to edit an object in your database. The object can be dropped. The object can be executed in its own window if it is a procedure or subprogram. You can also replace text in this window with the Replace button.

Typically, only stored procedures with default null parameters are executed in the editor. Use the ISQL window for any other combinations.

Button Description
Undo
 
Resets the edit window since it was last loaded or since the last replace.
Submit
 
Use this button to submit the current DDL.
Replace
 
This button allows you replace text in the edit window.
Copy
 
The Copy button will make a copy of the current object.
Drop
 
The Drop button drops the current object.
Exec
 
The Exec button executes the current object.
Xref
 
The Xref button lists dependencies for the current object. It includes those objects that are dependent on the current object as well as objects this object is dependent upon.
Find
 
The Find button allows you to search for objects, columns and parameters in the current schema.
Grants
 
This button enables the Grants window and hides the Editor window.


The Grants Window

Whenever an object is loaded, its permissions are loaded in this window. Although informational in purpose, you can edit this screen and submit those changes to your database.

Button Description
Undo
 
Resets the grants window since it was last loaded.
Submit
 
Use this button to submit the current permissions.
Xref
 
The Xref button lists dependencies for the current object. It includes those objects that are dependent on the current object as well as objects this object is dependent upon.
Find
 
The Find button allows you to search for objects, columns and parameters in the current schema.
Grants
 
This button enables the ISQL window and hides the Grants window.


Find Dialog

This dialog searches for objects, columns, and parameters under the current schema. In general, your search is case insensitive. If searching for literal text, you will want to include the appropriate wild-card characters. If your search contains a name and value pair (separated by an equal sign), you can also search for any table containing that column (the name) that contains this value. If the column name is case-sensitive, the name part should be double-quoted in the usual way. The value part can also be double-quoted if the search target is case-sensitive. If the name part is the keyword TEXT, you are also telling it to search for any source text containing this text or pattern. The table below illustrates the various search modes.

Search for? Description
PLAN_TYPE
 
Searches for any object, column or parameter name called PLAN_TYPE.
%PLAN_TYPE%
 
Searches for any object, column or parameter name containing the text PLAN_TYPE.
PLAN_TYPE = 10
 
Searches for any table containing the value 10 in a column called PLAN_TYPE.
"Plan_Type" = "10"
 
Searches for any table containing the value 10 in a column called Plan_Type.
TEXT = PLAN_TYPE=10
 
Searches for any function, package or procedure containing the text PLAN_TYPE=10.
TEXT = %PLAN_TYPE%=%10%
 
Searches for any function, package or procedure containing this pattern. Unlike the previous example which is really fast, this example would allow any amount of white-space (or non white-space for that matter) before and after the equal sign.


Replace Dialog

Clicking the Replace button in the Editor window allows you to replace some or all text in this window. Options exist for performing a literal or case-sensitive search. You simply enter what you want to search for and what you want to replace this text by. Some options do not work in MicroSoft Internet Explorer or any Netscape compatible less than 7.0.

Command Description
Literal
 
This radio button searches for literal text.
Entire Word
 
This radio button searches for entire words only.
Selection Expression
 
This radio button searches for a pattern.
Case Sensitive
 
This check box causes the search to be case-sensitive.
Search Backwards
 
This check box causes the search to go backwards.
Wrap-around Search
 
This check box causes the search to wrap-around to the beginning.
Replace All
 
This button replaces all occurrences in the entire window or the selected text.
Find
 
This button is disabled.
Cancel
 
This button closes this dialog.
Replace
 
This button replaces the next occurrence of your search target.


Format Options

SQL commands executed from the ISQL window can be formatted in several flavors. Most of the time the Preformatted format is what you want to use. This is especially true when selecting columns from a table or view, or when writing output using http.write() and http.writeln(). When executing a stored procedure or subprogram that produces HTML, the Suppressed option is the best choice. But if you need a quick and dirty way to send your query to Excel or displayed as comma separated data, this drop-down list can be your friend

Format Description
Comma Separated
 
This option displays your results as comma separated data.
Echo
 
This option sends your results back to Sybase. Use it the same way you might use execute immediate.
Excel
 
The Excel option sends your output to Excel.
HTML Table
 
This option puts your result set in an HTML table. Sometimes useful when selecting from tables with many columns.
Preformatted
 
This option displays your output as tabular data when selecting from a table or view or as preformatted text when using http.write() or http.writeln().
Suppressed
 
The Suppressed option performs no formatting. This is best used when displaying HTML.




See Also

PATINDEX



Sybernet is a trademark of SRI International.
Copyright © 1996-2009 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/