You can manually create a SQL file or from an existing procedural object definition. You can use an existing project folder to store SQL files or create project folders on the fly while you are creating a SQL file as in the example below.
To create a SQL file:
Open the Database Development perspective.
Select File|New|SQL File to launch the New SQL File wizard.
In the Enter or Select a Parent Folder field, enter or select the name of the project and proceed to step 6. If no project exists or to create a new project, click Create Project.
The New Project page appears.
Select Sybase|Sybase WorkSpace Project and click Next.
The Project page appears.
Enter a project name in the Project Name field and click Finish. The New SQL File page reappears.
Select a project name in the Project Name field and edit the default SQL file name as needed.
(Optional) Use the Advanced feature to link to a file in the file system and to create, edit, or remove defined path variables.
Select a database type from the Database type drop-down list.
Associate this SQL file with a connection by selecting a database type from the Connection profile name drop-down list.
Narrow your database selection in the Database Name field.
Select the Do not connect now check box if you do not want to connect to the server; however, note that you will not be able to use the complete content assist feature if it is selected. Click Finish.
A SQL file is created under the project name in WorkSpace Navigator. The cursor moves to the empty SQL file in the editor, or to the beginning of the file if you linked it to an existing file.
Right-click in SQL Editor and use the context menu to select Visual SQL to enter SQL statements. Use the Content Assist feature to edit the SQL statement. See Using Content Assist for more information.
Click Save on the Sybase WorkSpace toolbar, or right-click SQL Editor and select Save File from the context menu.
To create a SQL file from a procedural object:
With a procedural object loaded in SQL Editor, right-click and select Save As from the context menu. The Save As dialog appears.
Click an existing project to identify it as the parent folder, or click Create Project to create a new project. See steps 3 to 5 in the procedure above.
Click OK. A new SQL file with the original procedural object content is created and loaded into SQL Editor.
Use Visual SQL from the SQL Editor context menu to enter any additional SQL statements.
Click the context menu to select Save.
Your SQL file name appears in the project folder in WorkSpace Navigator.
Saving a Procedural Object Definition as a SQL File
Using Visual SQL to Edit a Procedural Object
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com