• <var id="qaci0"><label id="qaci0"></label></var>
      1. <var id="qaci0"></var>
        <table id="qaci0"><menu id="qaci0"></menu></table>
        1. <input id="qaci0"></input>

          <table id="qaci0"></table>
          <var id="qaci0"><label id="qaci0"></label></var>
          <sub id="qaci0"></sub>
        2. <var id="qaci0"><label id="qaci0"><ol id="qaci0"></ol></label></var>
          1. <table id="qaci0"><menu id="qaci0"></menu></table>

          2. <var id="qaci0"><output id="qaci0"></output></var>
            <var id="qaci0"></var>

             

            400-878-1895px51870017
            葩星1752902151 淘寶旺旺passiontechinc
            sales@www.xpj2355.com 13296027252
              加載中,請稍候...
            瀏覽歷史

             


            C程序樣例用SQL

            關鍵詞: ,C程序樣例用SQL


            簡介:1.ExamplesThe following example program demonstrates how to create an empty database, insert data, and perform an indexed search with direct table access:Example1.C Example Program with SQL/**************************************************************************//* *//* Copyright (c) 2005-2012 by ITTIA L.L.C. All rights reserved. *//* ...
            品 牌
            產 地
            型 號 PXF2640
            折 扣
            咨詢專家:

            產品說明:

             

            1. Examples

            The following example program demonstrates how to create an empty database, insert data, and perform an indexed search with direct table access:

            Example 1. C Example Program with SQL

            /**************************************************************************/
            /*                                                                        */
            /*      Copyright (c) 2005-2012 by ITTIA L.L.C. All rights reserved.      */
            /*                                                                        */
            /*  This software is copyrighted by and is the sole property of ITTIA     */
            /*  L.L.C.  All rights, title, ownership, or 其他 interests in the       */
            /*  software remain the property of ITTIA L.L.C.  This software may only  */
            /*  be used in accordance with the corresponding license agreement.  Any  */
            /*  unauthorized use, duplication, transmission, distribution, or         */
            /*  disclosure of this software is expressly forbidden.                   */
            /*                                                                        */
            /*  This Copyright notice may not be removed or modified without prior    */
            /*  written consent of ITTIA L.L.C.                                       */
            /*                                                                        */
            /*  ITTIA L.L.C. reserves the right to modify this software without       */
            /*  notice.                                                               */
            /*                                                                        */
            /*  info@ittia.com                                                        */
            /*  http://www.ittia.com                                                  */
            /*                                                                        */
            /*                                                                        */
            /**************************************************************************/
            
            #include <ittia/db.h>
            #include <stdio.h>
            #include <stdlib.h>
            #include <string.h>
            
            
            #define MAX_MESSAGE_LENRL-GTH 15
            #define TABLE_NAME "Hello_World"
            #define INDEX_NAME "by_id"
            
            #define MESSAGE_ID    0
            #define MESSAGE       1
            
            void hello_world()
            {
                db_t                hdb;
                db_row_t            row;
                db_cursor_t         table;
                db_cursor_t         query;
                char                message[MAX_MESSAGE_LENRL-GTH+1];
                uint32_t            message_id;
            
                /*-----------------------------------------------------------------------
                 * Define the Hello_World table fields
                 *---------------------------------------------------------------------*/
                static db_fielddef_t hello_world_fields[] =
                {
                    { MESSAGE_ID, "id", DB_COLTYPE_UINT32, 0, 0, DB_NOT_NULL },
                    { MESSAGE, "message", DB_COLTYPE_ANSISTR, MAX_MESSAGE_LENRL-GTH }
                };
                /*-----------------------------------------------------------------------
                 * Define the primary key index
                 *---------------------------------------------------------------------*/
                static db_indexfield_t message_by_id_field[] =
                {
                    { MESSAGE_ID }
                };
                static db_indexdef_t hello_world_index[] =
                {
                    {
                        DB_ALLOC_INITIALIZER(),
                        DB_INDEXTYPE_DEFAULT,
                        INDEX_NAME,
                        DB_PRIMARY_INDEX,
                        1,
                        message_by_id_field
                    }
                };
                /*-----------------------------------------------------------------------
                 * Define the Hello_World table: combine fields and index
                 *---------------------------------------------------------------------*/
                db_tabledef_t hello_world_table =
                {
                    DB_ALLOC_INITIALIZER(),
                    DB_TABLETYPE_DEFAULT,
                    TABLE_NAME,
                    2,
                    hello_world_fields,
                    1,
                    hello_world_index,
                    0,
                    NULL
                };
                /*-----------------------------------------------------------------------
                 * Bind the database fields to local variables
                 *---------------------------------------------------------------------*/
                const db_bind_t row_def[] =
                {
                    DB_BIND_VAR(MESSAGE_ID, DB_VARTYPE_UINT32, message_id),
                    DB_BIND_STR(MESSAGE, DB_VARTYPE_ANSISTR, message),
                };
            
                /*-----------------------------------------------------------------------
                 * Create the Hello World database file
                 *---------------------------------------------------------------------*/
                hdb = db_create_file_storage("hello_world.ittiadb", NULL);
                if (hdb == NULL)
                {
                    printf("Unable to create database, error %d.\n", get_db_error());
                    return;
                }
            
                /*-----------------------------------------------------------------------
                 * Create the Hello_World table within the database
                 *---------------------------------------------------------------------*/
                if (db_create_table(hdb, TABLE_NAME, &hello_world_table, 0) == DB_FAIL)
                {
                    printf("Unable to create table, error %d.\n", get_db_error());
                    return;
                }
            
                /*-----------------------------------------------------------------------
                 * Create the index for the Hello World table
                 *---------------------------------------------------------------------*/
                if (db_create_index(hdb, TABLE_NAME, INDEX_NAME, &hello_world_index[0]) == DB_FAIL)
                {
                    printf("Unable to create index, error %d.\n", get_db_error());
                    return;
                }
            
                /*-----------------------------------------------------------------------
                 * Open a table cursor and prepare an SQL query for later use
                 *---------------------------------------------------------------------*/
                table = db_open_table_cursor(hdb, TABLE_NAME, NULL);
                query = db_prepare_sql_cursor(hdb, "select message from Hello_World", 0);
            
                /*-----------------------------------------------------------------------
                 * Start a transaction
                 *---------------------------------------------------------------------*/
                db_begin_tx(hdb, DB_DEFAULT_ISOLATION | DB_LOCK_SHARED);
            
                /*-----------------------------------------------------------------------
                 * Allocate a row that maps table fields to local variables.
                 *---------------------------------------------------------------------*/
                row = db_alloc_row(row_def, 2);
            
                /*-----------------------------------------------------------------------
                 * Insert "hello world" into the table.
                 *---------------------------------------------------------------------*/
                strcpy(message, "hello world");
                message_id = (uint32_t)0;
                if (db_insert(table, row, NULL, 0) == DB_FAIL) {
                    printf("Unable to insert, error %d.\n", get_db_error());
                }
            
                db_free_row(row);
            
                /*-----------------------------------------------------------------------
                 * Execute the SQL query "select message from Hello_World"
                 *---------------------------------------------------------------------*/
                db_execute(query, NULL, NULL);
            
                /*-----------------------------------------------------------------------
                 * Allocate the cursor row
                 *---------------------------------------------------------------------*/
                row = db_alloc_cursor_row(query);
            
                /*-----------------------------------------------------------------------
                 * Iterate over the rows in the query result set
                 *---------------------------------------------------------------------*/
                for (db_seek_first(query); !db_eof(query) ; db_seek_next(query))
                {
                    /*-------------------------------------------------------------------
                     * Retrieve the data from the cursor row
                     *-----------------------------------------------------------------*/
                    db_fetch(query, row, NULL);
                    db_get_field_data(row, 0, DB_VARTYPE_ANSISTR, message, sizeof(message));
                    printf(" %s \n", message);
                }
            
                db_free_row(row);
            
                /*-----------------------------------------------------------------------
                 * Commit to save 改變s and release locks
                 *---------------------------------------------------------------------*/
                db_commit_tx(hdb, DB_FORCED_COMPLETION);
            
                /*-----------------------------------------------------------------------
                 * Close cursors and the database 連接ion.
                 *---------------------------------------------------------------------*/
                db_close_cursor(table);
                db_close_cursor(query);
                db_shutdown(hdb, 0, NULL);
            }
            
            int main()
            {
                db_mem_statistics_t mem_statistics;
                db_api_statistics_t api_statistics;
                db_lm_statistics_t lm_statistics;
                db_done_t done_info =
                {
                    &mem_statistics,
                    &api_statistics,
                    &lm_statistics
                };
            
                /*-----------------------------------------------------------------------
                 * Initialize ITTIA DB SQL library
                 *---------------------------------------------------------------------*/
                db_init_ex(DB_API_VER, NULL);
            
                /*-----------------------------------------------------------------------
                 * Run the example
                 *---------------------------------------------------------------------*/
                hello_world();
            
                /*-----------------------------------------------------------------------
                 * Clean up ITTIA DB SQL library resources
                 *---------------------------------------------------------------------*/
                db_done_ex(&done_info);
            
                /*-----------------------------------------------------------------------
                 * Check for handles leaked by the application
                 *---------------------------------------------------------------------*/
                if (api_statistics.have_statistics)
                {
                    if (api_statistics.db.cur_value != 0)
                        printf("Some database 連接ion was not properly closed.\n");
                    if (api_statistics.row.cur_value != 0)
                        printf("Some row was not properly closed.\n");
                    if (api_statistics.cursor.cur_value != 0)
                        printf("Some cursor was not properly closed.\n");
                    if (api_statistics.seq.cur_value != 0)
                        printf("Some sequence was not properly closed.\n");
                    if (api_statistics.seqdef.cur_value != 0)
                        printf("Some sequence definition was not properly closed.\n");
                    if (api_statistics.tabledef.cur_value != 0)
                        printf("Some table definition was not properly closed.\n");
                    if (api_statistics.indexdef.cur_value != 0)
                        printf("Some index definition was not properly closed.\n");
                    if (api_statistics.oid.cur_value != 0)
                        printf("Some object ID was not properly closed.\n");
                }
            
                return EXIT_SUCCESS;
            }
            

             

            Example 2. C++ Example Program with Table Cursors

            /**************************************************************************/
            /*                                                                        */
            /*      Copyright (c) 2005-2012 by ITTIA L.L.C. All rights reserved.      */
            /*                                                                        */
            /*  This software is copyrighted by and is the sole property of ITTIA     */
            /*  L.L.C.  All rights, title, ownership, or 其他 interests in the       */
            /*  software remain the property of ITTIA L.L.C.  This software may only  */
            /*  be used in accordance with the corresponding license agreement.  Any  */
            /*  unauthorized use, duplication, transmission, distribution, or         */
            /*  disclosure of this software is expressly forbidden.                   */
            /*                                                                        */
            /*  This Copyright notice may not be removed or modified without prior    */
            /*  written consent of ITTIA L.L.C.                                       */
            /*                                                                        */
            /*  ITTIA L.L.C. reserves the right to modify this software without       */
            /*  notice.                                                               */
            /*                                                                        */
            /*  info@ittia.com                                                        */
            /*  http://www.ittia.com                                                  */
            /*                                                                        */
            /*                                                                        */
            /**************************************************************************/
            
            // A Hello World console program for ITTIA DB
            
            #include <ittia/db++.h>
            #include <iostream>
            
            #ifdef __embedded_cplusplus
            #define std
            #endif
            
            int main(int argc, char* argv[])
            {
                // Create an empty database.
                db::Database db;
                db::StorageMode mode;
                db.create("hello_world.db", mode);
            
                // Create a new table with two fields and one index.
                db::FieldDescSet fields;
                db::IndexDescSet indexes;
                fields.add_uint("id");
                fields.add_string("message", 50);
                indexes.add_index("by_id", db::DB_UNIQUE).add_field("id");
                db.create_table("hello_world", fields, indexes);
            
                // Open a table cursor.
                db::Table helloWorld;
                helloWorld.open(db, "hello_world");
            
                // Start a transaction before adding or accessing data.
                db.tx_begin();
            
                // Insert a row using the table cursor.
                helloWorld.insert();
                helloWorld["id"] = 0;
                helloWorld["message"] = "Hello World";
                helloWorld.post();
            
                // Search for the row that was inserted.
                helloWorld.set_sort_order("by_id");
                helloWorld.begin_seek(db::DB_SEEK_EQUAL);
                helloWorld["id"] = 0;
                if (DB_SUCCESS(helloWorld.apply_seek())) {
                    db::String message = helloWorld["message"].as_string();
                    std::cout << message.c_str() << std::endl;
                } else {
                    std::cerr << "Could not find row." << std::endl;
                }
            
                // Save 改變s to the database file.
                db.tx_commit();
            
                // Clean up.
                helloWorld.close();
                db.close();
             
                return 0;
            }
            

             

            The following example shows how the previous example can be written using SQL.

            Example 3. C++ Example Program with SQL

            /**************************************************************************/
            /*                                                                        */
            /*      Copyright (c) 2005-2012 by ITTIA L.L.C. All rights reserved.      */
            /*                                                                        */
            /*  This software is copyrighted by and is the sole property of ITTIA     */
            /*  L.L.C.  All rights, title, ownership, or 其他 interests in the       */
            /*  software remain the property of ITTIA L.L.C.  This software may only  */
            /*  be used in accordance with the corresponding license agreement.  Any  */
            /*  unauthorized use, duplication, transmission, distribution, or         */
            /*  disclosure of this software is expressly forbidden.                   */
            /*                                                                        */
            /*  This Copyright notice may not be removed or modified without prior    */
            /*  written consent of ITTIA L.L.C.                                       */
            /*                                                                        */
            /*  ITTIA L.L.C. reserves the right to modify this software without       */
            /*  notice.                                                               */
            /*                                                                        */
            /*  info@ittia.com                                                        */
            /*  http://www.ittia.com                                                  */
            /*                                                                        */
            /*                                                                        */
            /**************************************************************************/
            
            // A Hello World console program for ITTIA DB
            
            #include <ittia/db++.h>
            #include <iostream>
            
            using namespace db;
            #ifndef __embedded_cplusplus
            using namespace std;
            #endif
            
            int main(int argc, char* argv[])
            {
                // Create a Database handle.
                Database db;
                StorageMode mode;
            
                // Create a Query object to execute SQL statements.
                Query q;
            
                // Create a new database file using the default mode.
                db.create("hello_world.db", mode);
                int rc;
            
                // Create hello_world table using the Query object.
                if(!DB_SUCCESS(q.exec_direct(db,
                    "create table hello_world"
                    "  (id integer, message varchar(20))")))
                {
                    cout << "Unable to create table.\n";
                    return 1;
                }
            
                // Start a transaction prior to modifying the hello_world table.
                if(!DB_SUCCESS(q.exec_direct(db,
                    "start transaction")))
                {
                    cout << "Unable to insert values into table.\n";
                    return 1;
                }
            
                // Insert 'hello world' message into the table.
                if(!DB_SUCCESS(q.exec_direct(db,
                    "insert into hello_world values(0, 'hello world')")))
                {
                    cout << "Unable to insert values into table.\n";
                    return 1;
                }
            
                // Select the message that was just inserted.
                if(!DB_SUCCESS(q.exec_direct(db,
                    "select message from hello_world where id = 0")))
                {
                    cout << "Unable to select from table.\n";
                    return 1;
                }
            
                // Print query result.
                StringField message(q, "message");
                for (rc = q.seek_first();
                     DB_SUCCESS(rc) && !q.is_eof();
                     rc = q.seek_next())
                {
                    cout << String(message).c_str() << endl;
                }
            
                // Save 改變s to the database file.
                q.exec_direct(db, "commit");
            
                // Clean up.
                q.close();
                db.close();
            
                return 0;
            }
            

             

            Example 4. ADO.NET TableEditor Example Form

            using System;
            using System.Collections.Generic;
            using System.ComponentModel;
            using System.Data;
            using System.Drawing;
            using System.Text;
            using System.Windows.Forms;
            using Ittia.IttiaDb;
            
            namespace TableEditor
            {
                public partial class TableEditor : Form
                {
                    IttiaDbConnection 連接ion = new IttiaDbConnection("Database=test.db;Create=true");
            
                    public TableEditor()
                    {
                        InitializeComponent();
            
                        連接ion.Open();
                        if (CreateTables())
                        {
                            // Add a few rows when the table is first created.
                            InsertSampleRows();
                        }
                        InitAdapter();
                    }
            
                    /// <summary>
                    /// Create the table if it does not already exist.
                    /// </summary>
                    /// <returns>True if the table was created, or false if it already exists.</returns>
                    private bool CreateTables()
                    {
                        using (IttiaDbCommand
                            createTable = new IttiaDbCommand("create table person (id integer not null, name varchar(20), birthday date)", 連接ion),
                            createIndex = new IttiaDbCommand("create unique index id on person (id)", 連接ion)
                            )
                        {
                            try
                            {
                                createTable.ExecuteNonQuery();
                                createIndex.ExecuteNonQuery();
                                return true;
                            }
                            catch (IttiaDbException ex)
                            {
                                if (ex.ErrorCode == -100)
                                    return false;
                                else
                                    throw ex;
                            }
                        }
                    }
            
                    /// <summary>
                    /// Initialize the DataAdapter
                    /// </summary>
                    private void InitAdapter()
                    {
                        adapter.SelectCommand = new IttiaDbCommand("select id, name, birthday from person", 連接ion);
            
                        adapter.InsertCommand = new IttiaDbCommand("insert into person (id, name, birthday) values (?, ?, ?)", 連接ion);
                        adapter.InsertCommand.Parameters.Add(null, DbType.Int32, "id");
                        adapter.InsertCommand.Parameters.Add(null, DbType.String, "name");
                        adapter.InsertCommand.Parameters.Add(null, DbType.Date, "birthday");
            
                        adapter.UpdateCommand = new IttiaDbCommand("update person set id = ?, name = ?, birthday = ? where id = ?", 連接ion);
                        adapter.UpdateCommand.Parameters.Add(null, DbType.Int32, "id");
                        adapter.UpdateCommand.Parameters.Add(null, DbType.String, "name");
                        adapter.UpdateCommand.Parameters.Add(null, DbType.Date, "birthday");
                        adapter.UpdateCommand.Parameters.Add(new IttiaDbParameter(null, DbType.Int32, 0, ParameterDirection.Input, false, 0, 0, "id", DataRowVersion.Original, null));
            
                        adapter.DeleteCommand = new IttiaDbCommand("delete from person where id = ?", 連接ion);
                        adapter.DeleteCommand.Parameters.Add(new IttiaDbParameter(null, DbType.Int32, 0, ParameterDirection.Input, false, 0, 0, "id", DataRowVersion.Original, null));
                    }
            
                    void InsertSampleRows()
                    {
                        using (IttiaDbCommand command = new IttiaDbCommand("insert into person (id, name, birthday) values (?, ?, ?)", 連接ion))
                        {
                            System.Data.Common.DbParameter idParam = command.CreateParameter();
                            System.Data.Common.DbParameter nameParam = command.CreateParameter();
                            System.Data.Common.DbParameter birthdayParam = command.CreateParameter();
                            command.Parameters.Add(idParam);
                            command.Parameters.Add(nameParam);
                            command.Parameters.Add(birthdayParam);
            
                            idParam.Value = 1;
                            nameParam.Value = "Test1";
                            birthdayParam.Value = DateTime.Today.AddYears(-30);
                            command.ExecuteNonQuery();
            
                            idParam.Value = 2;
                            nameParam.Value = "Test2";
                            birthdayParam.Value = DateTime.Today.AddYears(-25).AddDays(42);
                            command.ExecuteNonQuery();
                        }
                    }
            
                    /// <summary>
                    /// Load data from the database into the DataGridView.
                    /// </summary>
                    private void loadButton_Click(object sender, EventArgs e)
                    {
                        try
                        {
                            DataTable dataTable = new DataTable();
            
                            adapter.Fill(dataTable);
            
                            dataGridView.DataSource = dataTable;
                        }
                        catch (IttiaDbException ex)
                        {
                            errorProvider.SetError(dataGridView, ex.Message);
                        }
                    }
            
                    /// <summary>
                    /// Save data from the DataGridView into the database.
                    /// </summary>
                    private void saveButton_Click(object sender, EventArgs e)
                    {
                        try
                        {
                            if (dataGridView.DataSource != null)
                                adapter.Update((DataTable)dataGridView.DataSource);
                        }
                        catch (IttiaDbException ex)
                        {
                            errorProvider.SetError(dataGridView, ex.Message);
                        }
                    }
            
                    /// <summary>
                    /// Save automatically when the form is closed.
                    /// </summary>
                    private void TableEditor_FormClosing(object sender, FormClosingEventArgs e)
                    {
                        saveButton_Click(sender, e);
                    }
            
                    private void dataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
                    {
                        if (e.Exception is FormatException)
                        {
                            if (dataGridView.Columns[e.ColumnIndex].DataPropertyName == "ID")
                                toolStripStatusLabel.Text = "Please enter a number, or press escape to cancel.";
                            else if (dataGridView.Columns[e.ColumnIndex].DataPropertyName == "BIRTHDAY")
                                toolStripStatusLabel.Text = "Please enter a date, or press escape to cancel.";
                            else
                                toolStripStatusLabel.Text = e.Exception.Message;
                            e.ThrowException = false;
                        }
                    }
            
                    private void dataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)
                    {
                        toolStripStatusLabel.Text = "";
                    }
                }
            }

             

            Example 5. Java Example Application

            package com.example.ittiadb;
            
            import com.ittia.db.*;
            
            /**
             * Demonstrates how to create a new ITTIA DB-SQL database file
             * and insert and read data.
             */
            public class Simple {
                static {
                    // Load ITTIA DB-SQL native JNI library
                    System.loadLibrary("ittiajni");
                }
                
                public static void main(String[] args) {
                    Database db = new Database();
                    
                    // Create a new database file in the current directory
                    db.create("test.db");
                    
                    // Create a table
                    // For best support in Java, always use the utf8str or utf16str
                    // database types for a string column.
                    db.prepare("create table x (a integer, b utf16str(100))").execute();
                    
                    // Insert a few rows and commit the transaction to make the
                    // 改變s persistent and recoverable.
                    db.prepare("insert into x values (1, 'Hello World')").execute();
                    db.prepare("insert into x values (2, 'Goodbye Galaxy')").execute();
                    db.commitTransaction();
                    
                    // Open the table for unsorted access to all rows.
                    Cursor tableX = db.openTable("x");
                    Row row = tableX.createRow();
                    int x_a = tableX.findField("a");
                    int x_b = tableX.findField("b");
                    
                    // Advance cursor to the first row and fetch into a Row object.
                    tableX.seekFirst();
                    tableX.fetchRow(row);
                    
                    // The row is now formatted according to the layout of table "x".
                    // It contains two columns:
                    //   - 0: an integer
                    //   - 1: a string
                    System.out.println(row.getInt(x_a));     // 1
                    System.out.println(row.getString(x_b));  // Hello World
                    
                    // Read the next row in the table. Using the same row object
                    // improves performance by re-using the same column layout.
                    tableX.seekNext();
                    tableX.fetchRow(row);
                    System.out.println(row.getInt(x_a));     // 2
                    System.out.println(row.getString(x_b));  // Goodbye Galaxy
                    
                    // When the cursor is advanced past the last row, eof (end-of-file)
                    // 改變s from 0 to 1.
                    System.out.println(tableX.isEnd());  // 0
                    tableX.seekNext();
                    System.out.println(tableX.isEnd());  // 1
            
                    // Prepare and execute a SQL select query
                    Cursor query = db.prepare("select b from x");
                    query.execute();
                    
                    // Advance cursor to the first result.
                    query.seekFirst();
                    
                    // Create a new row with fields for the column layout of the query.
                    row = query.createRow();
                    query.fetchRow(row);
            
                    // The row is now formatted according to the SQL query. It
                    // contains one column:
                    //   - 0: a string
                    System.out.println(row.getString(0));  // Hello World
            
                    // Close the database.
                    db.close();
            
                    // Row objects are self-contained. Even after the database
                    // has been closed, the row retains its value.
                    System.out.println(row.getString(0));  // Hello World
                }
            }
            

             

            Example 6. LuaSQL Example Script

            -- load driver
            require "luasql.ittiadb"
            -- create environment object
            env = assert (luasql.ittiadb())
            -- 連接 to data source
            con = assert (env:連接("luasql-test"))
            -- reset our table
            res = con:execute"DROP TABLE people"
            res = assert (con:execute[[
              CREATE TABLE people(
                name  varchar(50),
                email varchar(50)
              )
            ]])
            -- add a few elements
            list = {
              { name="Jose das Couves", email="jose@couves.com", },
              { name="Manoel Joaquim", email="manoel.joaquim@cafundo.com", },
              { name="Maria das Dores", email="maria@dores.com", },
            }
            for i, p in pairs (list) do
              res = assert (con:execute(string.format([[
                INSERT INTO people
                VALUES ('%s', '%s')]], p.name, p.email)
              ))
            end
            -- retrieve a cursor
            cur = assert (con:execute"SELECT name, email from people")
            -- print all rows, the rows will be indexed by field names
            row = cur:fetch ({}, "a")
            while row do
              print(string.format("Name: %s, E-mail: %s", row.name, row.email))
              -- reusing the table of results
              row = cur:fetch (row, "a")
            end
            -- close everything
            cur:close()
            con:close()
            env:close()
            

             

            Example 7. Python 3 Example Script

            #!/usr/bin/env python3
            import ittiadb
            
            db = ittiadb.Database()
            
            # Create a new database file in the current directory
            if not db.create("test.db"):
            	error = ittiadb.dbs_get_error_info()
            	print(error.name, error.code, error.description)
            	exit()
            
            # Create a table
            db.prepare("create table x (a integer, b utf16str(100))").execute()
            
            # Insert a few rows and commit the transaction to make the
            # 改變s persistent and recoverable.
            db.prepare("insert into x values (1, 'Hello World')").execute()
            db.prepare("insert into x values (2, 'Goodbye Galaxy')").execute()
            db.commit_tx()
            
            # Open the table for unsorted access to all rows.
            tableX = db.open_table("x")
            row = tableX.create_row()
            x_a = tableX.find_field("a")
            x_b = tableX.find_field("b")
            
            # Advance cursor to the first row and fetch into a Row object.
            tableX.seek_first()
            tableX.fetch_row(row)
            
            # The row is now formatted according to the layout of table "x".
            # It contains two columns:
            #   - 0: an integer
            #   - 1: a string
            print(row.get_int32(x_a)[1])     # 1
            print(row.get_unicode(x_b)[1])      # Hello World
            
            # Read the next row in the table. Using the same row object
            # improves performance by re-using the same column layout.
            tableX.seek_next()
            tableX.fetch_row(row)
            print(row.get_int32(x_a)[1])    # 2
            print(row.get_unicode(x_b)[1])     # Goodbye Galaxy
            
            # When the cursor is advanced past the last row, isEnd()
            # 改變s from 0 to 1.
            print(tableX.eof())  # 0
            tableX.seek_next()
            print(tableX.eof())  # 1
            
            # Prepare and execute a SQL select query
            query = db.prepare("select b from x")
            query.execute()
            
            # Advance cursor to the first result.
            query.seek_first()
            
            # Create a new row with fields for the column layout of the query.
            row = query.create_row()
            query.fetch_row(row)
            
            # The row is now formatted according to the SQL query. It
            # contains one column:
            #   - 0: a string
            print(row.get_unicode(0)[1])  # Hello World
            
            # Close the database.
            db.close()
            
            # Row objects are self-contained. Even after the database
            # has been closed, the row retains its value.
            print(row.get_unicode(0)[1])  # Hello World
            
            
            row.close()
            
            
            參數資料:
            C程序樣例用SQL,C程序樣例用SQL
            該文章系原廠商文章翻譯,不通之處請參考原文
            價格列表: C程序樣例用SQL,C程序樣例用SQL
            葩星訂貨號 訂貨號 產品名稱 報價 品牌  
            相關產品: C程序樣例用SQL,C程序樣例用SQL
              咨詢歷史:
            2021亚洲精品1卡2卡3卡,国色天香一卡二卡二卡四卡,国产卡一卡二卡三卡四卡视频,一卡二卡三卡四卡无卡免费播放在线观看日本,精品一卡二卡三卡四卡视频版 99久久国产综合精品女| 亚洲lav无码片一区二区三区| 狠狠五月深爱婷婷网| 日本学生与黑人XXXX视频| 秋霞电影网在线观看免费理论片| 大龄熟妇特黄A片| 海豹突击队| 成年奭片免费观看午夜| 免费A级毛片无码樱桃视频| 国产同性男男gv片观看网站| 丁香五月天亚洲综合4438网| 性饥渴寡妇肉乱免费视频| AV剧情麻豆映画国产在线观看| 特级毛片打开直接看| 欧美人与动人物ZOZO在线| 亚洲久久超碰无码色中文字幕| 亚洲 欧美 日韩 国产 在线| 免费男女夜夜怕怕怕视频 | 97色在色在线播放免费| 无敌神马在线观看2021做啥能挣钱| 68日本XXXXXXXXX202| 芊芊免费视频网站在线看| 日日拍夜夜嗷嗷叫国产| 新婚娇妻被黑人大肉在线观看| 亚洲春色AV无码专区| 国色天香小说在线阅读全文| 真实已婚同事露脸| 日本入室强伦姧BD在线观看| 国产亚洲国产AV网站在线| 亚洲乱亚洲乱妇无码| 日本无码av不卡一区二区| 插插综合| 国产成人精品精品日本亚洲| 国色天香精品一卡二卡三卡四卡| 亚洲AV片不卡无码电影| 免费观看美女裸体的网站| 尹人香蕉久久99天天拍| 免费女同性AV网站| 被强奷到舒服的视频的集数| 国产裸体舞在线播放| 48熟女高潮嗷嗷叫| 一本大道无码日韩精品视频| 大学生第一次破女处视频| 名女躁b久久天天躁| 旧里番扶肉人妻寝取| 亚洲色欧美色2019在线| 美女被强奷到高潮视频免费| 免费观看18禁的APP| 狠狠色狠狠色综合| 清纯制服学生被啪啪AV| 日本久一卡二卡三卡| 无码AV天天AV天天爽| 高清学生破外女视频全过程| 野战小树林大屁股少妇| 小可爱学生VIDEO色| 明星换脸精品AV在线观看| 欧美大尺度做爰片姿势| 啦啦啦视频在线播放免费| 天天影视涩香欲综合网| 在厨房被夫上司强迫中文| 日本卡一卡二卡三卡四免费高清| | 男女爱爱好爽视频免费| 大尺度18禁污污啪啪| 国产小屁孩CAO大人| 国产成人AV在线免播放观看更新| 棚户区嫖妓全部过程| 日本无码电影| 小舞白丝袜喷水视频| 思思久久96热在精品国产| 99精品视频69V精品视频| 国产精品亚洲А∨天堂免下载| 日韩午夜的免费理论片| 成年片免费红杏视频网站| 狠狠做五月爱婷婷综合| 不可以,太大了,会坏掉了视频| 无敌影院视频在线播放 视频| 不可以,太大了,会坏掉了视频| 扒开美女屁股直流白浆| 啦啦啦视频播放在线观看www| 欧美另类69XXXXX| 暖暖视频在线观看中文| ASS白嫩白嫩的PIC| 特级欧美成人性A片| 分腿被绑用振动器折磨| 东北中年夫妇白天自拍破解| 年轻的小痍子3免费观看| 无码专区手机在线观看| 欧美熟乱第1页| 床震吻胸吃胸视频大全| 高清性欧美暴力猛交BD| JAPANESE日本偷拍厕所小便| 美女MM131爽爽爽作爱视频 | 抖音短视频| 高潮胡言乱语对白刺激国产| 国产Av欧美Av亚韩Av| 美女自卫慰流白浆视频在线| 强睡年轻的女老板中文字幕| 国色天香莫小鱼小说全文免费阅读| 又粗又深又猛又爽的视频| 成片人免费观看A片| 少妇人妻无码专区在线视频| 中美日韩毛片免费观看| 啦啦啦啦啦啦啦视频在线观看韩国| 男人放进女人阳道免费12视频| 中文字幕无码免费久久99| PKF女尸STUDIOSXX女子FREE| 亚洲国产一区二区三区在线观看| yellow中文字幕官网是| 国产 有码 无码 中文 制服| 日本高清熟妇老熟妇| 国产亚洲日韩一区二区三区| 无码不卡中文字幕在线观看| 男同A片特黄高清A片免费| 1卡2卡3卡4卡最新地址| 性夜影院性夜在线观看完整版| 美女脱裤子亲胸揉胸膜下刺激视频| 2020日本高清电影资源分享| YY9999亚洲久久无码| 97SE综合亚洲影院| 抖音视频在线看| 欧美5~12牲交| 久久99精品久久久久久不卡| 曰批视频免费40分钟| 亚洲 欧美 国产 制服 动漫| 暖暖的在线观看日本| 国产Av欧美Av亚韩Av| 嫖妓大龄熟妇在线播放| 无遮挡H肉动漫在线观看免费| 古巴大肥女SSBBW| 成人一卡二卡三卡四卡视频| 乱色| 午夜免费啪视频在线观看男女| 漂亮人妻中文字幕丝袜| 一卡二卡三卡四卡每日更新在线观看| 久青草无码视频在线观看| 从后面玩弄极品身材大屁股| A网站在线观看免费| 天堂mv手机在线mv观看| 超碰人人| 国产丝袜免费视频网址 | 东北老女人卖婬| 国色天香社区在线观看免费| 多人强伦姧在线观看| 无遮爆乳喷汁无遮掩动漫漫画| 太粗硬小寡妇受不了| 欧美大尺度又粗又长真做禁片| 在线观看热码亚洲AV每日更新| 琪琪亚洲国产在线2020最新| 美女禁处被爆桶漫画| 2020年日本高清一卡二卡三卡四卡在线| 小草免费视频播放| 欧洲日韩亚洲无线在码| 乱无码伦视频在线观看| 十分钟免费观看视频韩国| 性无码专区性盈盈影院| 欧美黑人暴力深喉囗交| 国产乱理伦片在线观看夜| 香蕉久久久久久AV综合网成人| 自拍偷在线精品自拍偷| 第一次进去全过程视频| 波多野结衣电影| 欧美不卡无线在线一二三区观| 久久永久免费人妻精品|