The Long/SQL String Builder
There are times when you may have a very long string and you want it to be formatted
on multiple lines for better readability. Using this CodeSMART tool, you can
quickly create the string and the variable that holds it, you can specify the maximum
line length and you can obtain a new formatted string. The generated code block can be
then copied into the memory or inserted into the Code window at the desired position.
The CodeSMART Long/SQL String Builder tool can also be used in formatting
simple SQL strings (certain SQL directives are supported: SELECT, UPDATE and DELETE).
In order to format your strings, CodeSMART offers three split types:
-
Treat as standard text: This option is used to format regular strings.
The string splitting is made when the maximum line length is encountered.
-
Split at each SQL clause: CodeSMART will split the SQL string on each
SQL clause or when maximum line length is encountered.
-
Split at each SQL clause and clause parameter: CodeSMART will split the SQL string
on each SQL clause or SQL clause parameter, or when maximum line length is encountered.
To format a string using the Long/SQL String Builder:
-
Open the code module where you want to insert the formatted string.
-
Select New Long/SQL String entry in the CodeSMART main menu in order to display
the New Long/SQL String dialog box (quick menu reference is available).
-
Start typing the string that you want to format in the corresponding text box. As you
type or make any changes between the dialog options, CodeSMART displays in the
Preview text box the formatted string according with the last chosen options.
-
Specify the maximum line length for the formatted string (only values between 60
and 200 are considered to be valid).
-
Optionally, you can add a variable that will hold the string and you can also
provide the variable definition.
-
Select the split type you want to use for the typed string, by choosing it
from the Split Type combo box.
-
In order to ensure a better readability, you can add indentation to SQL strings,
using the corresponding check box.
-
Use the Copy command button in order to copy the resulted string into the memory.
-
Press Insert in order to insert the formatted string into the
Code window and then automatically close the dialog box.
See also
Back To Top
|