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 » How to use Sqlite BLOB type in U++ schema files?
How to use Sqlite BLOB type in U++ schema files? [message #38755] Sun, 13 January 2013 18:14 Go to next message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
How to use Sqlite BLOB type in U++ schema files?

What's the syntax?

Thanks
Re: How to use Sqlite BLOB type in U++ schema files? [message #38756 is a reply to message #38755] Sun, 13 January 2013 22:25 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

BLOB is used like String.

for example:

TABLE_ (MYTABLE)
	INT_	(ID) PRIMARY_KEY AUTO_INCREMENT
	STRING_ (NAME,100)
	BLOB_	(MYBLOB)
END_TABLE



bool Add(String name, String data)
{
	Sqlite3Session sqlite3;
	sqlite3.LogErrors(true);
	if(!sqlite3.Open(db)) {
		LOG("Can't create or open database file\n");
		return false;
	}
		
	Sql sql = sqlite3;

	S_MYTABLE row;
	
	row.NAME = n;
	row.MYBLOB = data;
	
	sql*Insert(MYTABLE)(row);
	
	return true;
	
}



Regards,
omari


regards
omari.
Re: How to use Sqlite BLOB type in U++ schema files? [message #38759 is a reply to message #38756] Mon, 14 January 2013 09:30 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
omari wrote on Sun, 13 January 2013 22:25


BLOB is used like String.

	row.NAME = n;
	row.MYBLOB = SqlBinary(data);
	
	sql*Insert(MYTABLE)(row);
}

omari


I might be wrong, but SqlBinary is necessary when you insert binary data.

Re: How to use Sqlite BLOB type in U++ schema files? [message #38782 is a reply to message #38759] Wed, 16 January 2013 23:21 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
SqlBinary applies only to SqlExp and is certainly wrong here.
Previous Topic: What do I need to download / configure to use MySql with U++?
Next Topic: How to view immediately the primary key in SqlArray
Goto Forum:
  


Current Time: Thu Mar 28 12:02:14 CET 2024

Total time taken to generate the page: 0.00772 seconds