BLOB Substr
Is it possible to get substr BLOB column that stores RTF filesWhen dbms_lob.substr is used it give %valeurs hexa%
7B5C727466315C616E73695C616E7369637067313235325C64656666305C6465666C616E67313033337B5C666F6E7474626C7B5C66305C6673776973735C6663686172736574302056657264616E613B7D7B5C
When I use utl_raw.cast_to_varchar2
It gives data as well as of rft tages...?
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Verdana ;} {\f1\froman\fcharset0 times New Roman ;} {\f2\fswiss\fcharset0 arial ;} {\f3\fnil\fcharset2 ;}} symbol
{\colortbl; \red0\green0\blue0 ;}}
{\stylesheet {normal ;}}} {\s1 title 1 ;} {\s2 section 2 ;} {\s3 heading 3 ;}
is it possible to get rid of the rtf tags and
get data only? outside ctx_doc package
I restarted DB and its works well now iam able to execute insert
After reading that:
Just my $0.02, since you are not on 10.2:
Product (component) Oracle Text (generic / by default)
Supposed to be affected Versions version range<>
Confirmed versions as being affected * 10.1.0.3
Subject: Bug 3510694 - ORA-29875 (ORA-1402) raised during simultaneous operations on the full-text index
Take a look at this doc on Metalink/MOS: Doc ID: 3510694.8
However, Justin got one point sound and solid in any case:
CLOB can be the best JOB to use in your case.
Tags: Database
Similar Questions
-
Read the BLOB and insert data into a table
Hi all
Let us examine below on Oracle DB 12 c:
create table xx_test3 (c blob); insert into xx_test3 (c) values (utl_raw.cast_to_raw( 'azertyuiop,qsdfghjklm,wxcvbn')); create table xx_target (col1 varchar2(50));
Can someone guide me how to read the data and insert it into the xx_target table?
Necessary result is:
select * from xx_target; COL1 -------------------------------------------------- azertyuiop qsdfghjklm wxcvbn 3 rows selected.
Thanks in advance,
Stoyanov.
insert into xx_target (col1)
with the data as)
Select utl_raw.cast_to_varchar2 (dbms_lob.substr (c, 32000, 1)) CBC
of xx_test3
)
Select regexp_substr (CBC, ' [^,] +', 1, level)
from the data
connect by level<= regexp_count(src,="" ',')="" +="">=>
-
"missing the SELECT keyword" error during an insert into the temporary table using the blob value
I'm trying to insert into an oracle temp table using select that retrieves data from a blob field but I get the error: "lack the SELECT keyword.
How we store temporary in oracle result when we make this type of operation (extraction of data in fields and try to load them into a separate table on the fly.?)
with cte as)
Select user_id, utl_raw.cast_to_varchar2 (dbms_lob.substr (PREFERENCES)) as USER my_blob
)
create table new_table as
SELECT user_id,EXTRACTvalue(xmltype(e.my_blob),'/preferences/locale') regional settings
E ETC
----------------------------------------------------------------------------------
BLOB data - value - which is
<? XML version = "1.0" encoding = "ISO-8859-1" ?>
- < Preferences >< time zone > America/New_York < / > zone< displayscheduleinusertimezone > Y < / displayscheduleinusertimezone >< local > Spanish < /locale >< DateFormat > JJ/mm/aaaa < / DateFormat >< timeFormat > hh: mm aaa < / timeFormat >< longformat > Long_01 < / longformat >< doubleformat > Double_01 < / doubleformat >< percentformat > Percentage_01 < / percentformat >< currencyformat > Currency_01 < / currencyformat >< / Preferences >
A WITH clause that must immediately precede the SELECT keyword:
SQL > create table t:
2 with the o as (select double dummy)
3 select * West longitude;
Table created.
-
Cannot write data blob image file
Hello
I am trying to write in a persistent storage of an image blob data... even if I don't get an error, that nothing is written
window. rootFS.getFile (window. mainDirectory + ' / ' + $scope.) sCurrentDate + "/" + filename. substring (file name of0 . lastIndexOf ('.')) + '.jpg' {create:true} { function(file)
file.createWriter (function(fileWriter) {}
fileWriter. write (oXHR. ( responseText) ;
fileWriter. onwriteend = function (e) {}Console. Journal ("file image = >""") ;
console. Journal (e) ;
console. Journal (file) ;
});};
{ } { function(error)Console. Journal (error) ;
});
} { function(e)Console. Journal (e) ;
});honestly, I don't know what to try anymore
Good. So something has changed at the same time, because in your OP, you wrote:
nothing is written
and now you say:
the file is created, but the image link seems broken
All plugins:
1. the plugin file is integrated into the plugin to transfer files, so you should not the former.
2. There is not these plugins by these names on the repo of old, obsolete "bmp".
3. the latest versions of these plugins to the NPM are 4.2.0 and 1.5.1 so you have included older versions
4. you must use the latest syntax and NPM and therefore write:
Now, what is "the link of the image" and how seems to be broken?
-
Big base64 that image cannot be correctly converted to BLOB
I use the script below to extract the JSON in MongoDB, analyze and then inserting it into an Oracle table.
- The script works very well in a way that it inserts all the values correctly in the Oracle table. That includes the picture value, which is a base64 image formats and it is much longer than 32 KB.
- The Photo column in the Appery_Photos table is of type CLOB, while the DecodedPhoto column is of type BLOB.
- The problem lies in the line blobOriginal: = base64decode1 (Photo); line 24 , I used to decode the CLOB in BLOB. The base64decode1 function has been replaced by several functions (e.g. decode_base64 , base64DecodeClobAsBlob_plsql, base64decode , from_base64 & finally JSON_EXT. DECODER the).
- The result was the same for each of them. In other words, the BLOB that results cannot be opened as an image using image editors (I use Oracle SQL Developer to download).
- I checked CLOB, and I couldn't find returns in line * \n*, nor could I find spaces (only + found signs). Furthermore, I inserted the CLOB value into base64-image-converter , and the image is displayed correctly. In addition, I tried to encode the BLOB that results in base64 back in order to further validate (by using the inverse functions provided in the links above), the resultant base64 is not the same as the original at all.
BEGIN l_http_request := UTL_HTTP.begin_request('https://api.appery.io/rest/1/db/collections/Photos?where=%7B%22Oracle_Flag%22%3A%22Y%22%7D' , 'GET' , 'HTTP/1.1'); -- ...set header's attributes UTL_HTTP.set_header(l_http_request, 'X-Appery-Database-Id', '53f2dac5e4b02cca64021dbe'); l_http_response := UTL_HTTP.get_response(l_http_request); BEGIN LOOP UTL_HTTP.read_text(l_http_response, buf); l_response_text := l_response_text || buf; END LOOP; EXCEPTION WHEN UTL_HTTP.end_of_body THEN NULL; END; l_list := json_list(l_response_text); FOR i IN 1..l_list.count LOOP A_id := json_ext.get_string(json(l_list.get(i)),'_id'); l_val := json_ext.get_json_value(json(l_list.get(i)),'Photo'); dbms_lob.createtemporary(Photo, true, 2); json_value.get_string(l_val, Photo); dbms_output.put_line(dbms_lob.getlength(Photo)); dbms_output.put_line(dbms_lob.substr(Photo, 20, 1)); blobOriginal := base64decode1(Photo); A_Name := json_ext.get_string(json(l_list.get(i)),'Name'); Remarks := json_ext.get_string(json(l_list.get(i)),'Remarks'); Status := json_ext.get_string(json(l_list.get(i)),'Status'); UserId := json_ext.get_string(json(l_list.get(i)),'UserId'); A_Date := json_ext.get_string(json(l_list.get(i)),'Date'); A_Time := json_ext.get_string(json(l_list.get(i)),'Time'); MSG_status := json_ext.get_string(json(l_list.get(i)),'MSG_status'); Oracle_Flag := json_ext.get_string(json(l_list.get(i)),'Oracle_Flag'); acl := json_ext.get_string(json(l_list.get(i)),'acl'); INSERT INTO Appery_Photos ( A_id, Photo, DecodedPhoto, A_Name, Remarks, Status, UserId, A_Date, A_Time, MSG_status , Oracle_Flag, acl ) VALUES ( A_id, Photo, blobOriginal, A_Name, Remarks, Status, UserId, A_Date, A_Time, MSG_status , Oracle_Flag, acl ); dbms_lob.freetemporary(Photo); END LOOP; -- finalizing UTL_HTTP.end_response(l_http_response); EXCEPTION WHEN UTL_HTTP.end_of_body THEN UTL_HTTP.end_response(l_http_response); END;
Any help is deeply appreciated.
After I run this I can see your photos. So you're a fan of Winston
Please note the substr I used on the clob Photo.
declare
tmp blob.
function clobbase642blob (p_clob clob)
Returns the BLOB
is
t_blob blob.
t_buffer varchar2 (32767).
number of t_pos: = 1;
number of t_size: = nls_charset_decl_len (32764, nls_charset_id ("char_cs"));
number of t_len;
t_tmp raw (32767).
Start
DBMS_LOB.CREATETEMPORARY (t_blob, true);
t_len: = length (p_clob);
loop
When the t_pos output > t_len;
t_buffer: = replace (replace (substr (p_clob, t_pos, t_size), Chr (10)), Chr (13));
t_pos: = t_pos + t_size;
all in t_pos <= t_len="" and="" mod(="" length(="" t_buffer="" ),="" 4="" )="">0
loop
t_buffer: = t_buffer | Replace (replace (substr (p_clob, t_pos, 1), Chr (10)), Chr (13));
t_pos: = t_pos + 1;
end loop;
t_tmp: = utl_encode.base64_decode (utl_raw.cast_to_raw (t_buffer));
DBMS_LOB. WriteAppend (t_blob, utl_raw.length (t_tmp), t_tmp);
end loop;
Return t_blob;
end;
Start
for in r_x (select A_id, photo of Appery_Photos for update)
loop
tmp: = clobbase642blob (substr (r_x.photo, 24));
x update
Set DecodedPhoto = tmp
where A_id = r_x.A_id;
end loop;
end;=>
-
Reg: Analysis BLOB and download in rows and columns-
Hi Experts,
I have a requirement, that I met him, but isn't a very good approach. You will appreciate your suggestions on this.
There is a column of type BLOB, when a CSV file is downloaded using the interface of the APEX. I am the analysis and break the BLOB i.e. CSV values using regular expressions and insert rows in table for later use in n columns.
Note: The downloaded CSV file assumes the maximum of 50 columns.
Like this:
-/ / Convert BLOB on the CLOB type
() DBMS_LOB.converttoclob
v_clob, v_blob,
DBMS_LOB. LOBMAXSIZE,
v_dest_offset, v_src_offset,
v_blob_csid, v_lang_context, g_msg
);
-/ / Find total no of records
l_length: = DBMS_LOB.getlength (v_clob);
l_records: = (l_length-LENGTH (REPLACE (v_clob, CHR (10))) + 1;)
BECAUSE me IN 1.l_records
LOOP
v_pos1: = CASE WHEN (i = 1) THEN 1 ELSE (DBMS_LOB. InStr (v_clob, Chr (10), 1, i-1)) END;
v_pos2: = CASE WHEN (I = l_records) AND (l_length) ELSE (DBMS_LOB. InStr (v_clob, Chr (10), 1, i));
v_substr: =.
(BOX WHEN i = 1 THEN
DBMS_LOB. SUBSTR (lob_loc = > v_clob, amount = >(v_pos2-v_pos1), offset = > 1)
ON THE OTHER
DBMS_LOB. SUBSTR (lob_loc = > v_clob, amount = >(v_pos2-v_pos1)-1, offset = > v_pos1 + 1)
END );
-----------------------------------------------------------
-/ / The data in each row are still divided into separate columns
-----------------------------------------------------------
insert_table. EXTEND();
insert_table (insert_table..) (Sqid LAST): = i;
insert_table (insert_table. LAST) .c001: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,1,'i',2);
insert_table (insert_table. LAST) .c002: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,2,'i',2);
insert_table (insert_table. LAST) .c003: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,3,'i',2);
insert_table (insert_table. LAST) .c004: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,4,'i',2);
insert_table (insert_table. LAST) .c005: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,5,'i',2);
insert_table (insert_table. LAST) .c006: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,6,'i',2);
insert_table (insert_table. LAST) .c007: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,7,'i',2);
insert_table (insert_table. LAST) .c008: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,8,'i',2);
insert_table (insert_table. LAST) .c009: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,9,'i',2);
insert_table (insert_table. LAST) .c010: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 10, « i », 2) ;
--
insert_table (insert_table. LAST) .c011: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 11, « i », 2) ;
insert_table (insert_table. LAST) .c012: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 12, « i », 2) ;
insert_table (insert_table. LAST) .c013: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 13, « i », 2) ;
insert_table (insert_table. LAST) .c014: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 14, « i », 2) ;
insert_table (insert_table. LAST) .c015: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 15, « i », 2) ;
insert_table (insert_table. LAST) .c016: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 16, « i », 2) ;
insert_table (insert_table. LAST) .c017: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 17, « i », 2) ;
insert_table (insert_table. LAST) .c018: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 18, « i », 2) ;
insert_table (insert_table. LAST) .c019: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 19, « i », 2) ;
insert_table (insert_table. LAST) .c020: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 20, « i », 2) ;
--
insert_table (insert_table. LAST) .c021: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 21, « i », 2) ;
insert_table (insert_table. LAST) .c022: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 22, « i », 2) ;
insert_table (insert_table. LAST) .c023: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 23, « i », 2) ;
insert_table (insert_table. LAST) .c024: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 24, « i », 2) ;
insert_table (insert_table. LAST) .c025: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 25, « i », 2) ;
insert_table (insert_table. LAST) .c026: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 26, « i », 2) ;
insert_table (insert_table. LAST) .c027: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 27, « i », 2) ;
insert_table (insert_table. LAST) .c028: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 28, « i », 2) ;
insert_table (insert_table. LAST) .c029: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 29, « i », 2) ;
insert_table (insert_table. LAST) .c030: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 30, « i », 2) ;
--
insert_table (insert_table. LAST) .c031: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 31, « i », 2) ;
insert_table (insert_table. LAST) .c032: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 32, « i », 2) ;
insert_table (insert_table. LAST) .c033: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 33, « i », 2) ;
insert_table (insert_table. LAST) .c034: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 34, « i », 2) ;
insert_table (insert_table. LAST) .c035: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 35, « i », 2) ;
insert_table (insert_table. LAST) .c036: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 36, « i », 2) ;
insert_table (insert_table. LAST) .c037: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 37, « i », 2) ;
insert_table (insert_table. LAST) .c038: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 38, « i », 2) ;
insert_table (insert_table. LAST) .c039: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 39, « i », 2) ;
insert_table (insert_table. LAST) .c040: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 40, « i », 2) ;
--
insert_table (insert_table. LAST) .c041: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 41, « i », 2) ;
insert_table (insert_table. LAST) .c042: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 42, « i », 2) ;
insert_table (insert_table. LAST) .c043: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 43, « i », 2) ;
insert_table (insert_table. LAST) .c044: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 44, « i », 2) ;
insert_table (insert_table. LAST) .c045: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 45, « i », 2) ;
insert_table (insert_table. LAST) .c046: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 46, « i », 2) ;
insert_table (insert_table. LAST) .c047: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 47, « i », 2) ;
insert_table (insert_table. LAST) .c048: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 48, « i », 2) ;
insert_table (insert_table. LAST) .c049: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 49, « i », 2) ;
insert_table (insert_table. LAST) .c050: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 50, « i », 2) ;
-----------------------------------------------------
END LOOP;
Data entry example:
998,9012238422,600454892,,7/1/2014,337555.11,493.06,,545.21,,,2,1104.93,,,563.5,,,1.75,100,,M,3,545.21,,7/8/2014,337555.11,0,0,,0,,338100.32,338100.32,
998,9044033,656848127,,7/1/2014,104269.9,533.3,,163.09,,,6.5,726.88,,,565.68,,,6.128,100,,M,3,163.09,,7/8/2014,104269.9,0,0,,0,,104432.99,104432.99,
998,2011011,426985586,,1/1/2013,74134.99,380.78,,236.58,,,6.5,520.82,,,805.06,,,6.144,100,,M,3,236.58,,7/2/2014,74134.99,0,0,,0,,74371.57,74371.57,
Please notify.
Let me know if you need some other information about it.
Thank you and best regards,
Nordine
(on Oracle 11.2.0.3.0)
Writing the BLOB in the disc and using an external table are likely to be more effective.
Disadvantage: you must serialize the process to ensure that simultaneous sessions do not alter the location of the external file.
A function in Java-based pipeline could also be an option, or even a custom parser csv (free regex) written in PL/SQL.
-
How to generate an xml document with a BLOB on the inside?
Hello
Using the Oracle 11 g Release 11.2.0.4.0 database, I actually use dbms_xmldom to generate xml data.
When generated, it is sent using utl_http.
All right, except that I have to include a child that contains a BLOB (stored in the database) in the exact way that it is stored in the XML structure.
(Field value contains an encoded 64 base pdf file). Length of the file can be up to 2 MB
My nearest solution was to Convert Oracle XML BLOB to type even if I'm really stuck with LPX-00210 error.
Is there another way than dbms_xmldom do?
In fact, I'm totally lost.
Can you give me a hand on this or show me an example of work?
Kind regards
Stone
Here goes...
SQL> create table images ( 2 id integer 3 , name varchar2(256) 4 , content blob 5 ); Table created SQL> SQL> declare 2 3 bf bfile := bfilename('XML_DIR','base64.bin'); 4 lob_ptr blob; 5 dest_offs integer := 1; 6 src_offs integer := 1; 7 8 begin 9 10 insert into images (id, name, content) 11 values (1, 'Koala.jpg', empty_blob()) 12 returning content into lob_ptr; 13 14 dbms_lob.open(bf, dbms_lob.lob_readonly); 15 dbms_lob.loadblobfromfile(lob_ptr, bf, dbms_lob.getlength(bf), dest_offs, src_offs); 16 dbms_lob.close(bf); 17 18 end; 19 / PL/SQL procedure successfully completed SQL> commit; Commit complete SQL> SQL> select id 2 , name 3 , utl_raw.cast_to_varchar2(dbms_lob.substr(content, 30)) as first_bytes 4 , dbms_lob.getlength(content) as lob_size 5 from images 6 / ID NAME FIRST_BYTES LOB_SIZE ----- ------------ -------------------------------- ---------- 1 Koala.jpg /9j/4AAQSkZJRgABAgEAYABgAAD/7g 1068504 SQL> SQL> declare 2 3 x_doc xmltype; 4 domdoc dbms_xmldom.DOMDocument; 5 domnode dbms_xmldom.DOMNode; 6 domtext dbms_xmldom.DOMText; 7 ostream sys.utl_BinaryOutputStream; 8 chunksize pls_integer; 9 offset pls_integer := 1; 10 buf raw(32767); 11 image blob; 12 13 begin 14 15 select xmlelement("image", 16 xmlelement("id", t.id) 17 , xmlelement("name", t.name) 18 , xmlelement("content") 19 ) 20 , t.content 21 into x_doc 22 , image 23 from images t 24 where t.id = 1 ; 25 26 domdoc := dbms_xmldom.newDOMDocument(x_doc); 27 28 -- get /image/content node so that we can append a text node and stream the BLOB to it : 29 domnode := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(domdoc), '/image/content'); 30 domtext := dbms_xmldom.createTextNode(domdoc, null); 31 domnode := dbms_xmldom.appendChild(domnode, dbms_xmldom.makeNode(domtext)); 32 33 ostream := DBMS_XMLDOM.setNodeValueAsBinaryStream(domnode); 34 chunksize := dbms_lob.getchunksize(image); 35 36 loop 37 begin 38 -- read BLOB in chunk of
: 39 dbms_lob.read(image, chunksize, offset, buf); 40 exception 41 when no_data_found then 42 exit; 43 end; 44 -- write chunk to DOM node : 45 ostream.write(buf, chunksize); 46 offset := offset + chunksize; 47 end loop; 48 49 ostream.flush(); 50 ostream.close(); 51 52 dbms_xmldom.writeToFile(domdoc, 'XML_DIR/image.xml'); 53 dbms_xmldom.freeDocument(domdoc); 54 55 end; 56 / PL/SQL procedure successfully completed Image.xml release:
1 Koala.jpg /9j/4AAQSkZJRgABAgEAYABgAAD/7gAOQWRvYmUAZAAAAAAB/+EUI0V4aWYAAE1NACoAAAAIAAcB MgACAAAAFAAAAGIBOwACAAAABwAAAHZHRgADAAAAAQAEAABHSQADAAAAAQA/AACcnQABAAAADgAA AADqHAAHAAAH9AAAAACHaQAEAAAAAQAAAH0AAADnMjAwOTowMzoxMiAxMzo0ODoyOABDb3JiaXMA ... aWpkRY6dqaJY42qFjs8ZZ5nlkjZpmJUiJ1+ijn3dVeTtb4B1R5NJVaEkn/V8+u4Xijpp6SFlimp6 qNHgjlVIgrtLCyxll1NpaT6An6W92mA8HwkyadMeEZJjEDmvE/t/1f5uv//Z -
Example of
create table test (id primary number, data key blob);
I want to display like
Select code, data of the test;
ID data
1 character 4000
1 character 4000
1 character 4000
.
.
and soon.
Please help me on this
BLOB stores binary data. What is the point of converted them to a varchar2? If the LOB will store the character data, then the appropriate data type would be CLOB. Said that, assuming that you will use CLOB here is the answer to your question.
drop table temp purge;
create table temp
(
integer ID
clob c_lob
);
declare
CLOB var;
Start
DBMS_LOB.CREATETEMPORARY (var, true);
because me in 1.32 loop
DBMS_LOB. WriteAppend (var, 1000, rpad ('x', 1000, 'x'));
end loop;
insert into temp (id, c_lob) values (1, var);
insert into temp (id, c_lob) values (2, var);
commit;
end;
/
Select id
rno
, length (dbms_lob.substr (c_lob, 4000, offset)) c_lob_var_len
, dbms_lob.substr (c_lob, 4000, offset) c_lob_var
de)
Select id
, ((level-1) * 4000) + 1 offset
c_lob
level NWR
temp
connect
by level<=>=>
and prior id = id
and dbms_random.value (prior) is not null
);
-
Can not download or Image in blob view point.
Hi Guyz,
I am inserting an image in a blob using oracle 10 g forms element and the 9i database, everything works well except downloading image, I tried the code below he opened the open file dialog box and as soon as I select the image to insert into the image element it will be not be shown anything at all at the point of the image.
The WBP trigger code.
[code]
DECLARE
FILENAME VARCHAR2 (256);
BEGIN
FILENAME: = WEBUTIL_FILE. FILE_OPEN_DIALOG();
IF FILENAME IS NOT NULL THEN
CLIENT_IMAGE. READ_IMAGE_FILE (FILENAME, SUBSTR (FILENAME, INSTR (FILENAME,-1)),'MN_PICTURES.) PHOTO ');
: MN_PICTURES. PIC_STAT: = 1;
END IF;
END;
[/ code]
then I tried the thin new from scratch using the link below to insert the code but still I can't insert image in the image element I put the sub properties at the point of the image
adjust size of style =
= TIFF image format.
No matter what required fix or I do something wrong?
Concerning
Houda
Hey guyz,.
I found the solution on below link... thx
https://forums.Oracle.com/thread/2190302
Concerning
Houda
-
Oracle 9i excerpt/analyse XML in BLOB
I have the table with the Blob column. In the column of the blog, I have data XML (see below).
I tried to parse xml and get the note value '< GetTest >. How do I get there?
Example table:
create table SAMPLE_XML_TABLE ( ID NUMBER not null, XMLSTRING BLOB, );
<?xml version="1.0" standalone="no"?> <FromResponse xmlns="http://www.somewebsite.com/FromResponse"> <Code>0000</Code> <Seller> <SellerServer> <Version>01</Version> <Sample> <GetTest>I wanted to get this Text</GetTest> </Sample> </SellerServer> </Seller> </FromResponse>
And of course any fix untested untested code made things worse... * sigh *. DBMS_LOB.substr has an agenda of setting different than the regular substr.
This solution has been tested (really!) and although it is not the most beautiful thing, it does the job
Select dbms_lob.substr (xmlstring,
DBMS_LOB. InStr(xmlString, '') - dbms_lob.instr (xmlstring, '
') - length (' '), DBMS_LOB. InStr (xmlstring, '
') + length (' ')) GetTest of sample_xml_table
-
Hello worldI need your help on this query. I need to get a particular value for a column that is a type of BLOB data. Here are examples of data
ID TESTDATA
1 best Buy 00001234 12222 30 00
2 Lowes 00001234 12222 100 00
Wal-Mart 3-00001234 12222 129 00
4 00001234 12222 5000 00 abc
5 Toshiba 00001234 12222 21 00
Sue 6 00001234 12222 49 00
When the Bill is '00001234', '12222' is Netamount field and highlighted in red is the amount of this invoice. The only data I need to query returns 12222 (netamount) = $amount. I tried using substr
Select substr ((TESTDATA), 19, 26) test TABLEA;
But this gives me only the first line but no other amount which have different positions. This is the desired output
Output
ID TESTDATA
1 12222 30
2 12222 100
3 12222 129
4 12222 5000
5 12222 21
6 12222 49
Any help on this is really appreciate it
Thank you
Hello
You can use a regular expression to extract the data you want by specifying the recurrence of a figure in your text:
with xx as
(
Select 1 id, "Best Buy 00001234 12222 30 00' any double union testdata
Select 2 id, "Lowes 00001234 12222 100 00' from dual union all
Select 3 id, "Wal - Mart 00001234 12222 129 00' from dual union all
Select 4 id, 'abc 00001234 12222 5000 00' from dual union all '.
Select 5 id, 'Toshiba 00001234 12222 21 00' from dual union all
Select 6 id, "Sue 00001234 12222 49 00' of the double."
)
SELECT id, testdata
, regexp_substr (testdata, ' \d+',1,1) invoice
, regexp_substr (testdata, ' \d+',1,2) netamt
, regexp_substr (testdata, ' \d+',1,3) amt$
XX.
ID TESTDATA BILL NETAMT AMT$
---------- ------------------------------- --------------- --------------- ---------------
1 best Buy 00001234 12222 30 00 00001234 12222 30
2 Lowes 00001234 12222 100 00 00001234 12222 100
Wal-Mart 3 00001234 12222 129 00 00001234 12222 129
4 00001234 12222 5000 00 00001234 12222 5000 abc
5 00001234 12222 21 00 00001234 12222 21 Toshiba
6 00001234 12222 49 00 00001234 12222 49 Sue
Kind regards.
Al
-
Download the content of the BLOB from a custom table
In our application hosted the apex, the following code from the Express on the Application Developer's Guide works great to allow a user to download the contents of the blob of one of our paintings customized via a download button. However, the code does not work on the Cloud Oracle because the 'owa_util' package is no longer available. The code is as follows:
CREATE OR REPLACE PROCEDURE download_my_file (p_file in number) AS
v_mime VARCHAR2 (48);
V_LENGTH NUMBER;
v_file_name VARCHAR2 (2000);
Lob_loc BLOB;
BEGIN
Name of SELECT MIME_TYPE, BLOB_CONTENT, DBMS_LOB. GETLENGTH (blob_content)
IN lob_loc, v_file_name, v_mime, v_length
OF file_subjects
WHERE id = p_file;
--
-set up the HTTP header
--
-Use a NVL around the mime type and
-If it is null it the value application/octect
-application/octect can initiate a download of windows window
owa_util.mime_header (nvl(v_mime,'application/octet'), FALSE);
-set the size so that the browser knows how to download
HTP.p ("Content-length: ' |") v_length);
-the name of the file will be used by the browser if users only one save as
HTP.p ('Content-Disposition: attachment; filename = "" | ") Replace (Replace (substr (v_file_name, InStr(v_file_name,'/') + 1), Chr (10), null), Chr (13), null). '"');
-close the headers
owa_util.http_header_close;
-Download the BLOB
wpg_docload.download_file (Lob_loc);
end download_my_file;
/
In addition to the use of web services, does anyone know how to do this? Is it possible to add access to the package 'owa_util' in the cloud? I also tried apex_util.get_blob_file_src but that is also not available in the Oracle cloud.
Thank you
SteveHi Steve,.
(1) sys.owa_util is certainly available. You should be able to issue this block very well SQL commands:
Start
owa_util.print_cgi_env;
end;((2) I think the problem is that you have created a procedure that a) cannot not be granted run to the PUBLIC and b) cannot be called directly from the URL (because of a properly locked APEX listener which restricts entry points, i.e..) What procedures can be called directly from the URL).
Even if there was no prohibition of granting something to the PUBLIC, you would never get by the restriction on the call of your own point of entry of the URL. Also in a facility non - Cloud APEX (and even when you're using mod_plsql), the list of entry points is applied through the PlsqlRequestValidationFunction (http://docs.oracle.com/cd/E23943_01/web.1111/e10144/under_mods.htm#HSADM698).
Two ways around this:
(1) you can define a request of the process which, when called, downloads the requested file
or
(2) you may want to expose this functionality via a RESTful Service of media resources, even though right now, I'm not necessarily details how you would ensure access to it.
I hope this helps.
Joel
-
DBMS_LOB.substr is failing ORA-06502
The following query is to launch error while doing less with dbms_lob.substr although 4000
characters are selected. Column billing_inventory is CLOB. Please advice.
SQL > select count (1) in the llums_feed;
724754
SQL > select count (1) in the llums_feed_prv;
0
SQL > SELECT
asset_id, DBMS_LOB.substr(billing_inventory,4000,1), DBMS_LOB.substr (billing_inventory, 8000, 4001)
OF llums_feed
less
Select asset_id, dbms_lob.substr(billing_inventory,4000,1)
dbms_lob.substr(billing_inventory,8000,4001)
of llums_feed_prv;
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at line 1Hello
You select 8,000 characters posted 4001, not 4000 characters posted 4001...
FUNCTION substr(lob_loc IN BLOB, amount IN INTEGER := 32767, offset IN INTEGER := 1)
DBMS_LOB.substr (billing_inventory, 4000, 1), dbms_lob.substr (billing_inventory,8000,4001)
You must change the 2nd substr in each select statement to be
DBMS_LOB.substr (billing_inventory, 4000, 1), dbms_lob.substr (billing_inventory,4001,4000)
HTH
David
Published by: David Tyler June 27, 2011 13:16
-
Download blob function instead of table field
Hello
Is it possible to download the content of blob field that are returned by a function?
I can only download blob if the blob is in the column of the table...
Thank you
VincentHi Vincent,.
I think you can download the blob content returned by a function with no problems. In the example below, the get_blob function returns a BLOB, you must specify the name and the mime type and the length of the BLOB is obtained using DBMS_LOB. GETLENGTH. Finally, a call to the wpg_docload.download_file procedure is made. To call the procedure download_file, you can do it through the URL or on a page with a 'branch at PL/SQL procedure' in the point "before Header". More info on this kind of procedure here.
create or replace PROCEDURE "DOWNLOAD_FILE" ( inID NUMBER ) AS vMIME VARCHAR2(48); vLENGTH NUMBER; vFILENAME VARCHAR2(2000); vBLOB BLOB; BEGIN vMIME := 'application/octet-stream'; vFILENAME := 'Test.sql'; vBLOB := get_blob(inID); vLENGTH := DBMS_LOB.GETLENGTH(vBLOB); owa_util.mime_header(nvl(vMIME, 'application/octet'), FALSE); htp.p('Content-length: ' || vLENGTH); htp.p('Content-Disposition: attachment; filename="' || SUBSTR(vFILENAME, INSTR(vFILENAME, '/') + 1) || '"'); owa_util.http_header_close; wpg_docload.download_file(vBLOB); END;
Kind regards
Sergio
-
Web services - Send content Blob
Hello
I've been using the web based pl/sql package service someone created this forum to call services web soap of the database rather than using the assistants of the apex.
I'm trying to access a web service fax requiring binary information on the document to send (PDF).
I can't create the envelope due to binary (BLOB) content.
lv_envelope: = ' <? XML version = "1.0" encoding = "utf-8"? >
< soap envelope: xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" >
< soap: Body >
< Sendfax xmlns = "http://www.interfax.cc" >
myuser < user name > < / username >
< password > 123 < / password >
< FaxNumber 012345 > < / Fax number >
< FileData > ' | lbl_blob | "< / FileData >
PDF of < FileType > < / FileType >
< / Sendfax >
< / soap: Body >
< / envelope soap: > ';
Does anyone have any ideas on how I can achieve this?
Thank youMy encoding function works on all sizes, small and large blobs.
And regarding the coding parts, it depends on the size of the pieces. They all have a multiple of 3, it will be the same.
declare function base64encode( p_blob in blob ) return clob is t_rv clob; t_step pls_integer := 24573; -- make sure you set a multiple of 3 not higher than 24573 begin for i in 0 .. trunc( ( dbms_lob.getlength( p_blob ) - 1 ) / t_step ) loop t_rv := t_rv || utl_raw.cast_to_varchar2( utl_encode.base64_encode( dbms_lob.substr( p_blob, t_step, i * t_step + 1 ) ) ); end loop; return t_rv; end; begin dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '123' ) ) ); dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '456' ) ) ); dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '123456' ) ) ); dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '12' ) ) ); dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '34' ) ) ); dbms_output.put_line( base64encode( utl_raw.cast_to_raw( '1234' ) ) ); end; / MTIz NDU2 MTIzNDU2 MTI= MzQ= MTIzNA==
Maybe you are looking for
-
NB100 - recovery XP iso?
Please give me at least 1 GB because I have only 1 GB usb FD & THANKS in ADVANCE! and if you have not then say how to create one
-
15z HP envy: the upgrade of my hard drive
Hello my name is Muhammad I bought hp 15z envy. I got 1 TB of hard drive and I think put my hard drive to ssd 250 GB. Can u please help me to choose which is the best ssd for my laptop. Thank you
-
(Redirected) The Dell technical support is catastrophic.
I got an Alienware M14x end may, 2013. A few months, about 3 pixels grilled and a USB port stops working. Instead of just replace parts and sending it to me, they're sending me a 4th gen 14 Alienware, brand new, top-of-the-line. It was but a curse in
-
Download Photoshop CS6 on a new computer
Hello! I have photoshop cs6 I have on my old computer and install it on my new computer... help?
-
I just want to buy photoshop cs6 instead of a subscription is possible to do?
I just want to buy photoshop cs6 instead of a subscription is possible to do?