Insert Image to table from a Non Database Field

Hallo,
db- 9i EE R2
forms - 6i R2
OS - W2003
I have a requirement to upload Images to the database from forms.
I planned to keep the transaction data and the Images separately in different tables with a reference.
So, I created the Image field (BLOB)  with a Non Database Field in the Form and use a button to upload the Image. (using READ_IMAGE_FILE).
I tried to insert the Image to the Actual Image table in PRE-INSERT Trigger at block level.
But I was not able to Insert the using reference method.  (Cannot compile the PRE-INSERT)
      INSERT INTO IMAGE_TB (ID,IMAGE)
       VALUES (IMAGE_SEQ.NEXTVAL, :ITINERARY_MAP.IMAGE);
So, Please help me to insert a image to different table from a Non Database Field?
Thanks

I don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.

Similar Messages

  • Inserting image into table

    hi,
    i m create table, then create procedure, procedure is successfully compile, but when i m trying to insert image into table it error out.
    for inserting image i go with
    EXECUTE insert_image_file(1,'C:\sunset.jpg');
    sunset.jpg is image which i want to insert in table, and which is present on 'c drive'.
    when execute the following error are shown
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.DBMS_LOB", line 635
    ORA-06512: at "SCOTT.INSERT_IMAGE_FILE", line 26
    ORA-06512: at line 1
    how to solve it.
    regards
    prashant

    Prashant wrote:
    CREATE OR REPLACE PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)
    ...snipped...Not very nice code... why create an empty image row, then lock it (it is already locked by the uncommitted insert statement), and then update it again? Not very efficient or sensible.
    image is on local machine.When a row is created on the server from user input on some PC, who supplied that input? Who read the user's keyboard input on that PC to obtain the values for the columns for the row to create?
    Did PL/SQL read the keyboard of that remote PC? Of course not. The client program on that PC read the keyboard input. It then made a client call to the Oracle server. It supplied the data entered via the keyboard by the user to the Oracle server (using a PL/SQL call or using a SQL statement call to Oracle).
    Now why would a local image data on that PC be treated any differently than the keyboard data on that PC? How can you expect PL/SQL code running on the Oracle server, to read that image data from the remote PC when the same PL/SQL code is incapable of reading keyboard input from that very same PC?
    You need to review your understanding of client-server and how it pertains to using Oracle within client-server architecture.

  • How to import a table from another oracle database ?

    Hi all ,
    i could like to use pl/sql to import one table from another oracle database server ?
    is it possible to do this ?
    A server B server
    table: test <------------------------> table : newtest
    the tns profile already configurated . the connection is ready .
    thanks a lot !
    Best Regards,
    Carlos

    if i don't have TEST table on server B whether COPY command will create this table on server B with the same structure ? If you specify CREATE as a clause the table will be created:
    SQL> help copy
    COPY
    COPY copies data from a query to a table in a local or remote
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                APPENDCREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[password]@connect_identifier

  • How do I get a value from a portal form for a non database field ? HELP!!

    I have a form based off of a table that I added a field to. The form is to allow the user to change abbreviation for a
    department field ie. BIO to BIOL. for a biology department. I have a pl/sql procedure for validation using the custom option
    on the update button to verify the user and update the data. I have tested to code at the sql prompt and it works.
    They only difference between the prompt and the form is the non-database field new_dept_abbr was added to the
    form. I don't know how to capture the value of the user input into a variable that can be used in the pl/sql.
    Any help would be appreciated.
    I have tried this approach
    v_new_dept_abbr := p_session.get_value_as_varchar2(
    p_block_name => 'default',
    p_attribute_name => 'new_dept_abbr'
    have tried using p_attribute_name as 'a_new_dept_abbr' but this does work and does not exist in the body of the form.
    Have also tried setting the p_block_name to _session - still doesn't work.
    Any ideas??
    Thanks
    Debbie Brennan

    Thanks for the info. I tried that and it still doesn't pull the value. I have opened a TAR via metalink, but I'm not getting any
    satisfactory answers. I ran across an note - 137172.1 that has this snippet of information in it.
    Unfortunately, at this time (portal 3.0.7.6.2) , a non-table item cannot be
    referenced in a plsql event handler, only in client side JavaScript code. This
    is a known limitation and will be fixed in a future release.
    I don't know how to get the value from the client side JavaScript code to a pl/sql variable. Do you?
    I've been trying to get them to tell me if the 'known issue' has been addressed in 3.0.9.
    I'll keep at it. Thanks so much for your suggestion I appreciate it.
    Deb

  • How to display records from a query into non-database field

    Hi
    I a have a problem:
    I have a query with many tables and 6 column(select a,b,c,d,e,f from x,y,z,t,s,g where conditions) and I use 3 parameters.
    I create 3 parameters :datai,:dataf and :partener and a button with a trigger when button is pressed.
    Then a create a manualy block with six field non-database a1,b1,c1,d1,e1,f1.
    Now I want to display all the records from my query into a1,b1,c1,d1,e1,f1 where a1=a,b1=b,etc. and all the records (if I have 20 record, it will display 20 records in non-database field) when I press the button.
    How I made:
    I create a cursor with query then
    begin open cursor
    loop
    fetch cursor into :a1,:b1,:c1,:d1,:e1,:f1;
    end loop;
    close cursor;
    end;
    It display one record in a1,b1,c1 only and it have to display 100 records and are date for all the fields.
    Can somebody help me in this problem?
    Thanks.
    Edited by: 928437 on Oct 1, 2012 2:55 AM

    Creating a view, and querying that into a database block is an excellent solution.
    To use the non-database block:
    You're missing the all-important Next_Record; command.
    <pre> Begin
    Go_block('X'); -- block X is the non-database block
    Clear_Block(No_Validate);
    open cursor X1;
    loop
    If :System.Record_status != 'NEW' then
    Next_Record;
    End if;
    fetch X1 into :a1,:b1,:c1,:d1,:e1,:f1;
    Exit when X1%NOTFOUND;
    end loop;
    close X1;
    end;</pre>

  • How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?

    How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
    I tried using DROP Tables, Truncate Database, Delete and many more but it is not working.  I want to delete all tables using Query Analyzer, i.e. through SQL Query.
    Please help me out in this concern.
    Nishith Shah

    Informative thread indeed. Wish I saw it early enough. Managed to come up with the code below before I saw this thread.
    declare @TTName Table
    (TableSchemaTableName
    varchar
    (500),
    [status] int
    default 0);
    with AvailableTables
    (TableSchemaTableName)
    as
    (select
    QUOTENAME(TABLE_SCHEMA)
    +
    +
    QUOTENAME(TABLE_NAME)
    from
    INFORMATION_SCHEMA.TABLES)
    insert into @TTName
    (TableSchemaTableName)
    select *
    from AvailableTables
    declare @TableSchemaTableName varchar
    (500)
    declare @sqlstatement nvarchar
    (1000)
    while 1=1
    begin
    set @sqlstatement
    =
    'DROP TABLE '
    + @TableSchemaTableName
    exec
    sp_executeSQL
    @sqlstatement
    print
    'Dropped Table : '
    + @TableSchemaTableName
    update @TTName
    set [status]
    = 1
    where TableSchemaTableName
    = @TableSchemaTableName
    if
    (select
    count([Status])
    from @TTName
    where [Status]
    = 0)
    = 0
    break
    end

  • Insert image into table

    Please let me know how to insert images to table using SQLDeveloper?

    Some history...
    SQL Developer 1.2.1 actually does support loading BLOBs and it has an internal viewer that can display some, but not all, common extensions (e.g., jpeg images will display, but not flv - flash). The 1.2.1 UI is different than the 3.0/3.1 UI Jim describes in his blog post: double clicking on a BLOB cell in the Table Data tab causes it to display a "..." at the right-side of the cell. Clicking that takes you to the Edit Value dialog where Load/Save/View capability resides.
    External editor support was in place at least by 2.1, but large BLOBs seem rather slow to load. Improved performance and the current UI appeared at least by 3.0, including the Pencil icon and the hyperlinks.
    -Gary

  • Insert Data into Table from TXT or CSV file !!!!!

    Dear All,
    Recently I have started working on APEX. In Oracle Forms, we used to use TEXT_IO for inserting records into tables from txt files. Now I want to do the same thing in apex 3.2. How can I insert data into tables from txt of csv files.
    Waiting of your valuable suggestions.
    With kind regards,
    Yousuf.

    Yousuf
    wwv_flow_files is used by APEX to hold uploaded files.
    If you incorporate a file browse item on you page, browse for the selected file, then submit the page (having the PL/SQL process described as an on suibmit process) then what I detailed should work.
    If you don't need users to have access to this then just go to Home>Utilities>Data Load/Unload in APEX and there is a handy load utility there that does it all for you.
    Cheers
    Ben

  • Creating a non database field

    Hi.,
    i am using jdev 11.1.5
    i need to insert a non database field in jspx page
    i had created a table finperiod
    i need to insert a four nondatabse fields named as rec,dist,supl,cust.
    How can i acheive this?

    i need to acheive this querry in adf
         select count(*) into var_count
         from appl_journals
         where aj_bu=:global.bu and
         aj_year=:FIN_PERIODS.fp_year and
         AJ_PLANT =:FIN_PERIODS.FP_PLNT AND
    aj_period=:FIN_PERIODS.fp_period and
         aj_appl=:AJ_APPL and
         aj_status='N' ;
         if var_count<>0 and :AJ_APPL is not null then
              :APPLICATIONS.appl_exist:='Yes';          
         elsif :AJ_APPL is not null then
              :APPLICATIONS.appl_exist:='No';
         end if;
    how can i perform this

  • Xml file, non database field etc..

    Hi,
    There is a requirement for putting a non database field in an
    infobus grid control and populating it with some value at the
    runtime. As this is not directly available in gridcontrol, many
    have tried using a join query as I could see from the
    postings.(Like select deptcode,desc from emp, dept where
    emp.deptcode = dept.deptcode). This works well when the data is
    queried from the database. But when a new deptcode is entered, it
    is not possible to get the corrosponding value from the database
    and show it on this field, as u get readonly attribute error.
    Even if u explicitly change the attribute to updateable the error
    will remain as such.
    The cause of this problem, I have tracked down to the xml file.
    The entity for the updateable table (in this case EMP) does not
    have the attribute for deptdesc. If this is manually added, it is
    possible to add values to the deptdesc column. The catch is when
    inserting a row to the database. All the attributes in the
    entity
    will appear in the insert statement and u end up with an invalid
    column name error for the deptdesc column.
    Seeing this consistant behaviour, I assume that the insert
    statement is created by parsing the xml file. Had there been an
    attribute value in the xml file for insert into database (just
    like IsNotNull etc.. perhaps IsUpdateable which can be set
    manually), while parsing this attribute can be removed.
    To do this I would like to know where this xml parser is
    implemented in jdev. Is it possible for me to change its
    behaviour or can I expect to get a patch for this? This
    functionaliy is very much essential for me, as I am in the middle
    of a very large project using jdev2.0. I don't mind implementing
    it, if the source is available.
    Any helpful suggestions, comments are welcome. Sorry for the long
    post and thanks
    --Gopal
    null

    I don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.

  • Update of non-database fields mapped to database fields

    I have two columns start month and start year which
    are non-database columns and which map to one database
    field start date in the database.
    I have a post-query trigger on the start month and
    start year fields to derive the value from the
    database field start date when the form is queried.
    When I try to update the form, the update does not
    work - if I remove the post-query trigger then the
    update works but, the month and year non-database
    fields do not get queried.
    Any help will be greatly appreciated.
    Thanks,
    Suzanne

    since those 2 fields are not connected to the database field you need to code the update to the database.
    Use the pre-insert trigger and set the value of the date item according to the values of the 2 fields.

  • Problems with query on a non-database field

    Hi,
    Hopefully I am in the correct section...
    I have some problems. I wanna query a non-database field but it does not work for one of them. I have tried the following...
    declare
    vsNewDefaultWhere varchar2(4000);
    vbFirstWhere boolean;
    cursor curArea is
    select a1_area, a1_hbno, a1_seqno
    from b1_in, c1_hdr, a1_bl
    where b1_sequenceno = a1_seqno
    and b1_shipid = a1_hbno
    and b1_id = :c1_shipid;
    rowArea curArea%ROWTYPE;
    procedure mergeStrings (sNewWhereClause varchar2) is
    begin
    if not vbFirstWhere then
    vsNewDefaultWhere := vsNewDefaultWhere || ' and ';
    end if;
    vsNewDefaultWhere := vsNewDefaultWhere || sNewWhereClause;
    vbFirstWhere := false;
    end mergeStrings;
    begin
    navigate.resetselrows('IMP_HDR');
    navigate.resetselrows('IMP_DTL');
    if not navigate.customwhereclause then
    navigate.resetwhereclause('IMP_HDR');
    end if;
    vsNewDefaultWhere := Get_Block_Property('IMP_HDR', DEFAULT_WHERE);
    vbFirstWhere := vsNewDefaultWhere is null;
    ---- does work!
    if :IMP_HDR.c1_usecode is not null then
    mergeStrings('c1_shipid in (select b1_id from b1_in where b1_fac = ''' || :global.fac || ''' and b1_comp = ''' || :global.comp || ''' and b1_code like ''' || :c1_usecode || ''')');
    end if;
    ---- does not work!
    open curArea;
    fetch curArea into rowArea;
    if curArea%found then
    if :IMP_HDR.c1_area is not null then
    mergeStrings('c1_shipid in (select b1_id from b1_in, c1_hdr, a1_bl where b1_fac = ''' || :global.fac || ''' and b1_comp = ''' || :global.comp || ''' and b1_sequenceno = ''' || rowArea.a1_seqno || ''' and b1_shipid = ''' || rowArea.a1_hbno || ''' and rowArea.a1_area like ''' || :c1_area || ''')');
    end if;
    end if;
    end;
    Thanks for your help in advance and let me know if you Need more Information.

    Hello,
    Ask Personalization questions in the dedicated E-Business Suite forum ;-)
    Francois

  • Passing url parameter values to a non database field

    Hi,
    How do I pass values from the url to a non database field ?
    The following works for a database field:
    http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=deptno&p_arg_values=20
    but if I use the same for a non database field item20 it doesn't do anything.
    http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=item20&p_arg_values=2003
    Thanks,
    Sonal.

    Hi,
    Are you trying to query on this field? It wont work because only database fields can be queried on.
    Thanks,
    Sharmila

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • Can not insert or update [TABLE] from internal table in method

    I've faced a problem with OO abap. I've tried to insert into [ TABLE ] from internal table, but i've got error msg after i compiled.
    "An explicit work area is necessary in the OO context. Use "INSERT wa INTO [TABLE] itab""
    After  i changed to loop in work area and INSERT INTO  [TABLE] VALUES gw_data., everything is fine, can compile and run.
    This is error code.
      METHOD set_data_to_table.
        REFRESH gi_data.
        CLEAR gi_data.
        IF gi_file[] IS NOT INITIAL.
    * Set data for modify table
          LOOP AT gi_file INTO gw_file.
            MOVE-CORRESPONDING gw_file TO gw_data.
            me->conversion_input( EXPORTING im_vendor = gw_data-vendor
                                  CHANGING  ch_vendor = gw_data-vendor ).
            APPEND gw_data TO gi_data.
          ENDLOOP.
          INSERT [TABLE] FROM TABLE gi_data.
    *      LOOP AT gi_data INTO gw_data.
    *        INSERT INTO  [TABLE] VALUES gw_data.
    *        IF sy-subrc = 0.
    *          COMMIT WORK.
    *        ELSE.
    *          ROLLBACK WORK.
    *        ENDIF.
    *      ENDLOOP.
        ELSE.
          MESSAGE 'No data found' TYPE 'I'.
        ENDIF.
      ENDMETHOD.                    "set_data_to_table

    Hi Matthew,
    I think there is no difference in database insert between OO and non-OO.
    The correct syntax according to ECC600 online documentation is
    [Inserting Several Lines|http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm]
    To insert several lines into a database table, use the following:
    INSERT target FROM TABLE itab \[ACCEPTING DUPLICATE KEYS].
    This writes all lines of the internal table itabto the database table in one single operation. If one or more lines cannot be inserted because the database already contains a line with the same primary key, a runtime error occurs. You can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS.
    Whenever you want to insert more than one line into a database table, it is more efficient to work with an internal table than to insert the lines one by one.
    I think the syntax
    INSERT my_dbtable FROM TABLE gi_data.
    should work, your suggestion may lead to syntax error.
    Regards,
    Clemens

Maybe you are looking for

  • Any word on when AE CS6 and Premiere will be fixed?

    Hello, Just spent the better part of the afternoon searching and trying the various tweaks recommended to make CS6 video editing programs usable. No luck. Efficiency of these programs has tanked since CS5.5 so now I wait to see if and then there will

  • Purchase Req to Purchase Order

    Is there a transaction in SAP where a user can both release a purchase requisition AND create a purchase order from that same req without having to leave that transaction and go into another?

  • Implementing Auto Contract Generation/Negotiation and Execution

    Would love to hear from anyone that has implemented auto contract generation/negotiation and execution.  Were there any lessons learned you could share during implementation?  Were there things you found out - too late? Are you seeing adoption?  How

  • Using apple tv without switching on imac

    When using apple tv, does my apple mac need to be switched on all the time so I can access my files through Apple tv? Cheers

  • ViewMenuItem do not appear when applying custom skin on ViewNavigatorApplication

    ViewMenuItems works fine when I don't apply skinClass fo ViewNavigatorApplication, but when I apply custom skin to ViewNavigator, ViewMenuItems doesn't appear. Here is my main file <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xm