Inserting tag data into a database

How can I write tag data to a database. Not sure how to setup parameters. Query below works with sample data but I want to use tag data

Insert into HWS_Status
('CC3400','yes','1') – using this as a test value…….

Read the tag values with system.tag.readBlocking(). Extract the list of values from the returned list of QualifiedValues. Supply them as parameters in a call to system.db.runPrepUpdate(). Something like this:

tagPaths = ["[default]path/to/folder/%s" % tagname for tagname in ['PN', 'LR', 'REC']]
insertSQL = """
Insert into HWS_Status (part_number, line_running, record)
Values (?, ?, ?)"""

def doInsert():
	pn, lr, rec = [x.value for x in system.tag.readBlocking(tagPaths)]
	rows_inserted = system.db.runPrepUpdate(insertSQL, [pn, lr, rec], 'MyDatasourceName')
	return rows_inserted

Thanks Phil. Do you know of an example for this or some online help? I would like to understand how this scripting works. I am new to ignition with no sql background

I highly recommend taking the Inductive University course, they go over all the main points of using Ignition