/FizzDB/SampleSave.asp 11/19/2019 5:34:05 AM

Create/Use Table
JLD Family Example
  • Shows how to create a table, a record and record a nugget.
  • 	' 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
    
    Requested Record: Our new, empty family record
    Table: "JLDFamily"{4A16AE17-41B7-40A3-A883-A14F204626FC} located

    Record #1FamilyRecord Record Definition Key={4A16AE17-41B7-40A3-A883-A14F204626FC}
    #1013148PtrTag 3: RecordPTRFamilyRecord Record Definition11/19/2019 5:34:05 AM
    SummaryThere is 1 nugget associated with this record.
    	' 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)
    
    Requested Record: Our family record after adding nuggets
    Table: "JLDFamily"{4A16AE17-41B7-40A3-A883-A14F204626FC} located

    Record #1FamilyRecord Record Definition Key={4A16AE17-41B7-40A3-A883-A14F204626FC}
    #1013148PtrTag 3: RecordPTRFamilyRecord Record Definition11/19/2019 5:34:05 AM
    #2013149TextTag 2587: FamilyNameDavis11/19/2019 5:34:05 AM
    #3013150TextTag 2588: PresentsShoes11/19/2019 5:34:05 AM
    #4013151Time/DateTag 2589: DoneWrapping Null 11/19/2019 5:34:05 AM
    #5013152Money/FloatTag 2590: Budget10011/19/2019 5:34:05 AM
    SummaryThere were 5 nuggets associated with this record.
    	' 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)
    
    Requested Record: Our Kid Record
    Table: "JLDFamily"{8DDDCB12-E368-46AC-BA79-CBCBAA7D331C} located

    Record #1KidRecord Record Definition Key={8DDDCB12-E368-46AC-BA79-CBCBAA7D331C}
    #1013153PtrTag 3: RecordPTRKidRecord Record Definition11/19/2019 5:34:05 AM
    #2013154TextTag 2591: KidNameSarah11/19/2019 5:34:05 AM
    #3013155PtrTag 2593: FamilyPTR"FamilyRecord" Key {4A16AE17-41B7-40A3-A883-A14F204626FC}11/19/2019 5:34:05 AM
    #4013156PtrTag 2593: FamilyPTR"FamilyRecord" Key {4A16AE17-41B7-40A3-A883-A14F204626FC}11/19/2019 5:34:05 AM
    SummaryThere were 4 nuggets associated with this record.
    	' 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)
    
    Requested Record: Our Team Record
    Table: "JLDFamily"{C584906D-4776-4D67-9E85-262E92C769B0} located

    Record #1TeamRecord Record Definition Key={C584906D-4776-4D67-9E85-262E92C769B0}
    #1013157PtrTag 3: RecordPTRTeamRecord Record Definition11/19/2019 5:34:06 AM
    #2013158TextTag 2601: SportBasketball11/19/2019 5:34:06 AM
    #3013159TextTag 2603: CoachT.Smith11/19/2019 5:34:06 AM
    SummaryThere were 3 nuggets associated with this record.
    Requested Record: Our Kid Record after adding team pointers
    Table: "JLDFamily"{8DDDCB12-E368-46AC-BA79-CBCBAA7D331C} located

    Record #1KidRecord Record Definition Key={8DDDCB12-E368-46AC-BA79-CBCBAA7D331C}
    #1013153PtrTag 3: RecordPTRKidRecord Record Definition11/19/2019 5:34:05 AM
    #2013154TextTag 2591: KidNameSarah11/19/2019 5:34:05 AM
    #3013155PtrTag 2593: FamilyPTR"FamilyRecord" Key {4A16AE17-41B7-40A3-A883-A14F204626FC}11/19/2019 5:34:05 AM
    #4013156PtrTag 2593: FamilyPTR"FamilyRecord" Key {4A16AE17-41B7-40A3-A883-A14F204626FC}11/19/2019 5:34:05 AM
    #5013160PtrTag 2604: TeamPTR"TeamRecord" Key {C584906D-4776-4D67-9E85-262E92C769B0}11/19/2019 5:34:06 AM
    SummaryThere were 5 nuggets associated with this record.

    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 = 2927

    Retrieve Record(2927) from testSQLUsageTableDefaults
    field UsageGUID value {2444E84E-FD7E-45EC-AEE0-4DAD89EFE39D} dbtype 72
    field UsageAutoID value 2927 dbtype 3
    field UsageProgName value Internet Information Services dbtype 200
    field UsageAppName value ResPark dbtype 200
    field UsageComment value Added from WebSite dbtype 200
    field UsageAppVisitorIP value 35.170.76.39 dbtype 200
    field UsageAppVisitorPage value /FizzDB/SampleSave.asp dbtype 200
    field UsageAppServerIP value 192.168.231.172 dbtype 200
    field UsageAppServerName value resourcepark.com dbtype 200
    field UsageTime value 11/19/2019 5:34:06 AM dbtype 135
    field UsageFormulaYYYYMMDD value 20191119 dbtype 200
    field UsageFormulaAppNameLeft3 value Res dbtype 200
    field UsageSQLSPID value 57 dbtype 3
    field UsageSQLDBName value Fizz dbtype 200
    field UsageSQLDBID value 20 dbtype 2
    field UsageSQLClientMachineName value GLASGOW dbtype 129
    field UsageSQLClientMachineID value 4916 dbtype 129
    field UsageSQLDBUserName value NATIONALDESKTOP\WebDomResourcePark dbtype 202
    field UsageSQLDBUserID value 5 dbtype 2
    field UsageSQLLoginUserName value NATIONALDESKTOP\WebDomResourcePark dbtype 202
    field UsageSQLLoginUserSID value ? dbtype 204
    field UsageSQLSystemDefUserName value NATIONALDESKTOP\WebDomResourcePark dbtype 202
    field UsageSQLSessionDefUserName value NATIONALDESKTOP\WebDomResourcePark dbtype 130
    field UsageSQLServerName value RAMSQL dbtype 202
    field UsageSQLMachineName value RAMSQL dbtype 202
    field UsageSQLServerInstanceName value null dbtype 200
    field UsageSQLServerProcessID value 1524 dbtype 200
    field UsageSQLProductEdition value Web Edition (64-bit) dbtype 202
    field UsageSQLProductVersion value 11.0.7001.0 dbtype 200
    field UsageSQLProductLevel value SP4 dbtype 202
    field UsageSQLProductWFullText value 0 dbtype 3
    field UsageSQLLicenseType value DISABLED dbtype 202
    field UsageSQLLicenseProcessors value null dbtype 3
    field UsageDBVersion value 706 dbtype 3
    field UsageDBStandBy value 0 dbtype 3
    field UsageDBAutoShrink value 0 dbtype 3
    field UsageDBFulltextEnabled value 0 dbtype 3
    field UsageMaxConnections value 32767 dbtype 3
    field UsageTotalRead value 2583434 dbtype 3

  • Updating field UsageAppName
    End Fizz /FizzDB/SampleSave.asp @ 11/19/2019 5:34:06 AM