Re: euphoria database

new topic     » goto parent     » topic index » view thread      » older message » newer message

I wrote a small test program:

Testing with "mongoose.jpg" which is a 1K file.

include std/console.e 
include std/eds.e 
include std/io.e 
 
display( "*** jpg file to use a data" ) 
	object mongoose = read_file( "mongoose.jpg" ) 
	? length(mongoose) 
 
 
display( "*** create new database or open exising database" ) 
	db_create( "foo" ) 
	db_open( "foo" ) 
 
display( "*** create new table or open exising database" ) 
	db_create_table( "jpgs" ) 
	db_select_table( "jpgs" ) 
	display( db_table_list() ) 
	display( db_table_size() ) 
 
display( "*** insert record into table" ) 
	db_insert( "one", mongoose ) 
	 
display( "*** get jpg from database and save as new file" ) 
	integer keynum = db_find_key( "one" ) 
	object jpg = db_record_data( keynum ) 
	write_file( "new_mongoose.jpg", jpg) 

This demo works for me. I end up with a copy of the original jpg.

A small test program showing what you are doing is now required.

_tom

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu