TOC PREV NEXT INDEX



Creating a second database query


You have now made the final additions to the user interface. Next we will create a second database query.

  1. Select the "SQL Builder" page of the database editor. You will see the SQL code for your "inStock" query.
  2. Press the Create New Query button. This will create a new query, and will clear the statement area so you have space to enter it. If you do not do this, you will make changes in your "inStock" query and the query you set up previously will not work.
  3. Rename this new query "descriptionQuery" by typing the new name in the field at the top of the page.
  4. Press the Code Sourcerer button.
  5. Choose "Search for rows from a database table", then press Next.
  6. Choose the table "PRODUCT_TBL" (under PUBLIC) then press Next.
  7. Select Choose Columns.
  8. Click on DESCRIPTION, PRODUCT_NUM, PURCHASE_COST, and QTY_ON_HAND to select those columns. and press Next.
  9. Select "DESCRIPTION" from the popup menu on the lower left.
  10. Select "contains" from the popup menu in the middle of the bottom row.
  11. Type "java" in the combobox on the bottom right side.
  12. Uncheck the checkbox which reads "Search is Case Sensitive". This will make your search find "java", no matter what the capitalization of the letters may be in the database.

The condition that we have built will be displayed, and will read

UPPER(DESCRIPTION) LIKE '%' || UPPER('java') || '%'
  1. Press done.
  2. The following code will be written in the statement area.
SELECT DESCRIPTION, PRODUCT_NUM, PURCHASE_COST, QTY_ON_HAND
FROM PUBLIC.PRODUCT_TBL
WHERE UPPER(DESCRIPTION) LIKE '%' || UPPER('java') || '%'
  1. Press the "Execute Query" button to execute your SQL Query. The results will be displayed below.

You have now set up the SQL code for your second database query.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX