blob

How to store unlimited characters in Oracle 11g?

依然范特西╮ 提交于 2019-11-30 08:56:32
We have a table in Oracle 11g with a varchar2 column. We use a proprietary programming language where this column is defined as string. Maximum we can store 2000 characters (4000 bytes) in this column. Now the requirement is such that the column needs to store more than 2000 characters (in fact unlimited characters). The DBAs don't like BLOB or LONG datatypes for maintenance reasons. The solution that I can think of is to remove this column from the original table and have a separate table for this column and then store each character in a row, in order to get unlimited characters. This tble

Get size of large object in PostgreSQL query?

我怕爱的太早我们不能终老 提交于 2019-11-30 08:45:24
I would like to obtain the byte size of a blob. I am using Postgresql and would like to obtain the size using an SQL query. Something like this: SELECT sizeof(field) FROM table; Is this possible in Postgresql? Update: I have read the postgresql manual and could not find an appropriate function to calculate the file size. Also, the blob is stored as a large object. Not that I've used large objects, but looking at the docs: http://www.postgresql.org/docs/current/interactive/lo-interfaces.html#LO-TELL I think you have to use the same technique as some file system APIs require: seek to the end,

Understanding Lob segments (SYS_LOB) in oracle?

谁都会走 提交于 2019-11-30 08:20:46
Most of the tables (if not all) have a "blob" field in it. One of the table that stores the Logs of the user's action has now grown to 8 GB (about 5 million records). And our DBA has seen that this schema is now eating space exponentially. We investigated a bit and found out that there is one of the tables with (SYS_LOB) which takes around 116GB of 140GB database. Our DBA has told us that this table is related to the table that saves the logs of user actions (which is 8GB) Does anyone know what this SYS_LOB tables does? Is the actual blob saved in the table we created OR oracle actually stores

PHP: Image retrieval from MySQL Blob directly into <img> tag

心已入冬 提交于 2019-11-30 07:42:31
问题 I've stored my Images into (Medium) BLOB fields and want to retrieve them embedded within my PHP-generated web pages. When I test retrieving the stored images using header('Content-type: ' . $image['mime_type']); echo $image['file_data']; everything looks just fine. However, I have not yet found a way to retrieve the image(s) cleanly into the middle of my documents. For example, using $image = $row['file_data']; echo '<img src="data:image/jpeg;base64,'.$image['file_data'].'" alt="photo"><br>'

Access Large BLOB in Android Sqlite without Cursor

末鹿安然 提交于 2019-11-30 07:37:34
There seems to be a 1MB limit on Android's Cursor Window size which limits the ability to read BLOBs from SQLite. I know you may say we should not store BLOBs in database but by definition, BLOB is considered a Binary Large Object and if there was no need to store them in database, there was no need to implement such object type in any database engines. The 1 MB limit on the implementation of Cursor however, seems to be insufficient in almost all cases. I need to store my binary data for valid reasons in SQLite database and they are well over 1 MB. SQLite is capable of handling BLOBs perfectly

Import hex/binary data into mysql

空扰寡人 提交于 2019-11-30 07:27:07
I need to import into a mysql server (5.5) a set of large data having one field as a blob. Following the samples of SELECT INTO OUTFILE and LOAD DATA INFILE, it works [almost] fine. However, I have a problem: the generated data in the file for the BLOB has its actually binary representation. The generated file looks like this (3rd column represents the BLOB one): 1,1,"4Vÿ" 2,1,"ª»Ì" 3,1,"Ýîÿ" 4,1,"\"3" and the import works fine for this case with the following sql statement: LOAD DATA INFILE 'C:/temp/mysql/mysqldump.1.txt' INTO TABLE `test_table` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY

Upload images as BLOBs in Oracle using PHP

假如想象 提交于 2019-11-30 07:23:51
Can anyone please tell me how to store images in an oracle database as BLOBs using PHP? A working example would be nice. Thankyou. DRiFTy You first need to get the image that is being uploaded from the $_FILES #global array: $image = file_get_contents($_FILES['image_field_name']['tmp_name']); Then to insert the image in the database try this: $sql = "INSERT INTO table (id, image) VALUES(1, empty_blob()) RETURNING image INTO :image"; $result = oci_parse($connection, $sql); $blob = oci_new_descriptor($connection, OCI_D_LOB); oci_bind_by_name($result, ":image", $blob, -1, OCI_B_BLOB); oci_execute

js实现文件下载

一个人想着一个人 提交于 2019-11-30 07:11:47
var xhr = new XMLHttpRequest(); xhr.open('GET', downUrl, true);//get请求,请求地址,是否异步 xhr.responseType = "blob"; // 返回类型blob xhr.onload = function () {// 请求完成处理函数 if (this.status === 200) { var blob = this.response;// 获取返回值 var a = document.createElement('a'); // 切割下载url var splitUrl = downUrl.split("/"); console.log(splitUrl.length-1); // 获取文件下载名 a.download = splitUrl[splitUrl.length-1]; a.href=window.URL.createObjectURL(blob); a.click(); } }; // 发送ajax请求 xhr.send(); 来源: https://my.oschina.net/u/3568600/blog/3109530

Saving an image in MySQL from Java

被刻印的时光 ゝ 提交于 2019-11-30 07:02:50
问题 I am trying to save images in MySQL database from a Java swing application. I am using JFileChsoser to get the path of the image. Then after that converting the file so that it can be saved in the MySQL column which is of BLOB type. But every image I try to save does not save properly or get converted properly. Could someone tell me what I'm doing wrong over here? private void btn_choosepicActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser picchooser = new JFileChooser();

store TEXT/BLOB in same table or not?

旧城冷巷雨未停 提交于 2019-11-30 06:56:55
问题 While searching trough SO, I've found two contradicting answers (and even a comment that stated that) but no definitive answer: The problem is: is there any performance benefit, if you store a TEXT/BLOB field outside of a table? We assume: You SELECT correctly (only selection the TEXT/BLOB if required, no SELECT *) Tables are indexed properly, where it makes sense (so it's not a matter of 'if you index it') The database design doesnt really matter. This is a question to identify the MySQL