How To : Debugging SQL

Page Status: Beta
Jump to: navigation, search

Back to Concepts and HOW TOs

Contents

[edit] Description

This document describes how to debug database calls.

[edit] Prerequisites

Connecting to an SQL Database
Creating a Class to Contain Row Data from an SQL Table
Logging in to an SQL Database
Adding CRUD Operations to a Class
Using Debugging
Understanding the Event Viewer

[edit] Procedure

The SQLConnection Runtime Type (superclass for MySQL and Postgres) described in the Prerequisite documents contains a field named debug. You must set SQLConnection.debug to true to enable debug events in the Event Viewer.

The following screen shot show how you can set debug to true when you log in to your database.

With debug enabled, you will get database calls logged to the Event Viewer.

The following screen shot show the DatabaseLogMessage logged to the Event Viewer when we have a typo in the table name.

  1. The Event Viewer is on a tab on the left side of the Builder
  2. Selecting the DatabaseLogMessage at the top of the Event Viewer, displays the detail of the message at the bottom.
    The attempted query is displayed.
  3. In this case, an error is also displayed since there is a typo in the table name.

[edit] Error Handling

 

[edit] Examples

[edit]  

[edit] Next Steps

 

[edit] Tags

    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.