Replacing Clob Content
I have a clob column in a table, which i need to update by replacing all occurrances of string1 in Clob_col with string2.
Eg: update table1 set varchar2_col=replace(varchar2_col, string1,string2) where <condition>. How do I achieve the
same functionality for a clob column? Any help/suggestions/code, highly appreciated.
Thanks in advance.
In that place of my Store Procedure:
declare
clobs1 CLOB;
clobs2 CLOB;
BLOBS blob;
clobs_aux CLOB;
valor number;
cadena varchar2(4000);
nposicion number;
ncontar number:=1;
begin
select docs8_clobs, documento_blob into clobs1,blobs
from hr.EMPLOYEE_DOCUMENTS
where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
valor:=DBMS_LOB.INSTR(CLOBS1,'#',1,ncontar);
clobs_aux:=clobs1;
while valor<>0 loop
nposicion:=valor+1;
DBMS_OUTPUT.PUT_LINE(TO_CHAR(VALOR));
clobs2:=DBMS_LOB.SUBSTR(clobs_aux,valor-1,1);
clobs2:=clobs2||' '||to_clob('1306958172');
clobs2:=clobs2||' '||DBMS_LOB.SUBSTR(clobs_aux,nposicion,nposicion);
CLOBS_AUX:=CLOBS2;
if ncontar>=1 then
update hr.EMPLOYEE_DOCUMENTS
set docs8_clobs=clobs_aux
where num_documens=12812;
commit;
end if;
--Recuperar campo CLOB actualizado.
select docs8_clobs, documento_blob into clobs1,blobs
from hr.EMPLOYEE_DOCUMENTS
where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
CLOBS_AUX:=CLOBS1;
valor:=DBMS_LOB.INSTR(CLOBS_AUX,'#',1,ncontar);
ncontar:=ncontar+1;
end loop;
end;
Roberto.
Similar Messages
-
We are having a problems when changing the contents of a Clob object. If the data we are writing back to the Clob is shorter than the original data it overwrites the original data, except for the end of the original.
Does anyone know how to clear the existing contents of a Clob out before the rewrite?
Thanks,
Jack HarrisFirst set the clob to empty_clob(), then do
an update as you are doing now. -
I want to sync the songs on my Mac to my iPod, but it says, 'An iPod can only be synced to one iTunes Library at a time. Erasing and syncing replaces the contents of this iTunes Library.' Will this reset my iPod completely (my iPod is 4th gen)?
Was your iPod associated with a different mac or pc previously is all. And was it backed up or sync'd on this mac with iTunes previously.
http://www.apple.com/support/itunes -
I got a Mac and i downloaded new music on it and im trying to sync the music on this computer to my iPhone which is hooked up to another iTunes and iTunes is saying " An iPhone can be synced with only one iTunes Library at a time. Erasing and syncing replaces the contents of this iPhone with the contents of this iPhone with the contents of this iTunes library" does this mean that it will also erase my photos or just my music and videos ?? if it does is there another way to sync with out all my contents being deleted??
You can only sync one iTunes Library from Mac to iPhone.
And just so are you aware, Apple ID accounts cannot be merged, thus merging content > Frequently asked questions about Apple ID -
I synced my iPhone to my husband's computer not knowing that it would wipe out his iTunes account and replace his content with mine. Obviously, not good. Any ideas on how to fix this??
Syncing an iphone should have no effect at all on the content of the computer.
Are you saying the the itunes library on the computer was effected? -
Replace Attributes Content ?
Is there a FCPX equivelant to Replace Attributes > Content?
I have several plaeholder clips with all atributes set on my timeline. Now I need to replace them with different media, but want to retain cropping, timing, in and outs, etc.
I know I can copy atributes and paste them into a new clip, but this doesn't transfer the in and out points. Any ideas?Not as selective as the old Final Cut, but you can select a clip and copy it, then go to:
Edit > Paste Attributes (or similar - FCP X is shut down at the moment).
As I say, you get the lot, but it's better than nothing.
Andy -
Scripting problem replacing layer contents.
This is a follow up to the discussion in this thread http://forums.adobe.com/thread/480444?tstart=0.
I've virtually completed the script, I attached it as a .txt file rather than .jsx , In a brief nutshell it does the following:
Gets a text file name.
opens the psd identified in that document
walks the layers in that file
if the layer is a text file and there is replacement text for that name in the input file, replace the text
if the layer is an image (NORMAL) and there is an input file with a name (.jpg or .psd) matching the layer name then
the layer is turned into a smart object and it's contents replaced with the contents of the relevant file.
Saves the modified psd file as the name indicated in the input file and close the original file.
If the input file indicates the file should be left open, reopen the modified file name.
Almost everything works well except ...
1. Sometimes the modified file loses it's layering and winds up with only a "background" layer whereas other times it retains it's layering. I'm sure this is due to some characteristic of the input template .psd, but with limited understanding of photoshop itself I've no idea what characteristic to look for.
Any suggestions as to what might be the source of this problem?
2. It appears that sometimes when creating the 1 layer file that will replace an image layer as a .jpg it losses the background transparency. This doesn't seem to happen if saved as a .psd, but the user wants to work with jpgs.
Any ideas why?
3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
Again any ideas why it might be misaligned or a code change that will fix it?
Any suggestions would be most thankfully accepted.
Steve Ellis.3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
Again any ideas why it might be misaligned or a code change that will fix it
When a file is placed, you set the size and position in the layer. When you replace the contents the same transform values are used. If the file used to replace is not the same size as the first, it will not be the same size and location in the layer. I don't know of any way to determine the transform or reset it. The script could resize but that would require opening the file, resizing, and saving before the replace.
I created the .psd file with which to replace the image layer from the image layer of the original by changing the image and saving it. I then checked the image size, canvas size, and transform values of both and they matched. When I ran the program the replaced image was misplaced, too high in the new psd. I then editing the replacing file and changing the y transform value until it resulted in the right place when placed by the script. For it to work properly the y transform value of the replacing layer was approximately 100 more than the replaced layer (I assume this particular value will vary with the particulars of the files). This is what confuses me, when they were identical it didn't work properly. -
How can move the apps and playlists on my iPad to my Mac? Whenever I attempt to sync, I get a message stating that all apps and music on my iPad will be replaced by content from my Mac and there are no content. Thanks.
the apps will not be deleted if the itunes is authorised for the apple id from which you downloaded the apps.
for the songs if you have downloaded it from a store other than itunes an app "TuneAid" will help you. download the full version then you can copy all the songs on the ipad to ur itunes library -
Download clob contents from function instead of a blob column in a table
I found some examples how to create a download link for data stored in a blob column. However my data is not stored in a blob column but is created in a function returning a clob. Obviously this function can be used to fill a blob column that can then be downloaded but maybe there is a more direct route.
Hello Rene,
I adapted one of my snippets for download-links for your case. The procedure is pretty much the same like the one concerning an existing blob. To provide the download, you need to convert your clob into a blob, which can be done easily by using the corresponding function provided by the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm]DBMS_LOB-API.
The result might look like the following (untested) code snippet:
CREATE OR REPLACE procedure download_from_function (p_func_argument IN VARCHAR2, p_filename IN VARCHAR2)
AS
l_http_response UTL_HTTP.resp;
l_blob BLOB;
l_raw RAW(32767);
l_length INTEGER;
l_dest_offset INTEGER := 1;
l_src_offset INTEGER := 1;
l_lang_context INTGER := DBMS_LOB.DEFAULT_LANG_CTX;
l_warning INTEGER;
BEGIN
-- Initialize the BLOB.
DBMS_LOB.createtemporary(l_blob, FALSE);
-- replace the function call for src_clob
DBMS_LOB.convertToBlob( dest_lob => l_blob,
src_clob => your_clob_function(p_func_argument),
amount => DBMS_LOB.LOBMAXSIZE,
dest_offset => l_dest_offset,
src_offset => l_src_offset,
blob_csid => DBMS_LOB.DEFAULT_CSID,
lang_context => l_lang_context,
warning => l_warning);
l_length := DBMS_LOB.getlength(l_blob);
-- create response header
OWA_UTIL.mime_header('text/plain', false);
-- add furhter header attributes
htp.p('Content-length: ' || l_length);
htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
-- close the headers
OWA_UTIL.http_header_close;
-- download the BLOB
WPG_DOCLOAD.download_file( l_blob );
-- release BLOB from memory
DBMS_LOB.freetemporary(l_blob);
EXCEPTION
WHEN OTHERS THEN
DBMS_LOB.freetemporary(l_blob);
RAISE;
END download_from_function;
-- Page process before header on blank page
BEGIN
download_from_function (p_func_argument => 'your_argument_for_your_clob_returning_function',
p_filename => 'filename_for_download.txt');
END;You should change function name and arguments to fit your clob-function's signature. You may also want to add a characterset conversion if needed. See the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm]API-doc for details.
-Udo -
ITunes wants to replace IPod contents with New Laptop Library
Help please guys. Please bear with me while I will try and explain what my problem is.
Purchased new laptop, loaded ITunes, authorised laptop as the 3rd of my 5 allowable computers, then finally transferred all purchased content to my Laptop via my IPod. I have since purchased various TV shows and songs off ITunes to my Laptop ITunes library. I have only now tried to sync my IPod for the first time with my Laptop and noticed that ITunes did not sync this new content. I then discovered that the reason for this may have been due to all the sync options were unchecked for all the media types which would explain why nothing happened.
Simple, I thought. I would check all the media types for sync and end of. No such luck. Each time I checked the option to sync any of the media type; a message would appear to warn me that the contents of my IPod would be replaced by the contents of my ITunes library. This I do not want. I wish to keep all my purchased content held on both my laptop and my IPod. Isn’t the point of synchronisation to update both the computer and IPod making sure both devices contain the same up-to date media irrespective to the contents of either.
Am I missing something really simple here or are these things made deliberately difficult?
Any advice would be appreciated
Thanks –tred3http://support.apple.com/kb/HT1202
-
Insert or replace last content
HI Forum,
I do need a little tweak on this script...
Thing is, i want to find the last paragraph, last line, last character and make it as full stop...
eg.
• can do anything if you need; (";" to replace with ".").
it is doing that,,,
but if there is no ";" or ":" it is replacing the character d....
I want check the last character is ";" or ":" and to replace with "."
if there is no ";" or ":" just add "." at the end..
myDoc = app.activeDocument;
app.findGrepPreferences = null;
app.findGrepPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;
var myResults = app.findGrep();
var oDoc = app.activeDocument;
for(n=0; n< myResults.length;n++){
var fnd = myResults[n].paragraphs.lastItem().lines.lastItem();
if(fnd.insertionPoints.itemByRange(-3,-2).contents !== "."){
fnd.insertionPoints.itemByRange(-3,-2).contents = "."
alert(fnd.insertionPoints.itemByRange(-3,-2).contents)
Many thanks...Sorry Vam for the confusion...
this is what i mentioned....
for(n=0; n< myResults.length;n++){
var fnd = myResults[n].paragraphs.lastItem().lines.lastItem();
if(fnd.insertionPoints.itemByRange(-3,-2).contents !== "."){ // if there is a paragraph below the bullet paragraph, it works fine... if not it replaces the last character with"."
fnd.insertionPoints.itemByRange(-3,-2).contents = "."
alert(fnd.insertionPoints.itemByRange(-3,-2).contents)
eg. • vamitul;
• vamitul;
• vamitul; // now the semicolon of the last paragraph will be replaced with "." itemByRange(-3,-2).
Dummy text paragraph of this what when dummy text. (paragraph below the last bullet).
eg2. • vamitul;
• vamitul;
• vamitul;
• vamitul; // if there is no paragraph below... now character "l" is replaced with "." itemByRan(-3,-2) goes to l and change it......
Again sorry if im confusing..... vam.. -
Replace flash content with jpg or gif
Hi
Can anyone point me towards the correct code to insert that
will replace a SWF with a static image (either GIF of JPG) if the
user does not have Flash installed?
Thanks.oO(Stefan83)
>Can anyone point me towards the correct code to insert
that will replace
>a SWF with a static image (either GIF of JPG) if the user
does not have
>Flash installed?
Pure HTML:
<object type="application/x-shockwave-flash"
data="example.swf" width="200" height="150">
<param name="movie" value="example.swf">
Alternative non-Flash content
</object>
Might not work in older browsers, though.
Micha -
Jtabbedpane with replacing tab content
Hello,
I am developing an applet that should contain a JTabbedPane with 2 tabs.
The second tab is easy to do because ti contains one Jpanel all the way.
the first however is an issue, because i am supposed to change its content when the applet is running.
this means i have 3 JPanels, J1, J2, J3.
At tge beginning the applet contains J1 in the first tab.
and J1 contains a button. when i click that button the applet should replace J1 with J2.
the problem is i haven't managed to find a solution yet :(
I have tried with setvisible(false) and validate(). It won't work. I also tried to add the J2 panel over J1, but encountered no succes.
anybody has any idea ?
Message was edited by:
asrfelIf you want to change back and forth repeatedly then wrap J1/2/3 in a JPanel with a CardLayout.
If you can discard one when it's done with, use the remove() and insertTab() methods of JTabbedPane. -
Hello,
I'm trying to display the contents of a CLOB into a textarea in a region on my page using the following code, but it's not working...I get a "numeric or value error: character string buffer too small". I tried putting the code in the Source of the textarea item, I tried creating a Before Header process (hard-coding the ID value), I also tried to create a Before Header Computation...I get the same error. I have over 32K characters in the database, but I just want to display the first 32K. Whatever I'm doing wrong is probably a "DUH" mistake but what am I doing wrong?
declare
t varchar2(32000);
c clob;
begin
SELECT clob_content into c FROM minutes WHERE ID = :P3_ID;
t:= dbms_lob.substr(c,32000,1);
-- :P3_TXTVALUE := t;
return t;
end;Thank you,
TammyI think this should give you the way to acomplish that. The first two loops are there only to fill an empty clob and show that it works:
DECLARE
v_clob CLOB := EMPTY_CLOB ();
v_start NUMBER := 1;
v_bytelen NUMBER := 200;
v_raw RAW (200);
v_len NUMBER;
v_x NUMBER;
v_count NUMBER := 0;
v_text VARCHAR2 (32000);
v_text_output VARCHAR2 (32000);
BEGIN
FOR x IN 1 .. 40
LOOP
v_text := NULL;
FOR c IN 1 .. 1000
LOOP
v_text := v_text || '1';
END LOOP;
SELECT v_clob || UTL_RAW.cast_to_raw (v_text)
INTO v_clob
FROM DUAL;
END LOOP;
SELECT DBMS_LOB.getlength (v_clob)
INTO v_len
FROM DUAL;
DBMS_OUTPUT.put_line (v_len);
v_x := v_len;
v_start := 1;
WHILE v_start < v_len AND v_bytelen > 0 AND v_count < 32000
LOOP
DBMS_LOB.READ (v_clob, v_bytelen, v_start, v_raw);
v_text_output := UTL_RAW.cast_to_varchar2 (v_raw);
v_start := v_start + v_bytelen;
v_x := v_x - v_bytelen;
IF v_x < v_bytelen
THEN
v_bytelen := v_x;
END IF;
DBMS_OUTPUT.put_line (v_text_output);
v_count := v_count + v_bytelen;
END LOOP;
END;Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
How to modify/replace the content server(UCM) file/image?
Hi All,
I want to modify the content/file of the Oracle UCM server. Do we have any Oracle UCM/IPM's webservice for this?
For example, content server has a document/file which named as "a.doc". I want to replace this file with "b.doc" without altering any of the meta data.
Kindly let me know if anybody have a solution for this.
Thanks in advance!!
Edited by: 902526 on Mar 20, 2012 1:58 PM
Edited by: 902526 on Mar 20, 2012 2:02 PMHi All,
I want to modify the content/file of the Oracle UCM server. Do we have any Oracle UCM/IPM's webservice for this?
For example, content server has a document/file which named as "a.doc". I want to replace this file with "b.doc" without altering any of the meta data.
Kindly let me know if anybody have a solution for this.
Thanks in advance!!
Edited by: 902526 on Mar 20, 2012 1:58 PM
Edited by: 902526 on Mar 20, 2012 2:02 PM
Maybe you are looking for
-
MSSQL 2005 error COMPUTE_INT_TIMES_OVERFLOW after SP Stack 14
Recently I have updated SAP installation to SP Stack 14. After that I had problems with errors in standard sheduled tasks: I receive COMPUTE_INT_TIMES_OVERFLOW error every hour, together with error "Column name or number of supplied values does not m
-
FCP Studio 7 keyboard shortcut problems
I have had to re-load my FCP7 Studio after a hard drive failure, it's now running under OSX 10.8.5 since the rebuild of the iMac's system etc--However I now find some strange things going on with some keyboard shortcuts and time line actions and I am
-
8Z 775 Error Asset ... has already been revaluated; no futher postings can
Hi gurus, I wrote because I have a problem with transaction J1AI. I'm from Chile and I'm working with 8.928 assets in SAP R/3 6.0. My problem is when I run J1AI transaction just 7.600 assets are revaluated, but 1.328 have the following message: Asset
-
Reader process Zombie in Linux - Blank PDFs
I am having a major issue where we cannot open multiple pdfs from a Suse terminal. As long as I do not close any pdfs out of the browser I can open as many as I want. If I close one out, I cannot open any additional ones as I now have a acroread de
-
Forgot password, not getting reset email.
Hey Spotify, Here's the situation: I have been a happy Spotify Premium customer for many months now. My computer's harddrive was replaced resulting in needing to reinstall Spotify. For the past week I have had Spotify working perfectly on my iPhone