SQLite Forum

select match though row does not exists
Login
now: ( int = c - 'A' not precisely what ord() chr() would do. merely the 'A'-offset)
snprintf(q,127,"select x from achse where e=%d and i=%d and c=%d;",e,i,ORD(c));
this works. 

before:
snprintf(q,127,"select x from achse where e=%d and i=%d and c=\"%c\";",e,i,c);   // int e,i; char c;

check (select x from t where .. and .. and ..;) : 
 prepare
 step+
 finalize 
 returning the last rowid (>0) if there is at least one match. 
 otherwise returning 0

the select finds all (e,i,*) if c is "C".

xubuntu 18.04 ( and debian 10.3, sqlite3-version i cannot check this moment ) 
sqlite3 --version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1

new problem : 

sqlite3 x.db 
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> .schema kostenstelle
CREATE TABLE kostenstelle (
  x integer primary key -- 
, k integer unique not null --
);
sqlite> select * from kostenstelle ;
1|444
2|445
3|453
4|455
5|456
6|457
sqlite> 

// c-output 
query 'select x from kostenstelle where k=456;'
error (17/database schema has changed) 'no such column: x'
query 'insert into kostenstelle(k) values(456);'
error (19/constraint failed) 'UNIQUE constraint failed: kostenstelle.k'

obviously columns x,k exists and there is an entry.

error-message contains 
 result of sqlite3_exec() and
 sqlite3_errstr(result) and 
 sqlite3_errmsg(handle)

--
new question: when i inside one c-funktion open,exec,close the most thing works fine. when i use three functions : h=xopen() returning a handle and xexec(h), xclose(h) using it, then inside xexec() tables cannot be found. is there a difference ? 
i guess, someone has installed different versions, builds from source. i tried to uninstall everything and install debian-packages again. but still the same error. 

thanks
andreas