PL/SQL :: Delete Or Empty Single Field Containing BLOB In Oracle Table?

Jul 8, 2012

I have a table in schema with a BLOB field. I store employee's picture in this field. Fields in this table are emp_id (number) emp_name (varchar2) and emp_photo (BLOB). I want to ask if there is a way in pl / sql that i could empty this BLOB field to null or reset this field so that user can change the saved photo graph and save another one.

what i am looking for is something like

alter table employee set emp_photo = empty_blob() or alter table employee set emp_photo = null

View 3 Replies


ADVERTISEMENT

Save PDF File Content To BLOB Field In Oracle?

Dec 6, 2008

how to write a procedure in oracle to Save pdf file content to BLOB field in Oracle....

View 11 Replies View Related

Application Express :: Export Table Rows To Excel And Save To BLOB Field?

Sep 26, 2012

I try to find out how export data from table to Excel file format and save the result to BLOB field in some other table.I know how to download report from Page by submit, but I need to process data and instead of returning result to user as Excel file - save it in BLOB.

Also I found implementation on JAVA for the issue but actually I wanna study out - Is it possible to resolve this issue by PL/SQL and APEX API methods?

View 4 Replies View Related

SQL & PL/SQL :: Delete Multiple Table Data By Single Query Without Any Condition?

May 10, 2012

can we delete multiples table through the single query?

suppose we have 2 table first one is emp and second is client

i want delete all data from emp and client through the single line query

View 1 Replies View Related

SQL & PL/SQL :: Delete Last N Sets Of Rows Of A Table With Same Dates In Sort Field

Mar 15, 2013

I know how to select the last N sets of rows, using DENSE_RANK - where multiple rows have the same timestamp but I want to only select those rows which do NOT have the top 2 unique timestamps.

i.e.:

SELECT *
FROM ( SELECT DENSE_RANK() OVER (ORDER BY myTimestamp DESC) DENSE_RANK, HISTORYID, USER_ID, myTimestamp, STATUS, FROM TXN_HIST)
WHERE DENSE_RANK > 2 order by myTimestamp DESC, HISTORYID, USER_ID;

But how do I DELETE these same rows?

View 3 Replies View Related

PL/SQL :: Delete Blob Column

Jun 7, 2013

I have these tables:

Products

