Single or stand-alone table (part 5)
Now we are getting to the true meat of the Module! This begins with the Find procedure. This Procedure retrieves a specific record from the database. All Table Modules should have a default Find using the table's primary key to retrieve data. Other finds may be necessary, but they will all look the same only the passed in data and SQL Where clause need to be modified to accommodate the unique value being searched for. All Finds should retrieve only 0 or 1 Record, never multiple. When Creating Find methods you should Always Unique Fields, as ensured through the Validation Procedure. Let's take a Look at the Find Method, and then I'll walk you through it. Procedure.i Find(FighterSizeID.i, *Class.FighterSize) Protected Sql$, DBID, Result, PictureSize, *picture, BLOBSize Protected PassFail = #False Init(*Class) DBID = DB::Open(DBTYPE::#Sqlite) SetDatabaseLong(DBID, 0, FighterSizeID) Sql$ = "SELECT " Sql$ = Sql$ + "ID, " ...