| Create/Use Table |
| JLD Family Example |
' First create a table for the family
Call fizzGetTable("JLDFamily") ' Check that table exists (it will create it if necessary)
|
' Create a record
famKey = fizzNewRecord("JLDFamily", "FamilyRecord") ' Create a record for our data
|
' Add Nuggets to the record
Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TEXT, "FamilyName", "Davis")
Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TEXT, "Presents", "Shoes")
Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TIME, "Done Wrapping", "12/25/2001 2:30AM")
Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_MONEY,"Budget", "$100.00")
' Note: we added several new kinds of data (FamilyName,Presents,Done Wrapping,Original Budget)
|
' We can add other types of records to any table.
' Lets keep track of the kids
kidKey = fizzNewRecord("JLDFamily", "KidRecord") ' Create new record
Call fizzAddNugget("JLDFamily", "KidRecord", kidKey, FIZZTYP_TEXT, "KidName", "Sarah")
' Lets add a pointer. We want to know which family this kid belongs to.
' Note: use the family key as the pointer
Call fizzAddNugget("JLDFamily", "KidRecord", kidKey, FIZZTYP_PTR, "Family PTR", famKey)
|
' Why stop, let's set up the local basketball team too!
teamKey = fizzNewRecord("JLDFamily", "TeamRecord") ' Create a Team Record
Call fizzAddNugget("JLDFamily", "TeamRecord", teamKey, FIZZTYP_TEXT, "Sport", "Basketball")
Call fizzAddNugget("JLDFamily", "TeamRecord", teamKey, FIZZTYP_TEXT, "Coach", "T.Smith")
' Now have our kid keep track of the team they are on.
Call fizzAddNugget("JLDFamily", "KidRecord", kidKey, FIZZTYP_PTR, "Team PTR", teamKey)
|
Adding nuggets based on form input
Insert into testSQLUsageTableDefaults
SQL Default functions were set up in the testSQLUsageTableDefaults table.
TABLE DOES NOT USE FIZZDATATEMPLATE FORMAT.
Most functions have been moved/incorporated somewhere in fizzGetUsage (occuring at first execution).
Result = 0atabase): Cannot open database!!
Retrieve Record(0) from testSQLUsageTableDefaultsOpenConn 0: