[vtkusers] Write to database

Роман Глуховский roman_glu at mail.ru
Wed Jun 4 09:22:42 EDT 2014


 Hi all,

i try to write .mhd to my database.

std::string createQuery("CREATE TABLE IF NOT EXISTS TestAufnahmenx 
(ID int unsigned not null auto_increment primary key,
Filename varchar(255) not null unique,
Caption varchar(255) not null,
Aufnahme longblob not null)");

std::string insertQuery( "INSERT INTO TestAufnahmenx (ID, Filename, Caption, Aufnahme) 
VALUES (NULL,'home/joe/Test-Daten/test.mhd','Test',LOAD_FILE('/home/joe/Test-Daten/test.mhd'))");

it creat this table, but the command LOAD_FILE returns NULL and i get this error.

->ERROR: In /home/joe/Programme/VTK6.0.0/IO/MySQL/vtkMySQLQuery.cxx, line 588
vtkMySQLQuery (0x9fd9810): Query returned an error: Column 'Aufnahme' cannot be null
 
Can somebody tell me why it returns NULL?

Thank you for your help

Roman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140604/e950fb55/attachment.html>


More information about the vtkusers mailing list