Cloud Computing Conference
March 30 - April 1, New York
Register Today and SAVE !..


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


SQL Anywhere Studio 9 Developer's Guide
A new book by Breck Carter

As a PowerBuilder developer I'm sure you have already used SQL Anywhere a few times, but did you know that SQL Anywhere owns over 70% of the mobile database market?

There are several good reasons for this big market share; it's easy to use, easy to administer, and doesn't take up much space, but SQL Anywhere isn't just for mobile and embedded databases; it's got the features and the flexibility to work as a network server with hundreds of active users pounding away on a single database. And it's got a solid foundation and a long history from its roots with Watcom in the 1980s through to Powersoft and Sybase in the 1990s and now with iAnywhere Solutions in the new millennium. But there are still some features that aren't fully covered by the documentation so Breck Carter decided to write a book about this wonderful database. It's called SQL Anywhere Studio 9 Developer's Guide. So let's have a look at this book this month.

The Book
The book includes a companion CD that includes the full Backus-Naur Form notation for the SQL syntax from the book in HTML format for easy browsing. It also includes all of the examples in the book, plus a full copy of SQL Anywhere Studio 9 Developer Edition for Windows. The book itself is about 450 pages long and starts with the history of the database, beginning with the story of Watcom in 1965 and ending with the release of SQL Anywhere version 9. Then the reader dives into the deep world of the product and learns a lot in the next 10 chapters.

Chapter 1: Creating
This chapter begins with 12 rules to answer the question "What is a relational database?" It then describes the five kinds of tables (global permanent, global temporary, remote, proxy and local temporary) available using the seven different syntax options for the CREATE TABLE statement and, moving on to the wide variety of built-in string, date-time, and numeric data types, it continues with column properties, computed columns, default values, the NULL property, and column constraints. User-defined data types, table constraints, remote data access, and temporary tables are also covered. The chapter ends with a discussion of normalization to answer the question, "What is a good relational database?" An interesting chapter, compactly written.

Chapter 2: Inserting
With the first chapter covering so much information, the second one is exactly right. It talks about putting data into the database, covering five different flavors of INSERT (with a values list for all columns or a list of named columns, a select for all column values or a list of named columns, and use of the auto name facility as well as the load table statement and ISQL's client-side alternative, the input statement.

Chapter 3: Selecting
This one talks about the inverse of Chapter 2, getting data out of the database with SELECT, UNLOAD, and the ISQL OUTPUT statement. This is the longest chapter in the book, which should come as no surprise since the SQL SELECT statement may be the most powerful and complex single syntactic construction available in any database programming language.

Chapter 3 starts by explaining the SELECT statement, and the logical execution of a SELECT, which shows how all the various clauses fit together and contribute to the final result set without concern for how SQL Anywhere actually executes a SELECT. Most of the rest of Chapter 3 follows the steps laid out and explained at the beginning of the chapter. If you've ever had trouble with the GROUP BY clause, or had a SELECT that returned 10,000 rows instead of the three you wanted, or wondered why you can't call NUMBER(*) in a WHERE clause, this is the chapter for you.

Chapter 4: Updating
This chapter covers the UPDATE statement and how it can be used to update a single row in one table, or multiple rows, or even multiple rows in multiple tables. It also includes a section on the logical execution of a set UPDATE and a discussion of cursor UPDATE statements using the WHERE CURRENT OF clause.

Chapter 5: Deleting
Breck calls deleting the evil twin of Chapter 4; he talks about deleting single and multiple rows, and includes a section on the logical execution of a set DELETE as well as information about cursor DELETE statements using WHERE CURRENT OF. He also has a section on TRUNCATE TABLE and how it compares with DELETE: sometimes faster, sometimes not, and why.

Chapter 6: Fetching
A chapter six is a chapter a PowerBuilder developer should read since it talks about the DECLARE, OPEN, FETCH, and CLOSE statements as they apply to cursors using SELECT queries and procedure calls. It also describes the cursor FOR loop, which vastly simplifies the cursor loops in SQL by eliminating the need to DECLARE all those local variables or code those endless FETCH lists. Something a PowerBuilder developer doesn't do very often because of the datawindow and datastore we have.

Chapter 7: Synchronizing
Here you have it - the MobiLink chapter. It discusses how the MobiLink server works together with the MobiLink client for ASA to synchronize data back and forth between a consolidated database and dozens or thousands of remote databases. MobiLink scripts are classified by level (connection, session, table, and row) and by direction (upload versus download). And error handling on the server and client sides is described. This is an interesting chapter for every serious PocketBuilder developer. I can highly recommend it if you want to synchronize your mobile device with a desktop machine.

Chapter 8: Packaging
This chapter is about moving application logic into the database using BEGIN blocks and SQL modules based on BEGIN blocks: procedures, functions, triggers, and events. The SET assignment statement is described, as well as the flow-of-control structures IF, CASE, and WHILE, the EXECUTE IMMEDIATE statement, and the connection-level CREATE VARIABLE statement. This section introduces the basics of exception handling, a topic expanded on in Chapter 9.

Chapter 9: Protecting
Chapter 9 is the second-longest chapter in the book. It explores a wide variety of topics including options, transactions, exceptions, errors, subtransactions, locks, blocks, isolation levels, deadlocks, mutexes, user IDs, privileges, user groups, logging, recovery, backup, restore, and (gasp!) database validation. Many of these topics are only loosely connected to one another, but they all fall under the general heading "Crashing, Bashing, Thrashing, and Protection Therefrom."

Chapter 10: Tuning
This chapter might be the one with the biggest audience since everyone's interested in speed, speed, speed. This chapter should be read last because the first rule of optimization is "Don't do it." If you're an expert, Rule 2 also applies: "Don't do it yet."

Chapter 10 explains the four big performance tuning tools that SQL Anywhere provides: request-level logging, the Index Consultant, the Execution Profiler, and the Graphical Plan. It then moves on to more arcane topics such as file, table, and index fragmentation, and table, index, and database reorganization.

Sections on the syntax of CREATE INDEX and database performance counters are included, and the book ends with a performance tuning "Tips and Techniques" section that lists 36 do's and don'ts that didn't find a home earlier in the book.

Conclusion
The book is easy to read and contains important details about SQL Anywhere development. If you're new to SQL Anywhere the material will save you hours of time and dramatically shorten your learning curve. This book is simply a must-have for SQL Anywhere database developers because it's a complete and compact reference for experienced developers as well as comprehensive immersion for beginners and less experienced coders. It's written by someone who has a great deal of experience using SQL Anywhere Studio to build real-world software solutions. Have fun reading it.

SIDEBAR

Breck Carter is an experienced database developer. He first worked with a relational database in 1973 (the year I was born) before there were any practical commercial implementations. Over the years he has worked as an independent consultant to develop enterprise databases and applications using IMS DB/DC, DB2, Oracle, SQL Server, ASE, and, beginning in 1995, SQL Anywhere.

Breck has been a member of Team Sybase since 1993, which means you can find him answering questions on the SQL Anywhere newsgroups on behalf of Sybase and iAnywhere Solutions. He is also a member of the iAnywhere Solutions Customer Advisory Board, helping to shape future product direction.

About Berndt Hamboeck
Berndt Hamboeck is a senior consultant for BHITCON (www.bhitcon.net). He's a CSI, SCAPC8, EASAC, SCJP2, and started his Sybase development using PB5. You can reach him under admin@bhitcon.net.

PBDJ LATEST STORIES . . .
Virtualization is actively being used by Sybase IT to help solve power/cooling issues as well as transform the datacenter into an environment that brings greater benefits to their customers, especially the engineering organization. Average CPU utilization was very low on physical serve...
Last year I wrote an article in PBDJ describing an ASP.NET project that was done with DataWindow.NET in the browser ("Prognos," Volume 14, Issue 4) and PowerBuilder Web Services in the back end. The front end consisted of an intro page, two data entry pages, and one page with the resul...
WorkSpace is a service-oriented unified design and development environment that integrates the most important design and development tools in an easy-to-use open source framework. Enterprise modeling, database development, data federation, Web application development, service-oriented ...
Up until recently, Web applications were "connected-only" applications. Users could only use the application by connecting to the central server and all data access was done in a single place. For many years, people accepted that was the limitation of Web applications. But it isn't a l...
Sybase has announced its partnership with QBS Distribution (QBSD) to distribute Sybase PowerDesigner. The strategic partnership seeks to further strengthen Sybase PowerDesigner's global leadership within the UK market. Sybase PowerDesigner combines business process modeling with unifie...
Sybase, Inc. (NYSE:SY), a leading provider of enterprise infrastructure, mobile software, and mobile services, today announced that Terry Stepien, President of Sybase iAnywhere, will present on behalf of the company at the UBS Global Technology and Services Conference. The presentation...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE