Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Question about insert Picture in Oracle!

Re: Question about insert Picture in Oracle!

From: <ga11742_at_pop.iperbole.bologna.it>
Date: 1998/02/22
Message-ID: <34F015F1.758CD86E@pop.iperbole.bologna.it>#1/1

The type of data to store bynary informations (like pictures) is "LONG RAW"; if you want to store your pictures in ORACLE, you can add a field in your "PRODUCT" table. However Oracle suggests to create a LONG RAW field as the last field of the table, and if possible, to put a LONG RAW field in a separated table:
so, I think the best choise is to create a new table related with the "PRODUCT" table with this structure:

CREATE TABLE <table_name>

                (
                 productid   INTEGER NOT NULL,
                 prod_pict   LONG RAW
                )

PRIMARY KEY productid
FOREIGN KEY productid REFERENCES product (productid)

If you use Access97 to create your interface I think you will use ODBC drivers to access Oracle database; in this case I don't know if these drivers allows you to access bynary data in Oracle. If not, I think you have to write a little program with Oracle tools (ProC) to insert a picture file in Oracle, and to write in a file the content of a LONG RAW field.
If you decide to store your pictures in Access, you will have to programmatically manage relations within Oracle tables and Access tables.

Bye

Dickson wrote:

> Now, I'm working on a project which create a transaction process
> system
> for phone order company. I use Oracle(SQL plus) to create all tables.
>
> Then, I use Access97 to create the user interface.
>
> In the "Product Table", I need to show the product picture for each
> product. So, there is my question:
> 1, Can I store the picture in Oracle?
> If yes, how can I define in the product table?
> And how can I store the picture in the Oracle?
> 2, If I store the picture in Access, how can I assure the picture "A"
> to
> match the product "A"?
>
> There is my Product table in Oracle, created by SQL Plus:
>
> CREATE TABLE PRODUCT(
> ProductID INTEGER NOT NULL,
> ProductName VARCHAR(20),
> ProductDescription VARCHAR(400),
> SellingUnitPrice DECIMAL(3,2),
> UnitOnStock NUMBER(4),
> LeadTime Number(2),
> SupplierID INTEGER,
> PRIMARY KEY (ProductID),
> FOREIGN KEY (SupplierID) REFERENCES SUPPLIER (SupplierID);
>
> Thank you!
> Please e-mail me!
> b5_at_hotmail.com
Received on Sun Feb 22 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US