Associative array type for each blob column in the table

i am using the code in given link
http://www.oracle.com/technology/oramag/oracle/07-jan/o17odp.html
i chnages that code like this
CREATE TABLE JOBS
JOB_ID VARCHAR2(10 BYTE),
JOB_TITLE VARCHAR2(35 BYTE),
MIN_SALARY NUMBER(6),
MAX_SALARY NUMBER(6),
JOBPIC BLOB
CREATE OR REPLACE PACKAGE associative_array
AS
-- define an associative array type for each column in the jobs table
TYPE t_job_id IS TABLE OF jobs.job_id%TYPE
INDEX BY PLS_INTEGER;
TYPE t_job_title IS TABLE OF jobs.job_title%TYPE
INDEX BY PLS_INTEGER;
TYPE t_min_salary IS TABLE OF jobs.min_salary%TYPE
INDEX BY PLS_INTEGER;
TYPE t_max_salary IS TABLE OF jobs.max_salary%TYPE
INDEX BY PLS_INTEGER;
TYPE t_jobpic IS TABLE OF jobs.jobpic%TYPE
INDEX BY PLS_INTEGER;
-- define the procedure that will perform the array insert
PROCEDURE array_insert (
p_job_id IN t_job_id,
p_job_title IN t_job_title,
p_min_salary IN t_min_salary,
p_max_salary IN t_max_salary,
p_jobpic IN t_jobpic
END associative_array;
CREATE OR REPLACE package body SHC_OLD.associative_array as
-- implement the procedure that will perform the array insert
procedure array_insert (p_job_id in t_job_id,
p_job_title in t_job_title,
p_min_salary in t_min_salary,
p_max_salary in t_max_salary,
P_JOBPIC IN T_JOBPIC
) is
begin
forall i in p_job_id.first..p_job_id.last
insert into jobs (job_id,
job_title,
min_salary,
max_salary,
JOBPIC
values (p_job_id(i),
p_job_title(i),
p_min_salary(i),
p_max_salary(i),
P_JOBPIC(i)
end array_insert;
end associative_array;
this procedure is called from .net. from .net sending blob is posiible or not.if yes how

Ok, that won't work...you need to generate an image tag and provide the contents of the blob column as the src for the image tag.
If you look at my blog entry -
http://jes.blogs.shellprompt.net/2007/05/18/apex-delivering-pages-in-3-seconds-or-less/
and download that Whitepaper that I talk about you will find an example of how to do what you want to do. Note the majority of that whitepaper is discussing other (quite advanced) topics, but there is a small part of it that shows how to display an image stored as a blob in a table.

Similar Messages

  • Problem with download link for a BLOB Column in a "Classic report"

    I am having a problem where I cannot make a download link for a blob column function in a "classic" (non-interactive) report. I went through the tutorial on this topic and it was great help it working out the minor bugs, but I get a 404 error (apex_util.get_BLOB not found). For testing purposes I went ahead and created a an identical report on the same page that is an "Interactive report" and it works like a charm. Same query, same BLOB formatting Mask, pulling data from the same table. So, it really doesn't seem like an issue with the grants, since both reports should be executing as the same user.
    I know it sounds like the obvious answer is to just go with the interactive report and my problem is solved, but the rest of this site uses classic reports, and I don't need the sort features of an interactive report, and the slightly different style of the the report really stands out even if I turn off all the bells and whistles. I don't want to change the css to make them look identical, I just want a regular report to work.

    I eventually found another post: APEX_UTIL.GET_BLOB was not found on this server
    In this post there is the suggestion of putting "dbms_lob.getlength("var")" after the date field in your select. So I changed my query to have it at the end, and now my format mask (DOWNLOAD:table_name:ATTACHED_FILE:FILE_ID::FILE_MIME_TYPE:FILE_NAME:::attachment:Download) works like a charm, in a classic report.

  • Output type is generating for each spilt batch in the delivery

    Hi All,
    We are using Z output type for COA - EDI processing which uses standard program RSNASTED. I observed that  output type is triggered for each individual batch in the delivery . I want to know how can I restrict to trigger output type only for item instead of each barches. Can I get some solution in the output type configuration (NACE) to trigger output type for item level.
    Regards,
    Uday

    Udaya,
    I got the fix. There was wrong output procedure maintained to the output type.
    What was the reason for different output behavior for output type ZXYZ?
    1.Output type-ZABC- Triggering for both item and batch
    10 - Main Material - 30 EA - ZTAN- contains output determination in V/73
    90001 - Batch-001 - 10 EA - ZBAT
    90002 - Batch-002 - 20 EA - ZBAT
    2.Output type-ZXYZ- Triggering only for Item
    10 - Main Material - 30 EA - ZTAN
    90001 - Batch-001 - 10 EA - ZBAT
    90002 - Batch-002 - 20 EA - ZBAT
    Thanks!

  • Is it mandatory to populate USER_SDO_GEOM_METADATA for each spatial column ?

    Hello,
    I would like to know if we HAVE to populate the metadata table for a geometry column that will never be indexed.
    (I know that in the documentation it is said "For each spatial column,
    you must insert an appropriate row into the USER_SDO_GEOM_METADATA view.")
    Thanks
    Hugues

    Hi Hugues,
    There are many spatial operations that make use of the user_sdo_geom_metadata table, not all of them index related (operators).
    If your data hasn't been migrated to 8.1.6 format then not much will work if user_sdo_geom_metadata is not populated.
    If your data is migrated:
    You won't be able to validate your data (we check the data to the bounds of the coordinate system).
    You won't be able to use linear referencing (also known as dynamic segmentation).
    You won't be able to use any spatial operators (which require a spatial index).
    You won't be able to use coordinate systems (or least some parts of coordinate systems).
    The above might only be a partial list.
    hope this helps, and regards,
    dan

  • Changing preferred font types for each language separately in Safari

    Hi, I'm wondering in Safari->Preference->Appearance, you can change the default fonts for your main language, which is most likely English.
    However, if I want to change font types for each specific language, e.g. Japanese or Traditional Chinese, how could I do that? I assume that if I change in the Appearance menu, it's global to all languages (e.g. English)?
    Just to illustrate my question, in Firefox, I can go to Firefox->Preference->Content-> Fonts&Colors->Advanced, then I can change the font types for each language separately.
    How do I do similar things in Safari in Leopard? Thanks.
    Message was edited by: nmuns
    Message was edited by: nmuns

    But it seems very weird that for all the beautiful font types in Mac OS, the users are only stuck with the default font type only?
    Perhaps, but it's just an example of how different browsers and apps offer different features. You should use the browser that works best for you. While FireFox may be good for that feature, it can't display some languages, like Hindi, correctly at all.
    It is possible to change the font using a custom style sheet, which you can select via the advanced item in Safari preferences, but I don't think there is any way to do this on the basis of language.
    What language are you specifically interested in changing the default font for? If you are getting the wrong kind of font for CJK (for example, seeing Japanese character types instead of the Chinese ones in Chinese text), this might be fixable by changing the language order in system prefs/international/languages.

  • Different format template for each amount column?

    Greetings.
    Is it possible to assign diffrent format template for each amount column in Excel workbooks?
    I'll explain a bit more specific.
    Suppose there's a BW report to Excel as below.
          column1   column2   column3
    row1 111,111   222,222   333,333
    row2 111,111   222,222   333,333
    row3 111,111   222,222   333,333
    All columns are amounts, so the assigned format templates are all 'SAPBEXstdData'.  Here, the needs is that each column have the format of their own, such as 'Centered, large font size, bold, red color, etc'.
    I found out in SAP help portal that I can create workbook templates which include custom format templates, such as OurColumn1Template.  I also found I can use the workbook templates when opening BW queries.  But it doesn't seem possible to automatically specify format template OurColumn1Template is for column1 when creating a new Excel report from BW query or refreshing a query from a Excel report.
    How I can control which format template is assigned for which column? No way?
    By the way, we are on BW3.5.
    Thank you,
    T.Yamagiwa

    Oh my, I found out! It's easy, in a sense.
    We use MS Office 2003, so in the first place we need to change security setting about macro, by the SAP note below.
    Note 574596 - BEXAnalyzer SAPBEXOnRefresh is missing on Office XP
    https://websmp110.sap-ag.de/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=574596&_NLANG=E
    Now that we've got SAPBEXOnRefresh module in a newly created Excel workbook, the rest we need to do is copy the SAPBEXOnRefresh module to the existing workbook, then code the module, like below.  (this is only doing left-justification)
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
        Columns("I:I").Select
        With Selection
            .HorizontalAlignment = xlLeft
        End With
    End Sub
    I should have search the forum more carefully...hope somebody will find this post kind of useful in the future.
    Regards,
    T.Yamagiwa

  • How to update a BLOB column in a table with a file in local machine?

    I have a file (of XML type) in my local machine. I want to update it in a BLOB column of a table in databse server. Can anyone help me in this regard. Appreciate your help.
    Regards
    Walter Nicholas

    user447427 wrote:
    I have a file (of XML type) in my local machine. I want to update it in a BLOB column of a table in databse server. Can anyone help me in this regard.That's the client's job to read data on the client PC (from keyboard/mouse/scanner/file/whatever input) and submit that to the database server for processing and/or storage.
    You cannot expect the server to hack into your PC and lift that data in the file from your disk. Not that is not technically possible. You can wire rockets onto a bicycle to make it go faster, but that's not a wise thing to do. Similarly, it is not a bright idea to ignore the very basics of client-server.
    Bottom line - you need client s/w on your PC to load the content of that file into Oracle. It can be done using SQL*Loader as already suggested. It can be done using a web browser (submitting it via HTTP to web-enabled PL/SQL code). You can use FTP or WebDav and upload into Oracle's XDB (XML database).
    Your requirements will determine what client to use. Once off load? SQL*Loader is very easy to use for loading XML files into the database.

  • Insert Blob column in the client errors ClassCastException: oracle.sql.BLOB

    Hi,
    When I try to insert and commit a Blob column(picture) I am getting the following exception.
    Is there any jar I need to add or any other setup I need to do to accept the BLOB column in the olite client database.
    500 Internal Server Error
    javax.faces.FacesException: #{backing_XXPBWorkOrderResultsCreatePGBean.saveButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.sql.BLOB
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
    Caused by: java.lang.ClassCastException: oracle.sql.BLOB
         at oracle.lite.poljdbc.LiteEmbPreparedStmt.setVal(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.web.JupPreparedStatement.setObject(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindUpdateStatement(BaseSQLBuilderImpl.java:1765)
         at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:7345)
    With regareds,
    Kali.
    OSSI.

    Here are examples if inserting into a Blob from text, file, and retrieving a blob.
    Insert into a Blob (Text)
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class InsertBlob {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            String letterText = "some letter text";
            long id = 100;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, EMPTY_BLOB())");
                stmt.setLong(1, id);
                stmt.executeUpdate();
                stmt = con.prepareStatement("SELECT BLOB_DATA FROM BLOB_TABLE WHERE BLOB_ID = ? FOR UPDATE");
                stmt.setLong(1, id);
                rs = stmt.executeQuery();
                if (rs.next()) {
                    try {
                        oracle.lite.poljdbc.BLOB oliteBlob = null;
                        oliteBlob = ((oracle.lite.poljdbc.OracleResultSet) rs).getBLOB(1);
                        byte[] byteLetterText = letterText.getBytes();
                        oliteBlob.putBytes(1, byteLetterText);
                        con.commit();
                    } catch (ClassCastException e) {
                        e.printStackTrace();
                    } finally {
                        rs = null;
                        stmt = null;
                        con.rollback();
                        con = null;
            } catch (SQLException e) {
                e.printStackTrace();
    }Insert Into a Blob (File)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class InsertBlobFile {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            long id = 200;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, ?)");
                stmt.setLong(1, id);
                File fBlob = new File ( "C:\\BLOB_TEST_FILE.TXT" );
                FileInputStream is = new FileInputStream ( fBlob );
                stmt.setBinaryStream (2, is, (int) fBlob.length() );
                stmt.executeUpdate();
                con.commit();
            } catch (SQLException e) {
                e.printStackTrace();
    }Retrieve from Blob (Write to file)
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class RetrieveBlob {
        final static int bBufLen = 32 * 1024;
        final static String outFile = "C:\\BLOB_OUTPUT_FILE.TXT";
        public static void main(String[] args) throws IOException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("SELECT * FROM BLOB_TABLE");
                rs = stmt.executeQuery();
                while(rs.next()) {
                    int id = rs.getInt(1);
                    Blob value = rs.getBlob(2);
                    System.out.println(id + " | " + value);
                    writeBlobToFile(value);
            } catch (SQLException e) {
                e.printStackTrace();
        public static long readFromBlob(Blob blob, OutputStream out)
          throws SQLException, IOException {
            InputStream in = blob.getBinaryStream();
            int length = -1;
            long read = 0;
            byte[] buf = new byte[bBufLen];
            while ((length = in.read(buf)) > 0) {
                out.write(buf, 0, length);
                read += length;
            in.close();
            return read;
        public static long writeBlobToFile(Blob blob)
          throws IOException, SQLException {
            long wrote = 0;
            OutputStream fwriter = new FileOutputStream(outFile);
            wrote = readFromBlob(blob, fwriter);
            fwriter.close();
            return wrote;
    }

  • Query regarding the data type for fetcing records from multiple ODS tables

    hey guys;
    i have a query regarding the data type for fetcing records from multiple ODS tables.
    if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
    can any one help with some suggestion.

    Hi Mudit,
    One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
    AS is used to rename the column name when data is being selected from your DB.
    So, the query  Select ename as empname from emptable will return the data with column name as empname.
    Regards,
    Bhavesh

  • How to create an inspection lot for each line item of the Purchase order?

    Hi,
    How to create an inspection lot for each line item of the Purchase order ?
    In detail if possible.

    Hi
       please check this
    [thread|Create Inspection Lot;

  • Printing Terms and Conditions for each Purchase order in the RDF output

    Hi All,
    Present i have an RDF report with the registered concurrent program. when i run this concurrent program i am getting the terms and conditions at the end of the purchase orders only once(for example 10 purchase orders). Now the requirement is to get this terms and conditions printed for each purchase order. The output is in PDF format. It's an 11i RDF report. Can any one suggest me the methods how to do this? Please give me reply as soon as possible.
    Thankyou in advance
    Regards,
    Polimera

    Hi, Polimera
    Welcome to OTN
    Present i have an RDF report with the registered concurrent program. when i run this concurrent program i am getting the terms and conditions at the end of the purchase orders only once(for example 10 purchase orders). Now the requirement is to get this terms and conditions printed for each purchase order. The output is in PDF format. It's an 11i RDF report. Can any one suggest me the methods how to do this? Please give me reply as soon as possible.
    Take a fixed frame inside the purchase order master repeating frame and place your terms and condition inside the fixed frame.
    Hope this helps
    If someone response is helpful or correct, please mark is accordingly

  • How to Upload a PDF file into BLOB column in a table using Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Hi,
    please, search a bit on the forum before do a question:
    Just searching by "upload blob pdf" ...
    How to batch upload PDF files into database BLOB
    Regards,
    Jose.

  • How to Upload a PDF file into BLOB column in a table using Forms 6i

    Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
    Thank´s.

    If you are using version 9 or 10 use webutil.... Look in webutil.pll.
    Use either one these two fuctions...
    FUNCTION Client_To_DB( clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;
      FUNCTION Client_To_DB_With_Progress
                         (   clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             progressTitle    in VARCHAR2,
                             progressSubTitle in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;

  • How to find out the NULL columns in the table?

    Hi,
    Please provide the query to find the null columns in the table. Here, all rows in the table have same column as null. It won't change.
    Table
    c1 c2 c3 c4
    X C 10
    T D 20
    I wanna find out as C2 is the nullable column.
    Thanks in advance !!
    Regards,
    Vissu....

    Below code might be solution for finding NULL valued in columns in a table and if it is solution .kindly give me points for the same.
    declare
    cursor col_cur is
    select column_name
    from user_tab_cols -- all_tables can also be used in case the table is present in own schema
    where table_name = 'TABLE_NAME'; --provide the TABLE_NAME  
    stmt varchar2(1000):= '';
    v_count number;
    count_null number;
    begin
    execute immediate 'select count(*) from TABLE_NAME' into v_count; --provide the TABLE_NAME  
    for rec in col_cur loop
    execute immediate 'select count(*) from TABLE_NAME' where --provide the TABLE_NAME  
    '||rec.column_name||' IS NULL' into count_null;
    if count_null = v_count then
    stmt :=stmt|| rec.column_name ||chr(13);
    end if;
    end loop;
    dbms_output.put_line(stmt);
    end ;

  • The column in the table do not match an existing primary key

    I've got two tables tbl_Workshop and tbl_Material
    tbl_Workshop has columns workshopID, workshopTitle, materialID
    tbl_Material has materialID, name, workshopTitle
    when I'm trying to create a relationship between the workshopTitle of tbl1 and tbl2, it gives me an error that says the column in the table do not match an existing primary key.
    What could be the reason for this error and how to overcome it.
    ps. The datatypes and names of both the table's column match.

    Have you created primary key on workshopTitle column in tbl_Workshop
    You can add foreign key relationship from tbl_Material.workshopTitle
    to tbl_Workshop.workshopTitle
     only if latter is a primary key of the table.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Location to download IPS software upgrade Version 7.1(5)E4

    Hi, In last month I found latest released IPS software version 7.1(5)E4 for IPS appliance 4260 on cisco site. However it is no more available over there now can I have exact download location of the software upgrade as I want to upgrade my device wit

  • Pdf files in epubs

    Is it possbile to link a pdf file to copy/hyperlink in an InDesign file that I am exporting to an ePub?

  • Different ways to invoke a servlet from another servlets?

    Hello, I am a bit confused today. I was thinking about all the ways by which I can invoke a servlet from another servlets. I know it can be done by creating an instance of the 2nd servlet in the 1st one. Is there any other way? such as say.... Reques

  • How do i get my old version back

    you automatically updated me to 29. I lost my bookmark star in the address bar. I lost my search bar. The tabs are difficult to decipher. I tried changing appearance, etc, and now it's worse. All I want is my recent version back with above reinstated

  • HT4061 my ipad wont charge or come on

    i pad wont come on.tried to get it working but wont come on