Table of Contents
SQL Style Examples
This section contains examples that demonstrate how to control Valentina database using SQL commands. Many examples in this section have a satellite - example in the section API Examples.
SQL Binding Example
Demonstrates how to use SQL query with binded parameters. You will see:
- how it works with SqlExecute() and SqlSelect().
- how to use SQL92 standard syntax with ‘?‘.
- how to use non-standard syntax “:n“.
- how to mix both syntaxes (not recommended although).
Field_Constraints Example
Demonstrates how to use field constraints.
Field_CreateDrop Example
Demonstrates how to create in Table different Field types using SQL command CREATE TABLE and how to drop a field in the table using ALTER TABLE DROP FIELD command.
Field_Picture Example
Demonstrates how to work with Picture field via VCursor.
ImportExport Example
Demonstrates how to Import/Export into the text file using VCursor ImportText() and ExportText() methods.
IndexByWords Example
Demonstrates how to use index by words feature of Valentina with SQL way. It shows different kinds of searches for string: Start with, Contains, End With…
MethodCreate Example
Demonstrates how to create Table Method (a.k.a Calcualted Field) using SQL.
RecordLocks Example
Demonstrates how to work with record locks when you use VCursor class.
Records_AddDeleteUpdate Example
Demonstrates how to
- add records using INSERT command.
- delete records using DELETE WHERE command.
- update records using UPDATE WHERE command.
Table_Alter Example
Demonstrates different features of ALTER TABLE command:
- Add field
- Drop field
- Rename field
- Change field length
- Change field type
- Rename Table.
Table_CreateDrop Example
Demonstrates how to create and drop table using SQL commands CREATE TABLE and DROP TABLE.
Text_Compressed Example
Demonstrates the using of ZIP compression for TEXT (BLOB) field.