How to get oracle 9i blob column into an itab  in sap using Native SQL

Hi ,
We are using SAP ECC 5.0  and we need to coonect to an oracle database ver 9i rel2.
We need to get the data stored in a blob(pdf/jpeg) into an itab and later
use it for futher processing.
I am familiar with using native SQL and I wrote a stored procedure in the non sap oracle database to send the blob info into an internal table in sap.
But the information is in hex format and the long raw of SAP does not handle this very well.
Plz see my code below.
data: itab_insp_drawing like zpicture_cluster(which is of type lraw - 7902 )
      occurs 100 with header line.
EXEC SQL.
    EXECUTE PROCEDURE
       proc_get_insp_drawings  (
               IN  :itab-aq_id,
               IN  :itab-section_id,
               IN  :t_in_position,
               out :itab_insp_drawing-picture,
               OUT :t_blob_length,
               out :t_out_position,
               OUT :t_status  )
   ENDEXEC.
  append itab_insp_drawing.
  while t_out_position < t_blob_length.
   EXEC SQL.
    EXECUTE PROCEDURE
       proc_get_insp_drawings  (
               IN  :itab-aq_id,
               IN  :itab-section_id,
               IN  :t_in_position,
               out :itab_insp_drawing-picture,
               OUT :t_blob_length,
               out :t_out_position,
               OUT :t_status  )
   ENDEXEC.
   append itab_insp_drawing.
   endwhile.
Any ideas of how to handle blobs from non sap oracle table. I need this blob into an itab in sap.
Help appreciated.
Thanks
Mala

Please refer the example in this link which deals with Oracle date format.
You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

Similar Messages

  • TIME_OUT when accessing Oracle table from SAP using native SQL

    Hi,
    I have a problem in one of my native SQL statement. It takes a long time accessing the table considering that the number of records to be retrieved is only small.
    Something happened on the Oracle system. But, stilll to be confirmed. Looking further at the issue, it seems that when the value in the where clause equated is a literal (meaning the value is not declared in DATA or CONSTANTS in the ABAP Program)
    Example
    1.
    EXEC.
    WHERE FIELD = '1'
    ENDEXEC.
    instead of
    2.
    CONSTANTS: c_1 value '1'.
    EXEC.
    WHERE FIELD = c_1
    ENDEXEC.
    i found that when the way of coding is same as Example 1, a time-out error occurs. But when in Example 2, no issue.
    Can someone explain this?
    Thanks!

    Repetitively asking the same question again and again is against the forum rules.
    Please post an explain of the SQL statement on the remote machine.
    Markus

  • How to get Oracle Form Parameter Value into Oracle Report

    Hi,
    Please guide for the following:
    On a form, there is one Control Block (CB1), having two TEXT ITEMS, namely From_Date & To_Date respectively. The user inputs from and to dates, for example From_Date: 01-JAN-2009 and To_Date: 31-DEC-2009 and then press "Print Report" button.
    I want to get From_Date & To_Date in the report, as per below mentioned heading:
    SALES REPORT
    From: 01-JAN-2009 To: 31-DEC-2009
    Regards,

    You can use ADD_PARAMETER builtin,
    The following example creates a parameter List, adds two parameters to it, and then passes the List to a form by way of the CALL_FORM procedure:
    <pre>
    /** Declare a variable of type ParamList to store ** the parameter List ID */
    DECLARE
    PARAM_ID ParamList;
    BEGIN
    /* ** Create a parameter List named "input_params" */
    PARAM_ID := Create_Parameter_List('input_params');
    /* ** Add two parameters to the List to pass values for each user-defined parameters defined in the target form; for each parameter, specify its key, type (text or data), and value */
    Add_Parameter(PARAM_ID, 'FROM_DATE'', TEXT_PARAMETER, to_char(:CB1.From_Date, 'DD-MON-RRRR'));
    Add_Parameter(PARAM_ID, 'TO_DATE', TEXT_PARAMETER, to_char(:CB1.To_Date, 'DD-MON-RRRR'));
    /* ** Now call the report, referencing the parameter List ID ** in the last argument to the report calling procedure */
    END;
    </pre>
    Edited by: Charan on Jul 13, 2011 9:08 AM

  • Writing BLOB column into a csv or txt or sql  files

    Hi All,
    I am having a requirement where i have to upload a file from user desktop and place that file into a unix directory. For this i am picking that file into a table using APEX and then writing that file in unix directory using UTL_FILE.
    The problem which i am facing is that after this every line in my file is having ^M character at the end.
    For this i modified my BLOB column into a CLOB column and then also i am facing the same problem.
    Is there any way to get rid of this as i have to upload these csv or txt files into tables using sql loader programs. i can;t write any shell script to remove ^M character before uploading as this program will be merge with existing programs and then it will require lots of code change.
    Kindly Help.
    Thanks
    Aryan

    Hi Helios,
    Thanks again buddy for your reply and providing me different ways.... but still the situation is i can;t write any shell script for removing the ^M. I will be writing into a file from CLOB column.
    Actually the scenrio is when i am writing a simple VARCHAR columns with 'W' mode then it is working fine, but i have a BLOB column which stores the data in binary format so i am converting that column into CLOB and then writing it into file with 'W' mode but then i am getting ^M characters. As per your suggestion i have to then again run a program for removing ^M or i have to modify all my previous programs for removing ^M logic.
    I want to avoid all these, and just wanted a way so that while writing into a file itself it should not have ^M. Else i have to go for a java stored procedure for running a shell script from sql, and in this still i am having some problem.
    Thanks Again Helios for your time and help.
    Regards
    Aryan

  • How to insert data in BLOB column??

    How to insert data in BLOB column.
    Create table BLOBTest (message BLOB)
    insert into blobtest
    (message)
    values
    ('I am loving it');
    gives error ORA-01465: invalid hex number.

    ('I am loving it');This is not considered Binary (BLOB) data. Are you sure you don't want a Character (CLOB) column?

  • How to get BW-BPS variable value into Visual Basic?

    Hello,
    Scenario:
    Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variable’s value i want to get the value of variable into Visual Basic and to format header for table in the layout.
    How to get BW-BPS variable value into Visual Basic?
    Could you help me?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    Hi,
    If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how  i would solve this,
    Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM  T-code. Now using the  SAP delivered SAPAfterDataPut  macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
    Hope this helps.
    regards
    Sai Vishnubhatla

  • I have an old ipod and want to know how to get everything off it and into my iTunes library.  My old computer died and the original library was lost, so don't have any of the content saved anywhere else.

    I have an old ipod (it's the very thin oblong one in purple, the one before the one that does video) and want to know how to get everything off it and into my iTunes library.  My old computer died and the original library was lost, so don't have any of the content saved anywhere else.  I now have an iPhone 5S and listen to music on that, so want to be able to listen to things from the old ipod too.
    Can anyone help please?
    Thanks very much
    Jane

    Apple normally does not get involved in handling lost objects like this.  Since a real name is not installed it will be much more difficult.
    You can try contacting Apple support at the US number, assume you are US going to BWI from the listing: http://support.apple.com/kb/HE57 and explain the situation and see if they offer any suggestions.

  • How to get sum of quantity column in table control

    Hi, expert ,
    Someone can guide me how to get som of qty column in table control ?
    I created a screen with a table control  and has a  qty quantity field .
    I want to show total of qty  in a  field .
    my code like this ...
    PROCESS AFTER INPUT.
      LOOP AT I_tab.
        CHAIN.
           FIELD I_tab-COUNTQTY MODULE  caculate_total_qty .
        endchain.
        MODULE UPDATE_TOTAL_QTY  .
      ENDLOOP.
    but, when I Back to the previous screen
    It's caculate again so I always get wrong Total quantity .
    anyone can help me ...

    Hi , Dhina
    I have another question .
    I use internal table data in table control to update  database table .
    The data in the db will be change ,
    but each record I want to delete in table control , it's still exist in database .
    my code is
    WHEN 'SAVE'
         MODIFY YDSGBT53 FROM TABLE I_YDSGBT53 .
         COMMIT WORK .
      END CASE
    How  to fix my code and let it can change and delete data in database  ?
    or
    when I delete record  in table control I must to delete data in the database too .
    Edited by: TitusFang on Jun 16, 2011 3:21 AM

  • How to get input from keyboard scanner into an array

    This is probably a very basic question but I'm very new to java..
    My task is to reverse a string of five digits which have been entered using keyboard scanner.
    E.g. - Entered number - 45896
    Output - 69854
    I used the StringBuffer(inputString).reverse() command for this, but i need a more basic method to do this.
    I thought of defining an array of 5
    int[] array = new int [5];
    and then using,
    Scanner scan = new Scanner(System.in);
    to enter the numbers. But I can't figure out how to get the five input numbers into the array.
    If I can do this I can print the array in reverse order to get my result.
    Any other simple method is also welcome.

    Hey thanks for the quick reply,
    But how can I assign the whole five digit number into the array at once without asking to enter numbers separately?
    E.g. - if entered number is 65789
    Assign digits into positions,
    anArray [0] = 6;
    anArray [1] = 5;
    anArray [2] = 7;
    anArray [3] = 8;
    anArray [4] = 9;
    I'm really sorry but I am very new to the whole subject.

  • How to get the plsql table data into output cursor

    Hi,
    Could anybody please help me.
    Below is an example of the scenario..
    CREATE OR REPLACE PACKAGE chck IS
    PROCEDURE getdata(dept_no IN VARCHAR2,oc_result_cursor OUT sys_REFCURSOR);
    TYPE get_rec is record (ename varchar2(20),
    eno number(12));
    TYPE t_recs IS TABLE OF get_rec INDEX BY BINARY_INTEGER;
    emp_tab t_recs;
    END chck;
    CREATE OR REPLACE PACKAGE BODY chck AS
    PROCEDURE getdata(dept_no IN VARCHAR2,oc_result_cursor OUT sys_REFCURSOR)
    is
    BEGIN
    select ename, eno
    bulk collect into emp_tab
    from emp;
    open oc_result_cursor for select * from table(emp_tab); -- I believe something is wrong here ....
    END;
    END chck;
    the above package is giving me an error:
    LINE/COL ERROR
    10/29 PL/SQL: SQL Statement ignored
    10/43 PL/SQL: ORA-22905: cannot access rows from a non-nested table
    item
    let me know what needs to be changed
    Thanks
    Manju

    manjukn wrote:
    once i get the data into a plsql table, how to get this plsql table data into the cursor?There is no such thing as a PL/SQL table - it is an array.
    It is nothing at all like a table. It cannot be indexed, partitioned, cluster, etc. It does not exist in the SQL engine as an object that can be referenced. It resides in expensive PGA memory and needs to be copied (lock, stock and barrel) to the SQL engine as a bind variable.
    It is an extremely primitive structure - and should never be confused as being just like a table.
    Its use in SQL statements is also an exception to the rule. Sound and valid technical reasons need to justify why one want to push a PL/SQL array to the SQL engine to run SELECT 's against it.

  • How To Get Oracle fresher Dba jobs in a company

    How to get oracle dba job in a company . Not a single company consider the fresher for dba. Then how can they get experience without start.

    877854 wrote:
    How to get oracle dba job in a company . Not a single company consider the fresher for dba. Then how can they get experience without start.There're a lot of companies who searchs for Junior DBA who knows the essentials of database administration. It's not easy to find them, but you need to submit your CV with recruitment companies
    Kamran Agayev A.
    Oracle ACE
    My Oracle Video Tutorials - http://kamranagayev.com/oracle-video-tutorials/
    My ebook - http://kamranagayev.com/2011/10/19/step-by-step-oracle-installation-all-in-one-e-book/

  • Oracle 10g BLOB data into Postgresql 8.2

    Any Docs on Oracle 10g BLOB importing into Postgresql 8.2.
    Thanks in Advance.
    Harish Kumar R

    Postgresql is not an Oracle product. Perhaps you should address your question to the people that make it.

  • How to convert Oracle reports previewer output into delimited file.

    How to convert Oracle reports previewer output into delimited file if the report has more than 1000 pages.
    I tried with previewer option File --> Generate to file --> Delimited file, but the report engine is crashing.Not generating .TXT file.
    I observed that this option is not working for more than 400 pages.
    I am using Oracle reports 6i version.
    Plz suggest me to generate .TXT file from Report previewer.

    You can specify a delimiter (a character or string of characters) to separate the data (boilerplate or field objects) in your report output in either of the following ways:
    On the command line using the DELIMITER keyword.
    In the Delimited Output dialog box or DelimitedData Output dialog box (displayed with File > Generate to File > Delimited or File > Generate to File > DelimitedData) in Reports Builder.
    for further information goto this link
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_concepts2.htm#sthref760

  • How can I add new row/column into existing jTable?

    Hi add!
    Can you help me how can I add new row/column into existing jTable?
    Tnx in adv!

    e.g
    Create two buttons inside the Table ( "Add New Row" ) and ("Add new Column")
    their handlers are:
    add new row:
    //i supose u already have
    DefaultTabelModel tablemodel = new DefaultTableModel(rowdata, columnNames);
    //and   
       JTabel jtable = new JTable(tablemodel);
    // Handler (row)
    jbtAddRow.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent e) {
          if(jtable.getSelectedRow() >= 0 )
              tablemodel.insertRow(jtable.getSelectedRow(), new java.util.Vector());  
           else  
                tablemodel.addRow(new java.util.Vector());
        });to add new columns its the same but inside actionPerformed method:
    ask for e.g "Whats the name for the new column"
    then,
       tablemodel.addColumn(nameOfColumn, new java.util.Vector());   Joao
    Message was edited by:
    Java__Estudante

  • How to get System status Check Boxes into Query selection screen

    Dear experts,
    Pleas help in knowing how to get System status Check Boxes into quick view query (SQVI), selectionscreen.
    Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on Jul 6, 2010 7:26 PM

    Problem solved through other Forum
    (Checkboxes not possible, some alternative solution to my requirement found)

Maybe you are looking for