From 57c7da835f8d80c4bd6f2743c5880e08d32805f0 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 29 May 2024 06:10:59 +0000 Subject: [PATCH] adding git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@136 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Library/exec.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/exec.c b/Library/exec.c index d38fc7f..508b517 100644 --- a/Library/exec.c +++ b/Library/exec.c @@ -221,13 +221,14 @@ struct dataworks_db_result* __dataworks_database_execute_code(struct dataworks_d r->error = true; r->errnum = DW_ERR_EXEC_INSUFFICIENT_ARGUMENTS; } else { - double dn = 123123; - int64_t in = 123123; - void* data[3]; - data[0] = "dataworks"; - data[1] = &dn; - data[2] = ∈ - struct dataworks_db_result* dbr = dataworks_database_insert_record(db, data, "SSS"); + char* f = dataworks_database_get_table_field_types(db, db->name); + void** data = malloc(sizeof(*data) * strlen(f)); + char* fields = malloc(sizeof(*data) * (strlen(f) + 1)); + for(j = 0; f[j] != 0; j++) fields[j] = 'U'; + fields[strlen(f)] = 0; + for(j = 0; f[j] != 0; j++) data[j] = ""; + free(f); + struct dataworks_db_result* dbr = dataworks_database_insert_record(db, data, fields); if(dbr->error) { r->error = true; r->errnum = dbr->errnum; -- 2.43.0