Populating image_item within plsql

Hi,
Forms version 9.0.4.0.19
Is there a way to populate a image_item that is a non database item with a value (image) from a blob-column in a db table.
I have a procedure in a PLL that today assigns the image_item with the image from a file (Read_Image_File(Image_FileName, 'JPG', 'IMAGE_ITEM')).
From now on we stores the image in a table instead.
The procedure is called from a number of forms and I would like to not change i all of them...
Any ideas ?
/Samuel

Suppose we have a table like
Create table gs( X NUMBER,Y VARCHAR2(2));
INDRA>select * from gs;
X Y
1 s1
2 s2
Now,can you please help me for the PL/SQL block below -
INDRA>
declare
v varchar2(3200):='s1,s2'||',';--:control.conditions||',';
sn varchar2(3200);
Type ArrayType Is Table of Varchar2(200)
Index by Binary_integer;
l number;n number;
S ArrayType;
Begin
l:=length(v)-length(replace(v,',',''));
for i in 1..l
loop
n:=instr(v,',',1,1);
s(i):=''''||substr(v,1,n-1)||'''';
v:=substr(v,n+1);
end loop;
For i in 1..l
loop
sn:=sn||','||s(i);
end loop;
sn:=substr(sn,2);
dbms_output.put_line('string= '||sn);
for j in (select x from gs where y in (sn))
loop
dbms_output.put_line('x= '||j.x);
end loop;
End ;
string= 's1','s2'
PL/SQL procedure successfully completed.
why the cursor is not working ?
(retriving no row selected)
But when we are using sql we get
INDRA>select x from gs where y in ('s1','s2');
X
1
2
Is there any alternative way ?
Note:It was actually a Form 6i Trigger code
for the control item :control.conditions,when
user would enter the conditions like s1,s2,s3,...
and we have to select something from another database
table.
[email protected]

Similar Messages

  • Build large XML Docs within PLSQL

    Hi..
    I wondered what will be the fastest way to make a XML Document from a selection resultset and put it in a CLOB.
    I think XSU isn't suitable to retrieve large XML (?)
    Maybe I should build the XML within PLSQL manually by adding all Tag- and Element-Strings to one CLOB.
    Can you please give me some recommendations.
    Al

    If you are using 9iR2 you might want to look at the new SQL/XML operators that provide an industry standard mechanism for generating XML from a SQL Query. Using these operators allows significant optimizations to take place in the database kernel as the optimzier is aware that the result set will be presented as an XML Document. The typical output of these operators is an XMLType which can be stored as a column in the database. There is not need to use a CLOB as such, as for not Schema based XMLType, the underlying storage mechanism is CLOB

  • Using unix host command within plsql on aix

    On an aix platform Im trying to host out of a plsql procedure to
    use mail. I can only get the host command to work inside a blank
    .sql file. ie. first line must have the host command on it. If
    you try to imbed the host command within a procedure, the file
    will just sit there and nothing happens.
    null

    Jay,
    This forum is for Headstart related questions and experiences
    only. Please go to metalink.oracle.com to get more information on
    your problem.
    Regards,
    Lauri
    Jay Levasseur (guest) wrote:
    : On an aix platform Im trying to host out of a plsql procedure
    to
    : use mail. I can only get the host command to work inside a
    blank
    : .sql file. ie. first line must have the host command on it. If
    : you try to imbed the host command within a procedure, the file
    : will just sit there and nothing happens.
    null

  • Call unix script within plsql block

    Hi all,
    can i call a unix script within a plsql block for example
    my unix script name is - Diff_dataload_process.sh
    declare
    begin
    select * from ......;
    Diff_dataload_process.sh
    exception
    end;
    please help me.
    Thanks,
    Krupa

    Hi, I think you need something like this:
         DBMS_SCHEDULER.create_program
         (program_name => 'sch_program',
    program_type => 'EXECUTABLE',
    program_action => '/home/nobody/input/test_job.sh',
    number_of_arguments => 0,
    enabled => TRUE,
    comments => 'Test Program'
    end;
    and there's another ways to do it:
    [calling shell|http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm]

  • Calling a web service from within PLSQL

    Hello !
    I am trying to activate a web service located on a remote machine inside a database trigger . This WSDL has been generated by a XI (SAP) tool and located on the server on which the XI is installed.
    XI is an EAI tool a product that is included in the SAP products - for integrating between SAP and other tools - including Oracle DB.
    When I try to call the web service using UTL_HTTP package - a procedure i wrote correctly - I get the following error message :
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1029
    ORA-12545: Connect failed because target host or object does not exist
    I have GOOGLED the last message ( ORA-12545) , but the forums referred to a client for ORACLE, which is configured incorrectly; none of them referred to my case - calling a web service. BTW I tried using the web server's IP address instead of the DNS but got the same error.
    Any suggestion would be very appreciated.
    Best Regards,
    Shimon B.

    Try the following type of "telnet" test using PL/SQL:
    SQL> create or replace function tcpPing( ipAddress varchar2, portNum number) return varchar2 is
    2 socket utl_tcp.connection;
    3 t1 timestamp with local time zone;
    4 begin
    5 t1 := systimestamp;
    6 socket := utl_tcp.Open_Connection(
    7 remote_host => ipAddress,
    8 remote_port => portNum,
    9 tx_timeout => 5
    10 );
    11 utl_tcp.Close_Connection( socket );
    12
    13 return( ipAddress||':'||TO_CHAR(portNum)||' is alive. ('|| TO_CHAR(systimestamp-t1) ||')' );
    14
    15 exception when OTHERS then
    16 return( ipAddress||':'||TO_CHAR(portNum)||' did not respond. ('||SQLERRM(SQLCODE)||')' );
    17 end;
    18 /
    Function created.
    SQL>
    SQL> col STATUS format a80
    SQL> select tcpPing( '10.251.93.87', 80 ) as STATUS from dual;
    STATUS
    10.251.93.87:80 is alive. (+000000000 00:00:00.002422000)
    SQL> select tcpPing( '10.251.93.87', 81 ) as STATUS from dual;
    STATUS
    10.251.93.87:81 did not respond. (ORA-29260: network error: TNS:operation timed
    out)

  • Converting SQL Report Region to PLSQL Function Body Returning SQL Query

    All:
    I want to convert my SQL Report Region to a PLSQL-generated SQL Report Region so that I can eliminate where clauses dynamically and speed up my app, and also so that I can provide additional sorting options.
    <br><br>
    My problem is that I have lots of embedded single quotes that already are coded as 3 single quotes in the SQL Report Region. I am not sure at all how to code them within the PLSQL.
    <br><br>
    As example, here is one column from my query:
    <br><br>
    select decode(nvl(g.date_sub_1,g.date_rec_1), null, decode(g.article, 0, 'E', 1, 'U'), '< a href="javascript:unElevate( ' ' ' || g.grid || ' ' ',' ' ' || g.natca || ' ' ')">' || decode(g.article, 0, 'E', 1, 'U') || '< /a>') "Reverse" from g_table g
    <br><br>
    (Note that I added spaces within the code so it would display properly in the browser.)
    <br><br>
    To clarify, that's a double quote before javascript, and then 3 single quotes before the first concatenation group, then 3 single quotes after the second concatenation group, then 3 single quotes before the third, 3 single quotes after the fourth followed by an end-paren followed by a double quote etc.
    <br><br>
    My question is, what do I do with these triple-single quotes within PLSQL? Probably a no-brainer for the experienced folks, but I am thinking like a mobius strip at this point.
    <br><br>
    Bill
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    Scott,
    I think that feature was made for my situation! I keep getting
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-20001: Unable to bind :43 verify length of item is 30 bytes or less. Use v() syntax to reference items longer than 30 bytes. ORA-01006: bind variable does not exist)
    I did chop the query up into little bits, i.e.
    p_sql := p_sql || q'! ... !';
    p_sql := p_sql || q'! ... !';
    p_sql := p_sql || q'! ... !';
    return p_sql;
    But I'm not sure what I'm supposed to do here.
    Thank you.
    Bill

  • How to do Multithreading in Oracle PlSql using a Single Session

    Hi All,
    I have a complex but interesting requirement.
    1) I have a table with 90k rows.
    2) My PlSql Package picks up all the 90k rows one by one, does some processing/transformation on it
    3) if the row satisfies some business rules, then it gets inserted into an application table. If the row is not eligible, then it inserts the row into a Error table.
    4) After processing all the 90k records, If my Error Table Count reaches 10% of the input count (90k), then all inserts (i.e. both application table inserts and
    error table inserts) must be rolled back.
    5) Right now, we are achieving this logic in a single session but there are far many performance issues, because processing has to go through row by row.
    Is it possible to implement the above logic as "multi threading within PlSql" whereby i can run Step 2 in 10 parallel slaves and if the total error count of all the 10 slaves exceeds 10% of the input data, then there should be a rollback for all 10 slaves.
    +A sample testcase is given below. Issue is: rollback statement in p1 is not taking any effect (because plsql spawns sessions to execute p2 which autocommits itself on graceful exit). But is there any other way by which i can make the rollback to be effective+
    create table t1 (a number);
    create table j1(b number);
    create or replace procedure p1
    as
    l_cnt number;
    i number;
    l_job number;
    begin
         for i in 1 .. 5 loop
            dbms_job.submit( l_job, 'p2('||i||');' );       
        end loop;
        commit;
        loop
            dbms_lock.sleep(30);
            select count(*) into l_cnt from j1;
            exit when (l_cnt = 5);
        end loop;
       rollback;
    end;
    create or replace procedure p2(i number)
    as
    begin
    insert into t1 values(i);
    insert into j1 values(1);
    end;
    /

    Basically your current 'algorithm' can be described as 'slow-by-slow processing' (co Tom Kyte)
    Relational databases are about sets not about records.
    Consequently your approach must be qualified as evil.
    Instead of fixing the problem (and getting rid of slow-by-slow processing), you propose to add even more evil by adding multi-threading to the mix.
    The issue you describe is not an issue at all, it is just making clear you are heading for disaster.
    An approach that works quite nicely is
    - add an extra status column to the table to be processed.
    - UPDATE the status column of all records that do not qualify. By UPDATE I mean the UPDATE statement, not record by record processing
    - (BULK)-INSERT the remaining records, for which the flag is NULL.
    The simple guidelines for application development are:
    Only do it in PL/SQL when you can't do it in straight SQL
    Only do it in Java when you can't do it in PL/SQL
    Only do it in 3GL when you can't do it in Java.
    Your 'strategy' is doomed to fail.
    Get rid of it.
    Before it is too late, and your heart is pumping like mad, because your problems are increasing, and increasing, and increasing, and you have to work 7 x 24 to deal with 'performance problems'
    You have already demonstrated your approach doesn't work.
    Don't try to make it worse.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who do read documentation

  • Interpretting HASH_MAP to PLSQL

    Hello All,
    My oracle version in 10.2.0.4 on a solaris V880 machine.
    Our Application Java SDK is 1.4.
    I am trying to pass in a series of XML (considerably huge for XML type column) from java application plsql which stores them into an oracle table with column as external BLOB. Since the contents are so heavy for each objects , using XMLTYPE column is not feasible.
    The xml files comes as either java hash_map or string which i have to pass as parameter to an Oracle stored procedure which stores as external BLOB in OS through a table.
    My first doubt is this the correct approach.
    My second doubt here is how to interpret java hash_map object within PLSQL when it is passed to it.
    Apologies if the question is silly since i am a new comer to java.
    Thanks in advance ,
    Vijay G

    Is it possible to just get the file name "reaper"from it instead of reaper.txtActually, I ran a test, and
         System.out.println(  "file name portion == " + ( f.getName().split( "\\." ) )[ 0 ] );works also:
    This has the same effect as:
         String fileName = f.getName();
         String splitFileName[] = fileName.split( "\\." );
         System.out.println(  "file name portion == " + splitFileName[ 0 ] );Now that I think about it, the second form is more easily understood. There is really no reason to do it the first way. Just interesting to note that you can.

  • Publish PLSQL stored procedure as web services

    Is it true that PLSQL stored procedure can only be published as web services using JAVA?
    I came across article that mention how to call other web services from within plsql, but not sure the vice versa.
    So, please advise.
    Thank you.

    True..I've done it once using J-Developer.
    http://www.oracle.com/technology/obe/obe1013jdev/ws/wsandascontrol.htm#o
    Good luck!!
    Bhagat

  • How do I manipulate process variables within sql?

    Hi,
    I am working with Oracle 10gR2.
    my main problem is to indicate a problem within the execution of a SQLPLUS.
    I saw in this forum that there is a bug and the return code will be ignored.
    So it was suggested:
    As a workaround you can define processflow variable and bind RESULT_CODE parameter of Sql*plus activity to this variable. Then you can define transition from
    sqlplus activity with custom ("complex") condition (like PF_VAR_RC=2 etc.).What exactly shall this mean?
    I am now on the way to solve this by manipulating the process variable within SQLPLUS. But how can I access this variable and manipulate it within PLSQL?
    Many thanks
    cheers Daniel

    Hi Daniel,
    even with this "bug" it is possible to get result of execution SQL*Plus activity:
    - SQL*Plus command exit 0 produce SUCCESS return code in SQL*Plus activity
    - SQL*Plus command exit 1 (or with other non zero value) produce FAILURE return code in SQL*Plus activity
    Regards,
    Oleg

  • Spool in PLSQL

    I'm in a PLSQL loop and I need to do a spool for a select statement. This doesn't work because within plsql, it needs a select Into clause. Is there anyway of sending the output to a file?

    Use REF CURSOR as out parameter of the procedure. Open the ref cursor for a query inside the procedure.
    SQL> var x REFCURSOR
    SQL> exec proc1(:x);
    SQL> print x

  • Clear/delete  Image_Item

    Hi,
    since some time we use Read_Image to read OS-Files into an Image_Item within the Forms-Block.
    And we have found a "solution" to clear the Image_Item :
    ======
    go_field('Block.Image_Item');
    Select_all;
    cut_region;
    ======
    This worked fine for Forms6i. Now we are migrating to Forms10G and this doesn't work anymore.
    Is there any other solution to clear the Image_Item ?
    Just setting the Image_Item to NULL ":Block.Image_Item := NULL;" doesn't work.
    Any idea would be appreciated.
    Mark

    Hi Moazam,
    you first post was OK and using BLOB instead of LongRaw solved the problem.
    I only made a little mistake testing it. I was running my form in QueryOnly mode so I couldn't save the cleared Item. The Message was a bit misleading, but changing QueryMode solved it.
    Thanks,
    Mark
    P.S.
    BTW your last posting didn't work at all, because
    "SUBSTR(FILENAME,INSTR(FILENAME,-1))" delivers the complete filename and I assume you meant something like "SUBSTR(:fn,INSTR(:fn, '.',-1)+1)" instead.

  • Converting from JAVA HASHMAP to PLSQL object or CLOB

    Hello All,
    My oracle version in 10.2.0.4 on a solaris V880 machine.
    Our Application Java SDK is 1.4.
    I am trying to pass in a series of XML (considerably huge for XML type column) from java application plsql which stores them into an oracle table with column as external BLOB. Since the contents are so heavy for each objects , using XMLTYPE column is not feasible.
    The xml files comes as either java hash_map or string which i have to pass as parameter to an Oracle stored procedure which stores as external BLOB in OS through a table.
    My first doubt is this the correct approach.
    My second doubt here is how to interpret java hash_map object within PLSQL when it is passed to it.
    Apologies if the question is silly since i am a new comer to java.
    Thanks in advance ,
    Vijay G

    vijay S P G wrote:
    If i have plsql collection with a varchar2 and a blob as record type then can i directly pass the java hash map to the procedure having parameter datatype as the above said record type ?Of course not. Obviously the first reason for that is because the "blob" needs to be a file path and not a blob.
    Second reason is no databases that I know of take a hash data type. Some take arrays. But I doubt that is worth the trouble.
    You have a collection of name value (path) pairs. Iterate over the collection and for each name do an insert of the name and path.

  • XPATH sum(node-set) function using PLSQL

    Hi,
    I'm using the XMLDOM and XSLPROCESSOR PLSQL packages to parse my XML and need to sum a Node element. I was wondering how can I achieve the following XSL command within PLSQL ??
    <xsl:value-of select="sum(<some nodeset>)"/>
    Can I use the XSLPROCESSOR.valueOf function to get the sum ?? Or is there another way ??
    Regards,
    Mark

    Can you try this?

  • PLSQL: Reading variable value from keybord

    In default cursor it is possible to use:
    ACCEPT variable PROMPT "Enter value: ";
    I got a problem while I try to have the message depend on a constant eg. language:
    DECLARE
    v_DATA VARCHAR2(10);
    v_TEXT VARCHAR2(10);
    c_language CONSTANT VARCHAR2(2) := 'PL';
    BEGIN
    CASE c_language
    WHEN ('PL') THEN v_TEXT := "PODAJ DATE";
    ELSE v_TEXT := "ENTER DATE";
    END CASE;
    ACCEPT v_DATA Prompt v_TEXT;
    END;
    Can anybody help me how to properly enter values within PLSQL begin-end statement.
    I suppose it is quite simple but still... :-)

    THX a lot
    And there is another thing.
    In your example the question is asked always in English and is always the standard one "Enter value for ..."
    I need to support 4 language versions and have to ask question in different languages depending on a value of c_language variable, without the "Enter value for ..." :-)
    English user would see (c_language='EN' ):
    Enter the receipt date: {here cursor waiting for entering date}
    Polish user would see (c_language='PL' ):
    Podaj date przyjecia: {here cursor waiting for entering date}
    So now it looks as follows:
    set serveroutput on
    set verify off
    DECLARE
    v_DATA VARCHAR2(10);
    v_QUESTION VARCHAR2(30);
    c_language CONSTANT VARCHAR2(2) := 'EN';
    BEGIN
    CASE c_language
    WHEN ('PL') THEN v_QUESTION := 'PODAJ DATE';
         ELSE v_QUESTION := 'ENTER PO DATE';
    END CASE;
    dbms_output.put_line(v_QUESTION);
    v_DATA := '&v_ENTERED';
    dbms_output.put_line('Entered value:'||v_DATA);
    END;
    Result:
    Enter value for v_entered: 28-08-05
    ENTER PO DATE
    Entered value:28-08-05
    PL/SQL procedure successfully completed.
    SQL>
    Message was edited by:
    user448557

Maybe you are looking for

  • Calculating the length of the longest side of a polygon

    If you want to calculate the length of the longest side of a polygon -- for example a rectangle -- how can that be done using the standard geometrical functions of spatial in an oracle 10g2 database? SDO_LENGHT delivers the outline of the polygon. If

  • How do I restore my music and playlists from my iPod 4g to my iPod 5g?

    I did a "full" backup to my computer of my old iPod, and restored my new iPod from that backup, but my music is completely empty and I don't want to manually put all my music and playlists back together. Help???

  • Why is iTunes11 against classical music?

    As someone involved in the international regulation of cyberspace and the standards that enable it to function, I have watched Apple recently make a number of mistakes that are increasingly isolating it from governments and the commercial, particular

  • PR Process Flow

    HI All, Any one can please forward Process flow for PR (for Asset) regards JK

  • Bank and address infotype connection

    Hi Gurus, Would like to know where I can find if bank and address connection has been broken if bank and/or address has been updated. My questions stems from the fact that when payroll has run it did not capture the old/new address data in the interf