Welcome!

Eclipse Authors: RealWire News Distribution, Adam Blum, Aditya Banerjee, Jeff Anders, CJ Fearnley

Related Topics: PowerBuilder, Eclipse

PowerBuilder: Article

Using Sybase WorkSpace on Eclipse with SQL Anywhere

Building a Java project

To make a schema change, start by opening the Database Explorer Perspective.

1.  Click Window | Open Perspective | Database Explorer
2.  Ensure that you have the Database Explorer view active
•   If not, you can click Window | Show View | Database Explorer
3.  Inside the Database Explorer view
•   Expand the connection profile that contains the database you wish to alter, and then expand the database. Right-click on folders in the submenu to see the available options
•   Example: Right-click on Tables, and select New Table
     o Enter as many columns as you like, then right-click and select Save Table
     o Enter a name for the new table and then click OK

The Database Explorer perspective lets you make all the schema changes necessary to your database. You can also use it to write stored procedures and functions, as well as SQL Anywhere Server Web Services.

Querying a SQL Anywhere Database
With Sybase WorkSpace's Interactive SQL view, you can send any query to the active SQL Anywhere Server database.

1.  Open the Database Explorer perspective
•   Click Window | Open Perspective | Database Explorer
2.  Right-click on your desired database in the left explorer pane, click Set as Active Database
3.  In the bottom-right view, click the ISQL Session tab
4.  Enter a valid SQL query

5.  Right-click on the view and select Execute

The view will automatically switch to the Results tab when you execute a query. There you can view all rows and columns returned from the query.

Debugging a Stored Procedure
Sybase WorkSpace can be used to debug a SQL Anywhere stored procedure.

1.  Open the Database Development perspective
•   Click Window | Open Perspective | Database Development
2.  In the Database Explorer view, right-click on the asaDemo database you connected to in the Getting Started section of this tutorial, select Set as Active Database. Also disconnect from all other databases
3.  Expand the Procedures and Functions folder, right-click on the debugger_tutorial procedure, and select Debug Procedure
4.  This will open a file that contains the store procedure definition. Right-click somewhere on the grey sidebar of that window and select Toggle Breakpoint
5.  Right-click on the view and select Debug

6.  Select Yes to open the Database Debug perspective

In this perspective you can step through your stored procedure and methodically search for problems or verify requirements.

Summary
This tutorial explained how to set up Sybase WorkSpace and how to do the following in the development environment:

•   Connect to a SQL Anywhere database
•   Create a new database
•   Make schema changes to a database
•   Query a database
•   Debug a stored procedure

This is a very brief introduction to the vast range of features offered by Sybase WorkSpace. To learn more about the product, please download the trial version and try out some of the samples and tutorials in the online documentation.

Trial version:
www.sybase.com/products/development/workspace

Documentation:
http://sybooks.sybase.com/nav/detail.do?docset=1303

More Stories By José Ramos

José Ramos is a product manager for Sybase iAnywhere and is responsible for the direction and life cycle planning of Sybase iAnywhere products. With more than seven years of experience, he also plays an active role in customer demonstrations and education to ensure the continued success of SQL Anywhere, the industry-leading database management and data movement technology built for frontline environments. José holds a Bachelor of Mathematics in Computer Science from the University of Waterloo in Ontario, Canada.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.