Oraclebinary  and log raw datatypes

hi
i have a table (oracle XE 10g) with a column LONG RAW data types, the column contains a XML file for XSLT tranformation.
i want read th column and i write this code but it don't works!!!
Private Sub leggiRiparto()
Dim codiceProvincia As String
Dim codiceComune As String
Dim codtipoelezione As String
'query per la lettura dalla tabella outputscrutini del Db elez
Dim strSQL As New String("SELECT o.DATAELEZIONE, o.CODPROVINCIA,o.CODCOMUNE,o.CODTIPOELEZIONE, o.XML, c.DESCCOMUNE " & _
"FROM outputscrutinio o, comune c " & _
"WHERE o.dataElezione = " & dataElezione & " and o.codtipoelezione = " & tipoelezione & _
" AND o.CODPROVINCIA = c.CODPROVINCIA " & _
" AND o.CODCOMUNE = c.CODCOMUNE " & _
"ORDER by o.codprovincia, o.codcomune")
Dim riparti As OracleCommand ' New OracleCommand(strSQL, dbElezioniDDE)
riparti = New OracleCommand(strSQL, dbElezioniDDE)
Try
'ApriDB()
Dim dtRead As OracleDataReader = riparti.ExecuteReader
If Not dtRead.HasRows Then
MessageBox.Show("Attenzione non ci sono riparti disponibili ! Contattare l'amm.re del DB")
Else
While (dtRead.Read())
codiceProvincia = dtRead.Item("CODPROVINCIA")
codiceComune = dtRead.Item("CODCOMUNE")
codtipoelezione = dtRead.Item("CODTIPOELEZIONE")
Dim blob As OracleBinary = dtRead.GetOracleBinary(4)
'Dim blob As OracleBlob = dtRead.GetOracleBlob(4)
Dim indice As Integer = blob.Length
Dim nomefile As String = "Riparto Seggi" & "-" & dataElezione & "-" & codtipoelezione & "-" & codiceProvincia & "-" & codiceComune
Dim fileXML(indice) As Byte
End While
End If
Catch ex As OracleException 'catch per eccezioni Oracle
Select Case ex.Number
Case 12545
MessageBox.Show("Il database è al momento non disponibile.")
Case Else
MessageBox.Show("errore database: " & ex.Message.ToString)
End Select
Catch ex As Exception
MessageBox.Show("Errore Apertura DB DDE : " & ex.Message & vbCrLf & "StackTrace : " & ex.StackTrace, "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error)
End
Finally
riparti.Dispose()
'dbElezioniDDE.Close()
'dbElezioniDDE.Dispose()
End Try
End Sub

I'm sorry but the post was incomplete!
Then the problem is when I read the XML data
As OracleBinary dtRead.GetOracleBinary
Dim blob As OracleBinary = dtRead.GetOracleBinary(4)
Dim indice As Integer = blob.Length
that by obtaining blob.Length = 0
while the other fields in the select statement is accurate
Thanks

Similar Messages

  • Migration of LONG and LONG RAW datatype

    Just upgraded a DB from 8.1.7.4 to 10.2.0.1.0. In the post-upgrade tasks, it speaks of migrating tables with LONG and LONG RAW datatypes to CLOB's or BLOB's. All of my tables in the DB with LONG or LONG RAW datatypes are in the sys, sysman, mdsys or system schemas (as per query of dba_tab_columns). Are these to be converted? Or, does Oracle want us to convert user data only (user_tab_columns)?

    USER_TAB_COLUMNS tells you the columns in the tables owned by the current user. There may well be many users on your system that you created that contain objects. I suppose you could log in to each of those schemas and query their USER_TAB_COLUMNS table, but it's probably easier to query DBA_TAB_COLUMNS with an appropriate WHERE clause on the owner of the objects.
    Justin

  • JDBC and Long RAW datatypes

    I have written a Java/JDBC program that grabs jpeg images. I would like to store them in an Oracle database in a LONG RAW column (for legacy databases b4 BLOBs). Can someone show me some sample code that would allow me to do this??? All help is GREATLY appreciated.
    TIA
    RHC

    From http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330
    >
    RAW(size)
    Raw binary data of length size bytes. Maximum size is 2000 bytes. You must specify size for a RAW value.
    LONG RAW
    Raw binary data of variable length up to 2 gigabytes.

  • Export and Import Of Tables having BLOB and Raw datatype

    Hi Gurus,
    I had to export one schema in one database and import to another schema in another database.
    However my current database contains raw and blob datatype.I have exported the whole database by the following commnad
    exp SYSTEM/manager FULL=y FILE=jbrms_full_19APR2013.dmp log=jbrms_full_19APR2013.log GRANTS=y ROWS=y
    My question is if all the tables with raw and blob have been exported properly or not.I have done one more thing after taking the export , I have imported to local db and checked the no of rows in the both the envs are same.As I have not tested with the application to confirm.
    I am using this version of Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    not able to attach the complete log file but for the schema jbrms which has the blob and raw datatype.
    Please let me know if you find some potential concerns with the export for BLOB and raw
    . about to export JBRMS's tables via Conventional Path ...
    . . exporting table FS_FSENTRY 8 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table FS_WS_DEFAULT_FSENTRY 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BINVAL 60 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BUNDLE 751 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_REFS 4 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_FS_FSENTRY 1 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BINVAL 300 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BUNDLE 11654 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_REFS 1370 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.

    You could see the 'QUESTIONABLE STATISTICS' warning for a couple of reasons. I don't remember them all but.
    1. If the target and source character set is different.
    2. system generated names (I think?)
    the best solution if you don't need the exact statistics that are on your source database would be to add
    statistics=none
    to your imp command and then regather statistics when the imp command is done.
    Dean

  • How can i read a stored picture in oracle Long Raw datatype? blob or clob?

    How can i read a stored picture in oracle Long Raw datatype? Like a blob or clob?....i am using jdk 1.3
    This is because...i tried to read it like a blob but i obtain a exception...about Type of column no valid......but the column exist....and it contains the long raw datatype of the pictures.....this is my code:
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.InputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    import oracle.sql.BLOB;
    import oracle.sql.BLOB.*;
    import oracle.jdbc.driver.*;
    import java.sql.*;
    class rec_ima1
    public static void main(String h[])
    Connection con = null;
    Blob bl;
    final ImageIcon image1;
    JPanel photo;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
    String query = "Select * from pictures where ID = '18840'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    if (!rs.next())
    System.out.println("Empty Result Set");
    bl = rs.getBlob(5);
    if (bl == null) {
    System.out.println("Null Blob");
    return;
    InputStream is = bl.getBinaryStream();
    int imageLength = (int) bl.length();
    System.out.println(imageLength);
    System.out.println(bl.length());
    byte[] imageData = new byte [imageLength];
    is.read(imageData, 0, imageLength);
    image1 = new ImageIcon(imageData);
    photo = new JPanel() {
    public void paint(Graphics g){
    g.setColor(Color.lightGray);
    g.drawImage(image1.getImage(), 0, 0, this);
    } catch (Exception e) {
    e.printStackTrace();
    Now i tried using clob:
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.InputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    import oracle.sql.CLOB;
    import oracle.sql.CLOB.*;
    import oracle.jdbc.driver.*;
    import java.sql.CallableStatement;
    class rec_ima4
    public static void main(String h[])
    Connection con = null;
    Clob cl;
    JPanel photo;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
    con.setAutoCommit (false);
    String query = "Select * from pictures where ID = '18840'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    while (rs.next()) {
    oracle.sql.CLOB clob = (CLOB) rs.getObject(5); //line 47
    } catch (Exception e) {
    e.printStackTrace();
    This is the runtime exception:
    java.lang.ClassCastException: [B
    at rec_ima4.main(rec_ima4.java:47)

    Thanks by answering to me......
    Well....i did that....but what is ImageIO?....
    I declared a ImageIcon imageIO, but this give me the following:
    rec_ima3.java:49: cannot resolve symbol
    symbol : class BufferedImage
    location: class rec_ima3
    BufferedImage bi = ImageIO.read(bInput);
    ^
    rec_ima3.java:49: cannot resolve symbol
    symbol : variable ImageIO
    location: class rec_ima3
    BufferedImage bi = ImageIO.read(bInput);
    ^
    What classes i have to import?.....what is ImageIO?
    Thanks

  • How to convert number datatype to raw datatype for use in data warehouse?

    I am picking up the work of another grad student who assembled the initial data for a data warehouse, mapped out a dimensional dw and then created then initial fact and dimension tables. I am using oracle enterprise 11gR2. The student was new to oracle and used datatypes of NUMBER (without a length - defaulting to number(38) for dimension keys. The dw has 1 fact table and about 20 dimension tables at this point.
    Before refining the dw further, I have to translate all these dimension tables and convert all columns of Number and Number(n) (where n=1-38) to raw datatype with a length. The goal is to compact the size of the dw database significantly. With only a few exceptions every number column is a dimension key or attribute.
    The entire dw db is now sitting in a datapump dmp file. this has to be imported to the db instance and then somehow converted so all occurrences of a number datatype into raw datatypes. BTW, there are other datatypes present such as varchar2 and date.
    I discovered that datapump cannot convert number to raw in an import or export, so the instance tables once loaded using impdp will be the starting point.
    I found there is a utl_raw package delivered with oracle to facilitate using the raw datatype. This has a numbertoraw function. Never used it and am unsure how to incorporate this in the table conversions. I also hope to use OWB capabilities at some point but I have never used it and only know that it has a lot of analytical capabilities. As a preliminary step I have done partial imports and determined the max length of every number column so I can alter the present schema number columns tp be an apporpriate max length for each column in each table.
    Right now I am not sure what the next step is. Any suggestions for the data conversion steps would be appreciated.

    Hi there,
    The post about "Convert Numbers" might help in your case. You might also interested in "Anydata cast" or transformations.
    Thanks,

  • How to view contents in Long Raw datatype column

    Hi,
    We have two node RAC database with 10.2.0.4.0 version.
    OS - IBM AIX.
    We have a table with a column with datatype "LONG RAW" in production. It stores image files.
    We need to send the images from few rows to third party vendor. Basically, they need to view the images.
    Earlier, I have exported to dump file using datapump and sent to vendor. but vendor is telling that they are not able to view the images. Can you please suggest best method to transfer the images (LONG RAW datatype) and the method to view them.

    We have a table with a column with datatype "LONG RAW" in production. It stores image files.
    We need to send the images from few rows to third party vendor. Basically, they need to view the images.
    Earlier, I have exported to dump file using datapump and sent to vendor. but vendor is telling that they are not able to view the images. Can you please suggest best method to transfer the images (LONG RAW datatype) and the method to view them.How is the vendor trying to use the extracted images? Data exported with datapump must be imported into another database with datapump. The same applies to the exp utility (must use imp to load into a database).
    If you're careful you should be able to write a binary file using utl_file.
    Regarding the long raw, is there any way you could convert to BLOBS? Longs and Long raws are notoriously hard to work with

  • The question about RAW datatype in VBA with OO4O

    Hi all.
    I have developed a sort of VBA program with oo4o.
    When I issued "select rawtohex(saddr),saddr from v$session where rownum < 2" and I displayed the result on excel spread sheet.
    The result was below.
    RAWTOHEX(SADDR)      SADDR
    C0000000E14ADDF0     &#65533;
    I found I couldn't display a raw datatype result without using RAWTOHEX function.
    But, I query the table using "*",such as " select * from v$session" sometime. So I have to display the raw datatype result without using oracle function.
    I heard that the "RAW" datatype is a array of byte, so I used byte array.
    The following is my first idea and the result is wrong.
    The result is 'FF000000......', not 'C000000....'
    Is there any good idea?
    Dim oSession As Object
    Dim oDatabase As Object
    Dim oRs As Object
    Dim cntCol, cntRow As Long
    Dim rowNum, colNum As Long
    Dim sraw() As Byte
    Dim k As Integer
    Dim hexaString As String
    Set oSession = CreateObject("OracleInProcServer.XOraSession")
    Set oDatabase = oSession.DbOpenDatabase(gTargetServer, gUserID & "/" & gPasswd, 0&)
    Set oRs = oDatabase.DbCreateDynaset(gSqlString, 0&)
    cntCol = oRs.Fields.Count
    cntRow = oRs.RecordCount
    ReDim resData(cntRow, cntCol) ' the variant type array to store result
    'To store column title.
    For colNum = 0 To cntCol - 1
    resData(0, colNum) = oRs.Fields(colNum).Name
    Next colNum
    'To store data.
    For rowNum = 1 To cntRow
    For colNum = 0 To cntCol - 1
    Select Case oRs.Fields(colNum).Type
    Case 11
    sraw = oRs.Fields(colNum).Value
    For k = 0 To UBound(sraw)
    hexaString = hexaString & Hex(sraw(k)) '<= here.***********
    Next k
    resData(rowNum, colNum) = hexaString
    Case Else
    resData(rowNum, colNum) = oRs.Fields(colNum).Value
    End Select
    Next colNum
    oRs.MoveNext
    Next rowNum
    I hope I get helps.
    Bill.

    But, I query the table using "*",such as " select * from v$session" sometimeCan't you use
    select rawtohex(saddr) hexaddr, t.* from v$session t
    (if you really need '*' ) ?
    Rgds.

  • What is the optimum core configuration for a new Mac Pro to process and manipulate very large (80 megapixel) images using PhotoShop and Camera Raw?

    Hello:
    I will be using creative techniques to process and manipulate a large number (hundreds) of very large (80 megapixel) images captured using a medium format digital back (Phase One IQ180).
    Final output will be digital fine art imagery printed using an Epson 11880 at large sizes (up to 60 inches x ?), retaining the highest possible quality and resolution. I will be using Adobe CC PhotoShop and Camera RAW as well as Capture One software. PhotoShop filters will be used extensively.
    The Mac Pro needs to be optimized for the above purpose and be useful for at least five years. I plan to max out all the other options (RAM, graphics cards, storage). Performance is more important than cost.
    The few discussions I have found that mention optimum core configurations seem to lean toward 6 or 8 (but likely are not taking into consideration my need for manipulating a large number of very large files), so I am looking to this foum for opinions.
    Thank you,
    Kent

    See if this helps
    http://macperformanceguide.com/index_topics.html#MacPro2013

  • I cannot open photos in my Photoshop CS 6.  I have been able to open Browser and Camera Raw, but not

    I cannotg open photos in Photgoshop CS6.  I can open them in Photoshop Browser and Camera Raw, but cannotg open them in Photoshop.  Blue circle comes on for about three seconds, then changes to a plus sign, and nothing else happens.  Please help.  Adobe Photoshop is either unwilling or unable to help me with this problem.

    Nobody can help you without some exact system info and details on what photos exactly.
    Mylenium

  • "Edit In" Photoshop CC not working for RAW or DNG files after applying LR 5.3 and Camera Raw 8.3

    I just applied the Lightroom 5.3 and Camera Raw 8.3 updates and now am no longer able to open RAW or DNG files into Photoshop CC. When I select a file and choose "Edit In" Photoshop, photoshop will launch, then nothing will happen. After 2 to 5 minutes, an error will popup in Lightroom saying "The file could not be edited because Adobe Photoshop CC could not be launched." An error I've never seen before. When I click "Ok", Lightroom will show that it's "preparing a file for editing" in the upper left, it will create and save a psd to disk and in the catalog (another new behavior), then it will open in photoshop. All other file types (jpgs, tiff, psd) seem to work/open fine between applications. No difference if I open photoshop prior to selecting "Edit In". Selecting "Edit In" other applications, like Viveza, work fine.
    I tried first deleting preference files in both applications. No luck. Ditto for plugins. Notta. Eventually I completely uninstalled and fresh installed Photoshop, Lightroom, and Bridge from the cloud. Same deal...can't open raw/dng files into Photoshop.
    I'm at a complete loss, dead in the water, with a mountain of editing work piling on top of me. Kicking myself for applying the upgrades, which I had been delaying for some time to avoid just such a cluster%#$. Ugh.
    I'm on a PC running Windows 7 64bit.
    Any suggestions would be greatly appreciated.

    In the normal situation, LR needs to see a PS installed for it to detect the Edit In PS option is possible, so if you uninstall both, then install PS, first, then LR.  Of course with this release there may be some hiccup that requires installing either one or the other, again, but if you've uninstalled both and are reinstalling both, then install PS, first.

  • HT2589 when I try and log in my i-tunes account or my app store account on my i-phone it says "this apple I.D has not yet been used on the i-tunes store" it gives me 2 optins "cancel" or "review" I press review, enter my bank details but they decline..why

    Hi can anybody help or advise me? I've recently bought the i-phone 4s, I've set up my apple I.D and password but everytime I try and log in it says "this apple I.D has not yet been used on the i-tunes store" I click "review" follow the instructions and agree to the terms and condition's, enter my bank details but it declines every time? I've tried both my accounts and its declined both, this stops me from logging in so I can't download anything for free or buy anything, my sister had the option of skipping the bank details part when she created her apple I.D and just enters her's when buying something, why do I not have that option?? And why is it declining my bank details...please HELP!!!!!

    The details I'm entering are correct, I choose visa as my card type, enter my card number, enter my expiry date and my last 3 digts on the reverse of the card, enter my address and zip code plus my home telephone number, click continue and it says "the payment method you have selected has been declined, please enter another payment method". I've lost count how many times I've tried, I've typed my details in slowly making sure I put them in properlly and it still declines it, I've even tried makeing a new apple I.D and when I get to the bank details part it declines it again so I am forced to press cancel and all details are not saved so its just like I'm hitting a brick wall, its ******* me off!!! I can't even download any of the free app's because to do so you must log in but when I do it says "this apple I.D has not yet been used in the i-tunes store" review my details and can't get past the bank details part. So doesn't log me in, I'm honestly out of ideas

  • I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks it asks for the old account's password(which my ex changed by now)

    I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks (only happens with this app)it asks for the other account's password(which my ex changed by now). I don't understand why this happens when I'm logged into my account and it only happens with that app. Please help, I need to update. :/

    Content (apps, music, ibooks, films etc) is tied to the account that originally downloaded it, so if the iBooks app was downloaded using the account that you used to share with your ex then only that account can download updates to it. As it's a free app you could delete it and re-download it under your own account - and then re-download your ibooks into it (or copy the books to your computer's iTunes first via File > Transfer Purchases and then sync them back to the app).

  • Open and converting raw in ps 7

    how can i open and convert raw nef images from my 35mm nikon into pdf using ps 7?  Raw is listed under OPEN as a category but i cannot make it happen.

    You need to first open the NEF file in Photoshop, and if you are really talking about the very old version 7, there is every chance that will be a problem.  I don't even know if Version 7 supported Camera RAW, but I think it did.  So I am having to guess because of the age of the version you are using, but you will probably need to download the free DNG converter.
    http://www.adobe.com/nz/products/photoshop/extend.displayTab2.html

  • 1. TACAS+ Accounting and Logged in Users report is not working on ACS 4.1(1

    Hi,
    I am facing problem with ACS 4.1 accounting, TACAS+ Accounting and Logged in Users report are not working, the csv file is been generated but nothing is showened in the file.
    I have checked the documents related to ACS 4.1, it says that there is a bug related to command accounting “CSCsg97429 - TACACS+ Command Accounting does not work in ACS 4.1(1) Build 23”.
    Tried upgrading the same with the patch applAcs-4.1.1.23.3.zip, still it is not working.
    Other reports are working fine.
    1. TACAS+ Accounting - not working
    2. Logged in Users - not working
    3. TACAS+ Administration - working
    4. Passed Authentication - working
    5. Failed Attempts - working
    Any suggestions or any idea, please revert.
    Regards
    Vineet

    Hi,
    Thanks
    Yes I have configured the command “aaa accounting exec default start-stop group tacacs+”
    As I have mentioned all the other reports are working. Which user and when he has logged in and what commands he has used. Only the TACAS+ Accounting and logned user is not working.
    Regards,
    Vineet

Maybe you are looking for