News Feed Comments

Releasable Revolution

Creating release quality applications with Revolution

  • Home
  • Tutorials & Manuals
  • Articles
  • Revolution Tools
    • Libraries
      • SQL Yoga
      • GLX Application Framework
      • libDatabase
    • Externals
      • EQT
    • Plugins
      • Script Format Helper
      • BBEdit Language Module
  • About
Tutorials & Manuals » SQL Yoga » How Do I Create Records In a Database Table Using a SQL Query Object?

Subscribe to our feed

Topics

  • Introduction 1
    • About SQL Yoga and This Manual
  • SQL Yoga Primer 3
    • The Primer Stack
    • Connect to a Database By Creating Database and Connection Objects
    • Getting Data From the Database and Displaying It in the UI
  • Notes on Error Reporting 3
    • How SQL Yoga Reports Errors
    • Errors Thrown From Password Protected Stacks
    • Revolution Message Box
  • General Concepts 4
    • How To Use the sql_yoga.rev Stack File In the IDE
    • Unlocking The SQL Yoga Library
    • Building a Standalone Application With SQL Yoga
    • How SQL Yoga Represents Objects
  • Database Objects 5
    • Introduction to the Database Object and Database Schema
    • Creating A Database Object
    • Saving A Database Object Across Sessions
    • Loading The Database Object When Your Stack Opens
    • How To Work With Multiple Database Objects
  • Database Connections 5
    • Introduction to Connection Objects
    • Connecting to a Database Using a Connection Object
    • Telling SQL Yoga When Your Database Schema Changes
    • How To Work With Multiple Connection Objects
    • My Database Schema Has Columns/Tables That Are Reserved Words? What Can I Do?
  • SQL Query Objects 6
    • Introduction to SQL Query Objects
    • Creating A SQL Query Object
    • How Do I Create Records In a Database Table Using a SQL Query Object?
    • How Do I Delete Records From the Database Table Using a SQL Query Object?
    • How To Use Cursors With a SQL Query Object
    • How Can I Convert a User Search String Into An AND/OR Search When Generating a Query?
  • Record Objects 5
    • Introduction to SQL Record Objects
    • Create Records in the Database Using SQL Record Objects
    • Retrieve Records from the Database Using SQL Record Objects
    • Update Records in the Database Using SQL Record Objects
    • Delete Records from the Database Using SQL Record Objects
  • Table Objects 4
    • Introduction to Table Objects
    • Familiarizing Yourself With The "table objects behavior" Property
    • Creating a Table Object
    • How Do I Add Custom Properties To Tables?
  • Table Relationships 3
    • Introduction to Relationship Objects
    • Creating a Relationship Object
    • How Can I Use Relationship Objects When Generating Queries?

SQL Yoga: A Flexible Database Library for Revolution.

SQL Yoga page

Buy now

Last Updated

Dec 30, 2010

Download Manual PDF

Other Resources

  • How-tos

  • Lessons
  • GLX Application Framework

  • GLX Application Framework 1.1
  • Converting An Existing Application To Use The Framework
  • SQL Yoga

  • SQL Yoga
  • SQL Yoga Examples
  • SQL Yoga To-Do Application
  • SQL Yoga IDE Plugin
  • Plugins, Externals and Libraries

  • Plugins

Comments

0 comments for this lesson

  • Prev: Creating A SQL Query Object
  • Next: How Do I Delete Records From the Database Table Using a SQL Query Object?

How Do I Create Records In a Database Table Using a SQL Query Object?

A SQL Query object provides a quick way of creating data in a database. This lesson will show you how to use sqlquery_create to do so.

Note: When using sqlquery_create none of the validations or callbacks you've defined for Table objects will be triggered.

Create An Array

The first step is to fill in an array variable with the values you want to insert into the database. The array keys should be the names of the columns in your database table.

## Create array with column values for new database record.
put "My Dog's Car" into theRowA["title"]
put false into theRowA["draft"]

Create The Record

Once you have created the array you just pass it as a parameter to sqlquery_create along with the name of the table you want to create the record in. SQL Yoga will generate the query for you.

sqlquery_create "lessons", theRowA
put the result into theError
put it into theAffectedRows

  • Prev: Creating A SQL Query Object
  • Next: How Do I Delete Records From the Database Table Using a SQL Query Object?

Comments (0)

Add your comment

E-Mail me when someone replies to this comment
  • ScreenSteps Desktop

    ScreenSteps Desktop helps you help other people.

    Teachers can teach, Bloggers can demonstrate, Tech Support can communicate, Developers can document, Trainers can instruct.

    All in a matter of minutes.

    Learn More

  • ScreenSteps Support Suite

    We're Revolutionizing the Way Organizations Help Their Customers

    Join Us

    Create, distribute and aggregate “Just In Time” tutorials that help your customers and ease your support load.

    Learn More

  • revSelect Add-Ons

    Supercharge your Revolution development with RevSelect products.

© 2009 Releasable Revolution