blob

Primary Key - VARBINARY or BLOB or VARCHAR for UUID primary key

I am using UUID as the primary key in one of the tables. What are the pros-cons of having this field as a varchar/varbinary/blob? DB: MYSQL. TIA ...

How to reliably restore MySQL blobs

I have been backing up a MySQL database for several years with the command: mysqldump myDatabaseName -u root > myBackupFile.sql The backups have appeared to work fine... I then wanted to restore one of the backups to a different named database so I did: mysql myNewDatabaseName -u root < myBackupFile.sql I got some errors about logfi...

how to display images stored in a mysql database using PHP

I have been trying to display image from database using php but i am only getting download prompt whenever i use or click the link. what i want to do is, i want to display it on the web browser. And want to use it in tags. my code is: require_once('dbconfig.php'); $cont=mysql_connect($dbhost,$dbuser,$dbpass) or die("Error Conn...

JPA, Mysql Blob returns data too long

Hi there, I've got some byte[] fields in my entities, e.g.: @Entity public class ServicePicture implements Serializable { private static final long serialVersionUID = 2877629751219730559L; // seam-gen attributes (you should probably edit these) @Id @GeneratedValue private Long id; private String description; ...

How to insert xml into Mysql?

Hi, this questions looks really easy but I'm a noob in C++ and MySQL so it still doesn't work. Here is the deal: I have a string (_bstr_t) that contains the xml and I want to store it in a longblolb column in MySql. Ways I tried that failed: write my xml on a local file and use mysql command LOAD_FILE, this worked localy but not on...

filesize from a String

hello! how can i get the "filesize" from a string in php? I put the string in a mysql database as a blob and i need to store the size of the blob. My solution was to create a temp file and put the string into the temp file. now i can get the filesize from the "string". but that solution is not good... greetings ...

Read Oracle BLOB data as chunks.

Hi, I have the following queries on fetching a BLOB data from Oracle ( I am trying to use OracleDataReader - .Net to read the BLOB value.): Is it possible to read a BLOB data on Oracle database as chunks without loading the entire BLOB on to server memory? I believe OracleDataReader.GetBytes() will load the entire blob on server memory....

PHP MySQL: Saving PDF to Database

I am generating PDFs with TCPDF, I want to save the generated pdf as blob in a MySQL db. What data should I save to the db? Code for PDF page <?php require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); //...

Faking thermal image camera with aforge or any other .net solution , emgucv, tbeta..

I am simulating a thermal camera effect. I have a webcam at a party pointed at people in front of a wall. I went with background subtraction technique and using Aforge blobcounter I get blobs that I want to fill with gradient coloring. My problem = GetBlobsEdgePoints doesn't return sorted point cloud so I can't use it with, for example, ...

filtering out other files, respecting renames

I've got a repository that effectively contains a bunch of different modules. I'd like to split it out into separate repositories, keeping the version history of the files in those repositories. A simple approach to this problem would just involve cloning the repo and then doing something like git filter-branch \ --tree-filter $'f...

jpql don't load Blob

Hi, I have an entity @Entity @NamedQueries({ @NamedQuery(name = "Item.findAll", query = "select i from Item i"), }) public class Item implements Serializable, WithId, WithNameDescription { @Lob byte[] photo; @OneToOne(cascade = CascadeType.ALL, orphanRemoval = true) TextualInfo english = new TextualInfo(); // more e...

How to unset BLOB with php/mysql?

Cuz, I did it unintentionally. After reading wikipedia I understand the "binary large object" is for large media files, and I'm not saving a media file. So how does data get stored this way? What's wrong with this setup to display text as BLOB in phpmyadmin? the MySql field from phpmyadmin, Field = 'first_name' Type = text Collation...

Zip HTML/PDF, store as Blob

I have a variable which contains the html content, $html and a variable with the pdf content $pdf. I can create zip files by using $zip->addFile($file,$file); where $file is a file on the disk However, I want to create zip files with content from the variables, without having to write them to disk first. How do I do it? I am already s...

Insert BLOB into MS SQL DB using Perl script

Hi all, Please excuse my ignorance of Perl, as I'm a .NET developer (I can hear you all spitting and cursing already ;¬) ) We have a requirment to insert a BLOB (+ some other data) to an MS-SQL DB using a Perl script (our backend systems run on AIX using Perl scripts to go about thier daily business). Our Perl guy, seemingly, ran int...

Blob object for python (ctypes), C++

Hallo! I want a blob object which I can pass around in python and from time to time give it to a C++ function to write to. ctypes seems the way to go but I have problem with the python standard functions. For example: >>> import ctypes >>> T=ctypes.c_byte * 1000 >>> blob = T() >>> ctypes.pointer(blob) <__main__.LP_c_byte_Array_1000 o...

Saving images from an sqlite table

I have an sqlite table w/ 500 records each with images stored as blob data. The images are all large size and I need to make thumbnail sized versions of each image and then save them in a separate field. Does anyone know what would be the optimum way of approaching this task? One other question - is it recommended to have a separate ta...

How to read files into existing rows LOB columns in Oracle?

I have to migrate data from one database to another. As preparation we have already extracted CLOB and BLOB data into separate files located on the Oracle server. The database contains several CLOB and BLOB columns in different tables that have been initialized with NULL values for all those rows. How can I load the content of a file in...

Appending to Informix BLOB without running out of memory

Hi SO, I'm writing a c# app that inserts a large (1GB+) amount of data into a BLOB in an informix database. However, many times the file is too large and the process runs out of memory. I have implemented the WCF Chunking Channel to mitigate this, but I need to put these chunks into the BLOB without consuming memory to store them all....

When trying to select a column of type BLOB, SQLStatement throws a RangeError #2006: The supplied index is out of bounds.

var imageData:ByteArray = new ByteArray(); var headshotStatement:SQLStatement = new SQLStatement(); headshotStatement.sqlConnection = dbConnection; var headshotStr:String = "SELECT headshot FROM ac_images WHERE id = " + idx; headshotStatement.text = headshotStr; headshotStatement.execute(); Error references the final line in this block...

dump xml string verbatim to mysql db

Hi everyone, I need to dump an xml string (coming into a web service as a POST param), directly into a Mysql DB. The column into which I am writing is currently of type 'text', though I have tried blob as well. Right now, when I save the string and retrieve it later on using sql, it comes back in a serialized like format, like this: a:...