CREATE TABLE "COMPDB"."PRODUCTS"
   (     "PRO_ID" NUMBER NOT NULL ENABLE,
     "PRO_NAME" VARCHAR2(40 BYTE) NOT NULL ENABLE,
     "COMPETITOR" NUMBER NOT NULL ENABLE,
     "CATEGORY" NUMBER NOT NULL ENABLE,

[Code]..

Now my problem:

In want to delete the blob column(The Content) in Products and the columns, which belong to this column(Filename,Mimetype,Last_update_date).
EMPTY_BLOB() doesn't work

View 4 Replies View Related

CTX-DDL And Blob Field?

Sep 28, 2012

Using Oracle 10g2 I'm trying to create a ctx index, using CTX_DLL atributtes.

begin
CTX_DDL.CREATE_PREFERENCE ('LEXER_SINTILDES', 'BASIC_LEXER');
CTX_DDL.SET_ATTRIBUTE ('LEXER_SINTILDES', 'BASE_LETTER', 'YES');
end;

drop index se.INDEX_PRONUMJNE_CTX;

CREATE INDEX INDEX_PRONUMJNE_CTX on TBL_PRONUM (MyBlobColumn) INDEXTYPE IS CTXSYS.CONTEXT parameters('sync (on commit) LEXER LEXER_SINTILDES');However, I got errors:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: LEXER_SINTILDES
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364

Is it possible to create this kind of indexes for blob fields? Or just for varchar field

View 1 Replies View Related

SQL & PL/SQL :: GET Blob Field From DB And Save Image

Apr 14, 2010

I have a db field "image" of type BLOB and I save the contents to a file on a local folder c: example.bmp.

I found numerous examples

BEGIN -
Get LOB locator
SELECT image INTO l_blob pc_immagini_blob FROM WHERE code = WCI;
- Open the destination file.
l_file: UTL_FILE.fopen = ('C: Temp', 'EXAMPLE.BMP', 'w', 32767); -----> error

The db is not local but on an application server, the image must be saved to c: the client.

View 8 Replies View Related

SQL & PL/SQL :: Reading BLOB Field To REF Cursor

May 27, 2011

I have a procedure which will be called my front end team get the reports stored in the database as BLOB. These reports are mostly PDF files.

I need to read this BLOB field as a part of OUT PARAMETER REF CURSOR which also contains other two columns.

View 13 Replies View Related

PL/SQL :: Load PDF File Into BLOB Field?

May 10, 2013

The SQL below successfully inserts a row into my PDF_TEMPLT table and reads the referenced pdf file into the TEMPLT field. However, the pdf stored in the blob is incomplete or somehow corrupted. It's 438655 bytes long and causes the application that uses it from the database to crash. If I load the same file into the blob field using Quest Software's Toad GUI, it's 438667 bytes (12 bytes longer), and the consuming application works fine. I have the same problem with other pdfs, too, though the difference in length varies from 2 to 17 bytes, with the SQL-loaded blob always being shorter.

why a blob loaded by this SQL would differ from one loaded via Toad, and what changes I'd need to make to this SQL to get it work properly?

DECLARE
l_dir VARCHAR2(10) := 'RPWS_DIR';
l_file VARCHAR2(30) := '5214OR_Rev_1_13.pdf';
l_bfile BFILE;

[Code]......

View 4 Replies View Related

Application Express :: Unable To Upload CSV File Through 4.2 (Blob) To Oracle Table

Jan 4, 2013

I needed to create a page on my existing APEX application that would allow the user to upload a file, I followed an online tutorial where the user had created a dummy table and inserted CSV File inserted through APEX into the table. Following that simple example I am able to load the simple CSV file (from tutorial) into a dummy table (from tutorial) but when I attempt to insert actual/dummy data into my actual database (which has a lot more fields of different types), using the exact same process, I am unable to do so.

Ironically, I am unable to insert even dummy values despite the fact that I have been able to insert the same dummy values using SQL Developer. Icing on the cake is that APEX does not produce any error, this lack of debugging feature (especially line by line debugging) is such a pain. Just to add, I can load the values into an Array and can successfully print the delimited values off the array but am still unable to insert the same values into my table. Here is the table that I am attempting to insert into (actual names replaced by Dummyxx):

CREATE TABLE "TABLE"."STG" (
"DUMMY01" NUMBER,
"DUMMY02" NUMBER,
"DUMMY03" NUMBER,
"DUMMY04" DATE,
"DUMMY05" CHAR(3 BYTE),
[code].........     
                           
And here's the insertion process:

DECLARE

v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
[code]..........

If I run a process to produce the output of the data array onto the screen, the values displayed are in the pattern desired.

Inserting Dummy values instead of values from the Array (v_data_array) to test

EXECUTE IMMEDIATE 'insert into TABLE.STG (DUMMY01, DUMMY02 ..... DUMMY65)

VALUES (
60040,
5,
TO_DATE("14-Dec-12","DD-MON-RRRR HH:MI:SS"),
"ABC",
"ABC",
60,
"11DEC1201",
"331",
"SCOTT TIGER",
"MARKETING",
[code].......

Note that all the the CSV does not contain all the fields, the CSV files that are expected to be entered into the system contain 65 Fields whereas the Table has 73 Fields. Also note that the process runs fine through SQL loader that is invoked through a different server which I need to release and hence the attempt to load the table this way. Also, the procedure on the SQL Loader server is quite complex and involved JAVA+Unix Shell Scripts etc. which I would prefer to avoid.

View 1 Replies View Related

SQL & PL/SQL :: Delete One Particular Field Value In A Row?

Feb 22, 2010

How to delete one particular field value in a row?

Constraint: There should be no null value or zero instead of deleted value. Other values remain unchanged.

View 14 Replies View Related

SQL & PL/SQL :: How To Write Single WITH For A Update And Delete

Mar 13, 2012

Can I achieve the merge (update-only) and delete in a single SQL statement?

merge into table_4
using
(select table_3.col1 col1,table_3.col2 col2,
from table_1, table_2, table_3
where
[code].....

delete from table_3 where <records identified in the 'using' clause of above merge>;

i.e.

delete from table_3
where (table_3.col1,table_3.col2)
in ( select table_3.col1,table_3.col2,
from table_1, table_2, table_3
where
join conditions.....
other conditions ....
group by table_3.col1, col1,table_3.col2
having count(*) >1 );

What I want is roughly as following :

WITH mywith as ( select table_3.col1,table_3.col2,
from table_1, table_2, table_3
where
join conditions.....
other conditions ....
group by table_3.col1, col1,table_3.col2
having count(*) >1 )
update table_4 set col3='N' where table_4.col1=mywith.col1 and table_4.col2=mywith.col2
delete from table_3 where table_3.col1=mywith.col1 and table_3.col2=mywith.col2;

View 5 Replies View Related

RMAN :: Backup And Delete Single Archivelog?

Dec 14, 2012

May I know what is the command for rman to backup and delete single archive log?

View 15 Replies View Related

Oracle 10g - Delete 1000 Table?

Dec 21, 2007

I have 1000+ tables in a DISCOVER tablespace in 10g.

I need to drop ALL tables in this area and leave the tblsp intact so that I can IMP a data update from 9i (prod) into 10g (test).

Is there an easy cmd to drop all the tbls, or am I missing someway to do this in DB Console for 10g.

View 3 Replies View Related

SQL & PL/SQL :: Delete Redundant Table In Oracle?

Apr 23, 2012

Is there a SQL query to find out the redundant or unused table in Oracle.

Some tables shows no dependencies to itself or other schemas,but has got valid data in it, deleting it will affect the functionality of the system.

View 3 Replies View Related

Oracle 9i - Delete Data One By One From Particular Table

Oct 28, 2008

I need to create a stored procedure in Oracle 9i which will automatically delete data one by one from a particular table and then by means of same procedure insert record one by one in same table.

View 6 Replies View Related

Forms :: Delete Detail Block Single Record

Apr 22, 2010

My form consist two datablock cust_mstr,cust_dtls, each customer code consists two or three contact details records, when i delete the single detail record instead of deleting single record it deletes all the details records from cust_detail table.

Here by i attaching my form for your reference pls find the code in delete button

View 12 Replies View Related

Forms :: Insert / Update And Delete Single Record At A Time?

Aug 10, 2005

I have multirecord block and I want to disable Inserting/Updating/Deleting more then one record at a time.

View 32 Replies View Related

SQL & PL/SQL :: Get Single Row From Multiple Duplicate Values Of One Field?

Sep 10, 2012

CREATE TABLE prim_tbl
(id NUMBER,--- id is not primary key here
description VARCHAR2(30));

INSERT ALL
INTO prim_tbl VALUES (1,'aad')
INTO prim_tbl VALUES (1,'aads')
INTO prim_tbl VALUES (2,'bb')
INTO prim_tbl VALUES (2,'cc')
INTO prim_tbl VALUES (2,'dd')
SELECT * FROM dual;

I want to select the ids only one time, i.e my output will have only two rows: one row with id as 1 and other row with id 2 whatever be the description.

desired output sample:

Quote:1, aad
2, bb

I used:
select distinct(id),description from prim_tbl;

but it did not give the required result.How can I get it??

View 6 Replies View Related

PL/SQL :: To Delete Child Records Manually Without Using Oracle Delete Cascade

Oct 9, 2012

I have to write a procedure that accepts schema name, table name and column value as parameters....I knew that i need to use metadata to do that deleting manually.

View 9 Replies View Related

How To Delete Table Information In SQL Loader Log File Output In Oracle

Jan 19, 2011

I have a SQL Loader Log File Output. I would like to delete Table Information from the output file.Following is my code.

//PATH OPENED AS TEXT BY STREAM READER
System.IO.StreamReader strm = File.OpenText(batchFileName);
//OUTPUT

[Code]....

View 8 Replies View Related

Find Situations Where Single Unique Value Of Field A Has Both Values Z AND X In B?

Feb 19, 2011

In literal terms, I'm interested in two fields, I'll call them Field A and Field B. I want to find all situations where a single unique value of Field A has both values Z AND X in Field B (not either or, but both together).

To go into some detail -

I need to make a query that finds ONLY occurrences where one employee id has a certain set of values together (without going into specifics, I'll say PermissionA, PermissionB, PermissionC). I can easily make a query that returns all user id's and all permissions belonging to them, and I can use criteria to filter the results to Permission A B and C only so as to exclude other permissions from getting returned (since there are hundreds),

however my objective is to get ONLY results where the same employee ID has all of those permissions (not just any one or two of the three). However, I don't want to have any criteria that limits the employee ID (I want to search all employee id's, and get a list of those with permissions a and b and c, not just any combination thereof, but all of them). I'm currently able to organize the output using a pivot table by employee id > role,

so that I can easily look at each employee and the roles they have, but I want to undertake a project that will involve searching a much larger number of employees (a # that makes it impractical for me to look through the list, I need to have a query that limits the results to the combinations that I'm looking for, as in this example - permission a b and c together).

View 1 Replies View Related

SQL & PL/SQL :: Load Data Into Empty Table?

Jul 25, 2011

There is one table with data in ORCL1 database.I have created the table using create table statement in ORCL2 database.Now i want to insert only the data into table.

I know one method ... drop the table i created using drop table statement and then create the table with data using export/import.

Is there any other way we can load data into empty table?

View 29 Replies View Related

PL/SQL :: External Table With Empty File

Oct 9, 2013

My db version: Oracle 11g I have an empty csv file.I created a external table for the empty csv file.When I run:select count(*) from externaltblname;It returns 1. It should return 0 right. In the definition, I specified "SKIP 1"But still it returns 1. When I use this external table to load into a target table. It loads a single row with null values.How to fix this.

View 2 Replies View Related

SQL & PL/SQL :: Changing Field Type In Oracle Table

Dec 13, 2011

I have uploaded some tables from MS Access to Oracle and in the process, some Number fields have been converted to Text. This means that any Queries where there are calculations with those fields (which have been converted to text) don't work properly anymore.

I would like to change the field type from text to number (with cmd and sqlplus) as that's the only way I can access the oracle backend.

I am not sure what commands to use to change this.

Also, if I change the data type from text to number, is it likely I will lose some data?

And how do I backup the table before I do this?

View 3 Replies View Related

Forms :: Hide A Single Row Field Of Multi Record Item?

Nov 3, 2010

Consider below is a multi record block rows, i want to hide "23". Is it possible using Set_Item_Instance_Property or any other built-in is there in oracle forms to hide a single row field in a multi record block.

11 12 13
21 22 23
31 32 33
. . .

View 3 Replies View Related

Reports & Discoverer :: Formatting - Display Value Of Field In Single Line

Oct 20, 2010

I have developed one report but need one formatting suggestion. There is one field called "DESCRIPTION", I want the value of this field to be displayed in a single line. Now the big values are wrapped into multiple line.

Now,

DISPLAY
----------------
This is a Oracle
Report.

I want,
DISPLAY
------------------------
This is a Oracle Report.

Maximum size of "DISPLAY" field is VARCHAR2(240).

View 3 Replies View Related

Field Constraint For Days Of Week Using Single Letter Representation

Jul 6, 2013

I know I can add a check constraint for m,t,w,r,f,s,u How can I add a constraint that will allow any combination of the above. For example it would allow m or mf, or mwf Someone said it could be done with trim but I can not figure it out.  

View 1 Replies View Related

Empty Blocks In First Place On Loading A Table

Jan 4, 2011

what empty blocks are, and how to remove them.What I'd like to do is not have empty blocks in the first place on loading a table. I load a lot of "static" tables and would like to not have any wasted space at the end, with minimal shinanigans.

I've set pctfree 0
I"ve set initial to close to the end table size
I've set next to 1M
I've set pctincrease 0
blocksize is 8k

Yet I still need to at least do an alter table deallocate unused

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved