Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQLite and Instr problem
SQLite and Instr problem [message #43885] Fri, 14 November 2014 08:46 Go to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi,

I've got problem with sql query using instr function with SQLite. Code below create ASSERT but SQL query working fine. Is Instr function supported in U++?

Table:
TABLE_(STMTRNFILTER)
	INT64_  (FILTER_ID) PRIMARY_KEY AUTO_INCREMENT
	STRING_ (FILTER_MEMO_FROM, 255)
	INT64_  (FILTER_FK_ACCOUNT_ID_FROM) SQLDEFAULT(0)
END_TABLE


SQL query:
select FILTER_ID from STMTRNFILTER where INSTR('Test string', FILTER_MEMO_FROM) > 0) or FILTER_FK_ACCOUNT_ID_FROM == -1


Code:
Sql sql;
sql * Select(FILTER_ID).From(STMTRNFILTER).Where((Instr(memo, FILTER_MEMO_FROM) > 0) || (FILTER_FK_ACCOUNT_ID_FROM == account_id));


ASSERT:
ERROR no such function: INSTR(0): Preparing: select FILTER_ID from STMTRNFILTER where INSTR('Test string', FILTER_MEMO_FROM) > 0 or FILTER_FK_ACCOUNT_ID_FROM = -1
****************** ASSERT FAILED: Assertion failed in /home/malcirad/upp/uppsrc/plugin/sqlite3/Sqlite3upp.cpp, line 257
NULL != current_stmt


Thanks, Radek
Re: SQLite and Instr problem [message #43887 is a reply to message #43885] Fri, 14 November 2014 15:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13995
Registered: November 2005
Ultimate Member
The problem was that sqlite3 version in U++ did not have INSTR. I have now updated plugin/sqlite3 to latest version, it seems to work fine now.

Mirek
Re: SQLite and Instr problem [message #43918 is a reply to message #43885] Tue, 18 November 2014 11:48 Go to previous message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Thank you, it works now.
Previous Topic: Firebird - Update
Next Topic: Firebird Database integration
Goto Forum:
  


Current Time: Sun Jul 21 19:36:10 CEST 2024

Total time taken to generate the page: 0.02405 seconds