Oracle ODBC and BLOB in html

Hi,
I would like to ask you if cad I use Oracle-ODBC driver (whuch version) for reading BLOB (LRAW) column in html(asp) - JavaScript.
create table JPG
CLZM NUMBER(6) not null,
JPG_FILE LONG RAW null ,
<% @ LANGUAGE=JavaScript%>
<%
Response.Buffer = true;
Response.ContentType = "image/jpeg";
Response.AddHeader("Content-Disposition","attachment; filename=test.jpg");
Response.CacheControl = "public";
Response.Expires = 0;
oConn = Server.CreateObject("ADODB.Connection");
oConn.Open("DSN=ORACLE;UID=scott;PWD=tiger;");
// Query SQL to obtain recordset containing gif BLOB
oRs = oConn.Execute("SELECT JPG_FILE FROM JPG WHERE CLZM='3156'");
// Obtain local variable of /*
PicSize = oRs("JPG_FILE").ActualSize;
Pic = oRs("JPG_FILE").GetChunk(PicSize);
// ??? Obtain only 4 bytey - why ???
Response.BinaryWrite(Pic);
Response.End();
%>
Thank's
Ondrej

I had the same problem using VBScript.
What you have to do isread in blocks of let's say 1k in a loop and check wether the return value is exactly 1k, if not you may end your loop.
Here's my code in VBScript.
Dim varBlob
Dim varChunk
Const chuckSize = 1024
Do
varChunk = objRs.Fields("blobField").getChunk(chuckSize)
varBlob = varBlob & varChunk
Loop While (len(varChunk) = chuckSize)
the contents of varBlob is your Picture
null

Similar Messages

  • Oracle ODBC and DAO extremely slow

    Hi
    I'm using Microsoft DAO 3.6 with an Oracle ODBC connection (version 9.2) in an VB6 application.
    Opening an updateable dynaset is extremely slow, I have measured the performance with Oracle ODBC, Microsoft Oracle ODBC and Microsoft SQL-Server ODBC as follows:
    Oracle ODBC: 1952 ms
    MS Oracle ODBC: 360 ms
    MS SQL-Server ODBC: 40 ms (connection to a MS SQL-Server)
    If I use the SQLpassthrough option the result is about 10 ms in all 3 cases, but the dynaset is readonly !
    The testing program is as follows:
    Option Explicit
    Private Declare Function timeGetTime Lib "winmm.dll" () As Long
    Private Sub Form_Load()
    Dim wsdata As DAO.Workspace
    Dim db As DAO.Database
    Dim dbconn As String
    Dim rs As DAO.Recordset
    Dim start As Long
    dbconn = "ODBC;DSN=AdhocitORA;UID=adhocit;PWD=adhocit;"
    Set wsdata = DBEngine.Workspaces(0)
    Set db = wsdata.OpenDatabase("", False, False, dbconn)
    start = timeGetTime
    Set rs = db.OpenRecordset("Select * from Afdeling", dbOpenDynaset)
    rs.MoveLast
    rs.MoveFirst
    rs.Close
    Set rs = Nothing
    MsgBox "Time " & timeGetTime - start
    End Sub
    Is there any setting in the Oracle ODBC, that need to be adjusted ??
    Erling

    Why are you doing a moveLast followed by a moveFirst? That's going to force Oracle to retrieve all the records in the recordset. If there are a lot of records, you'll probably see a benefit if you increase the prefetch in the Oracle ODBC DSN configuration.
    Justin

  • ORACLE-ODBC and ACCESS2000

    Hi,
    I am working with Oracle-ODBC-Driver 8.01.61.00 (from 28.04.2000) and Access2000 under Windows2000 in a german-version.
    Access removes the comma by decimal-types.
    In Oracle I have 5.12 but access shows me 512 !!! :-((
    Who can help me ???
    This is very, very, very urgent !!!!
    Thanks !
    Hallo,
    Ich habe Oracle-ODBC-Treiber 8.01.61.00 vom 28.4.2000 dazu Access2000 und Windows2000 auf deutsch.
    Leider entfernt Access alle Dezimaltrenner bei Zahlen mit Dezimalstellen.
    In der Oracle steht 5,12 und Access zeigt mir 512 an !!!
    Wer kann helfen ??? Es ist dringend !!!
    Danke

    Note that the original poster asked the same question a day earlier in the thread "ACCESS and ODBC and Numeric's" which has received a couple of replies.
    Justin Cave
    ODBC Development

  • How to extract image from oracle database and display at html page

    Could you help me how to make the image to display. i manage to extract the data but the data is in Blob so i need to convert it so make it display at html page.

    Thanks for ur reply Mr.Rajasekhar
    I tried as u said,
    i tried without converting to sql date ,but still i din't get any results
    java.text.SimpleDateFormat dateFormat=new java.text.SimpleDateFormat("dd/MM/yyyy");
             java.util.Date fromDate=dateFormat.parse(startDate);
            java.util.Date tillDate=dateFormat.parse(endDate);          
              String query1="select MTName,Date,MTLineCount from linecountdetails where mtname='"+MTName+"'  and Date >='"+fromDate+"' and Date <='"+tillDate+"' " ;
            System.out.println(query1);
    //From main method
    databaseConnection("prasu","1/12/2005","31/12/2005");I got the output as
    ---------- java ----------
    select MTName,Date,MTLineCount from linecountdetails where mtname='prasu'  and Date >='Thu Dec 01 00:00:00 GMT+05:30 2005' and Date <='Sat Dec 31 00:00:00 GMT+05:30 2005'
    java.lang.NullPointerException
    null
    null
    java.lang.NullPointerException
    Output completed (4 sec consumed) - Normal TerminationThanks
    Prasanna.B

  • I'm having issues with oracle ODBC and access 2007

    Hello all,
         I'm having an issue with using an ODBC connection with a pass-through query in access 2007. I have Oracle 9i installed and am on Windows 7 32 bit. This only seems to be effecting Windows 7 users and not XP users.
    The error in the SQL Log is this.
    CLDemoFE        1694-162c EXIT  SQLDriverConnectW  with return code -1 (SQL_ERROR)
      HDBC                0x00787430
      HWND                0x000501FC
      WCHAR *             0x6D3A8B34 [      -3] "******\ 0"
      SWORD                       -3
      WCHAR *             0x6D3A8B34
      SWORD                       -3
      SWORD *             0x00000000
      UWORD                        0 <SQL_DRIVER_NOPROMPT>
      DIAG [NA000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-01019: unable to allocate memory in the user side (1019)
      DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)
      DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)
    I've been looking all over the internet and can't find an answer to the issue and decided to post it to see what other people thought.
    Thank you in advance.

    I've had exactly the same problem for weeks now.   When using Safari, it stalls, freezes, then starts working again.  I checked the console and exactly when it freezes.  I get the following:
    2015-02-25 5:51:59.000 PM kernel[0]: process com.apple.WebKit[405] caught causing excessive wakeups. Observed wakeups rate (per sec): 216; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 849849
    and:
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.FC16A539-929A-43E5-91EB-34A5669B70FD[1265]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.FC16A539-929A-43E5-91EB-34A5669B70FD[1265]) Using fallback option to terminate job...
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.1004D4B5-112D-4D90-9779-B2BEFB570C7F[1262]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.1004D4B5-112D-4D90-9779-B2BEFB570C7F[1262]) Using fallback option to terminate job...
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.9F72A6A1-63F5-41B2-B02F-40D4CB0925A2[1261]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.9F72A6A1-63F5-41B2-B02F-40D4CB0925A2[1261]) Using fallback option to terminate job...
    2015-02-25 9:21:46.864 PM com.apple.launchd[1]: (com.apple.WebKit.Networking.8CDDD2D1-B6B6-4F09-B8DE-5C4A4E9F653E[1260]) Exited with code: 1
    2015-02-25 9:21:46.998 PM com.apple.launchd[1]: (com.apple.WebKit.Plugin.64.39152B03-68E5-463E-A6C0-A9734AF733A2[1268]) Exited with code: 1

  • Oracle ODBC BLOB examples.

    We are currently writing a VB application to harvest data from an Access 2000 database, which is to large to convert to 97 and use migration workbench, and stuff it into an Oracle 8 database, which already has the table structures from the Access dataabase created in it. We are running into a problem in transfering OLE objects in Access to BLOBs in Oracle. Can anyone give some insight / code examples?
    Thanks,
    Matt Shoultz

    When you get a chance, can you post the ADO version, or a link to it?
    thanks.
    Chris
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Justin Cave ([email protected]):
    Unfortunately, I've never dealt with OLE objects in Access. I'm more than happy to help with BLOB's, though.
    I'm posting a document below that covers reading & writing BLOB's with RDO under VB. Unfortunately, it's a little long, so I hope it doesn't get mangled too badly. If there's interest in an ADO version, let me know that as well and I'll post it on another thread.
    If folks would like me to e-mail them a copy of this document, drop me a line. Expect it to take me at least a few days to reply to these requests, though.
    PURPOSE
    The code below should demonstrate how to read from and write to Oracle
    8 BLOB datatypes.
    SCOPE & APPLICATION
    Experienced Visual Basic Developers.
    RELATED DOCUMENTS
    None.
    The code below this demonstrates how to create a Visual Basic project
    to read from and write to BLOB datatypes. It was written and tested using Visual
    Basic 5 and RDO 2. The Oracle 8.0.5.2 ODBC driver was also used and an
    Oracle 8.0.5 database.
    Disclaimer:
    This sample is provided for educational purposes only. It is NOT supported by
    Oracle World Wide Technical Support. The sample has been tested and appears to
    work as intended. However, you should always test in YOUR environment before
    relying on it.
    'Form Image Description
    '~~~~~~~~~~~~~~~~~~~~~~
    'The form needs 1 OLE control (OLE1) and 1 small text box (text 1) default value '1'
    'it also needs 4 command buttons (AddNew,LoadFrom,LoadFromFile,SaveToDB)
    'ODBC Datasource
    '~~~~~~~~~~~~~~~
    'Configure an 8.0.5.2 Oracle ODBC Driver Datasource named 'V805'
    'Code required to generate database objects.
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'drop table tblTestBlob;
    'CREATE TABLE tblTestBlob
    ' DATA_ID NUMBER(5,0),
    ' DATA_BlobData BLOB,
    ' DATA_MemoData CLOB
    'INSERT INTO TBLTESTBLOB VALUES (1,EMPTY_BLOB(), EMPTY_CLOB());
    Option Explicit
    Dim en As rdoEnvironment
    Dim Qd As rdoQuery
    Dim Cn As rdoConnection
    Dim Rs As rdoResultset
    Dim SQL As String
    Dim DataFile As Integer, Fl As Long, Chunks As Integer
    Dim Fragment As Integer, Chunk() As Byte, I As Integer
    Const ChunkSize As Integer = 16384
    Dim fileName As String
    Private Sub PipeToFile(sFileName)
    Dim iFile As Integer
    iFile = FreeFile
    Open sFileName For Binary As iFile
    Me.OLE1.SaveToFile iFile
    DoEvents
    Close iFile
    End Sub
    Private Sub AddNew_Click()
    Dim sSQL As String
    sSQL = "Select * from TBLTESTBLOB"
    On Error GoTo errorhandler
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    Rs.AddNew
    Rs("DATA_ID") = Val(Me.Text1)
    Rs("DATA_BLOBDATA").AppendChunk Null
    Rs("DATA_MEMODATA").AppendChunk Null
    Rs.Update
    Rs.Close
    Set Rs = Nothing
    Exit Sub
    errorhandler:
    MsgBox "Add new click"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub Form_Load()
    On Error GoTo errorhandler
    Set Cn = New rdoConnection
    Cn.CursorDriver = rdUseOdbc
    Cn.Connect = ";dsn=" & "V805" & ";uid=" & "scott" & ";pwd=" & "tiger"
    Cn.EstablishConnection
    Exit Sub
    errorhandler:
    MsgBox "Form Load"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Function GetBLOBLength() As Long
    Dim sSQL As String
    Dim oResult As RDO.rdoResultset
    On Error GoTo errorhandler
    sSQL = "SELECT DBMS_LOB.GETLENGTH(DATA_BLOBDATA) FROM TBLTESTBLOB WHERE DATA_ID=" & Text1
    Set oResult = Cn.OpenResultset(sSQL, rdOpenStatic)
    GetBLOBLength = Val("" & oResult.rdoColumns(0).Value)
    oResult.Close
    Set oResult = Nothing
    Exit Function
    errorhandler:
    MsgBox "Get BLOB Length"
    MsgBox Err.Number
    MsgBox Err.Description
    End Function
    Private Sub LoadFrom_Click()
    Dim iNumBlocks As Integer
    Dim lColSize As Long
    Dim lBlockSize As Long
    Dim byteData() As Byte
    Dim lOffSet As Long
    Dim iDestFileNum As Integer
    Dim lLeftOver As Long
    Dim iCount As Integer
    Dim sSQL As String
    On Error GoTo errorhandler
    sSQL = "Select * from TBLTESTBLOB WHERE DATA_ID=" & Val(Text1)
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    If Not Rs.EOF Then
    lColSize = GetBLOBLength()
    If lColSize <> 0 Then
    iDestFileNum = FreeFile
    Open "c:\TEST.DAT" For Binary As iDestFileNum
    lBlockSize = 10000
    iNumBlocks = lColSize \ lBlockSize
    lLeftOver = lColSize Mod lBlockSize
    For iCount = 1 To iNumBlocks
    ReDim byteData(lBlockSize)
    byteData() = Rs("DATA_BLOBDATA").GetChunk(lBlockSize) 'note offset not used by RDO (?)
    Put iDestFileNum, , byteData()
    lOffSet = lOffSet + lBlockSize 'note offset not used by RDO (?)
    Next iCount
    ReDim byteData(lLeftOver)
    byteData() = Rs("DATA_BLOBDATA").GetChunk(lLeftOver) 'note offset not used by RDO (?)
    Put iDestFileNum, , byteData()
    Close iDestFileNum
    iDestFileNum = FreeFile
    Open "c:\TEST.DAT" For Binary As iDestFileNum
    Me.OLE1.ReadFromFile iDestFileNum
    Close iDestFileNum
    End If
    End If
    Rs.Close
    Set Rs = Nothing
    Exit Sub
    errorhandler:
    MsgBox "Load From click"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub LoadFromFile_Click()
    ' Locates a file and sets the Filename to this file.
    On Error GoTo errorhandler
    With CommonDialog1
    .Filter = "*.*"
    .ShowOpen
    fileName = .fileName
    End With
    FileName_Change
    Exit Sub
    errorhandler:
    MsgBox "Load from file"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub SaveToDB_Click()
    Dim sSQL As String
    Dim sTempName As String
    On Error GoTo errorhandler
    sTempName = "c:\TEST.DAT"
    Kill sTempName
    PipeToFile sTempName
    sSQL = "Select DATA_ID, DATA_BLOBDATA from TBLTESTBLOB WHERE DATA_ID=" & Val(Text1)
    'sSQL = "Select DATA_Field1, DATA_IMAGE from TBLBIGDATA WHERE DATA_FIELD1=" & Val(Text1)
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    If Not Rs.EOF Then
    Rs.Edit
    End If
    DataFile = 1
    Open sTempName For Binary Access Read As DataFile
    Fl = LOF(DataFile) ' Length of data in file
    If Fl = 0 Then
    Close DataFile
    Exit Sub
    End If
    Chunks = Fl \ ChunkSize
    Fragment = Fl Mod ChunkSize
    Rs("DATA_BLOBDATA").AppendChunk Null
    ReDim Chunk(Fragment)
    Get DataFile, , Chunk()
    Rs("DATA_BLOBDATA").AppendChunk Chunk()
    ReDim Chunk(ChunkSize)
    For I = 1 To Chunks
    Get DataFile, , Chunk()
    Rs("DATA_BLOBDATA").AppendChunk Chunk()
    Next I
    Close DataFile
    Rs.Update
    Rs.Close
    Set Rs = Nothing
    MsgBox "Finish"
    Exit Sub
    errorhandler:
    MsgBox "Save to DB"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub FileName_Change()
    On Error GoTo errorhandler
    Me.OLE1.CreateEmbed fileName
    Exit Sub
    errorhandler:
    MsgBox "File Name Change"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Justin Cave
    ODBC Development<HR></BLOCKQUOTE>
    null

  • Oracle optimizer and heterogeneous services (Transparent Gateway for ODBC)

    Hi everyone!
    We have the following configuration:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production.
    Oracle Database Gateway for ODBC 11.2.0.2.0 on the same machine as Oracle DB.
    Non-Oracle DB installed on a different hardware accessed through Oracle Gateway for ODBC via dblink.
    Now, we have to query the remote non-Oracle system and retrieve some data. For the sake of brevity let's suppose we have the following table in our non-Oracle DB:
    create table test (
         ip_address varchar(15),
         start_time datetime,
         end_time datetime
    And we run the following SQL query against the remote table on our Oracle DB:
    SELECT start_time,end_time,ip_address
    FROM remote_table@db_link
    WHERE
    end_time >= to_date('2011-10-11 00:00:00','rrrr-mm-dd hh24:mi:ss')
    OR (
    end_time IS NULL AND start_time >= to_date('2011-10-11 00:00:00','rrrr-mm-dd hh24:mi:ss')
    AND start_time <= to_date('2011-10-12 00:00:00','rrrr-mm-dd hh24:mi:ss')
    AND ip_address = '127.0.0.1';
    But, having query monitoring on the remote DB enabled, we see that the actual query on the remote site looks like this:
    SELECT "START_TIME","END_TIME","IP_ADDRESS"
    FROM "REMOTE_TABLE"
    WHERE "IP_ADDRESS"='127.0.0.1' AND "START_TIME"<=?
    All references to END_TIME column are gone from WHERE clause for whatever reason.
    However, Oracle execution plan shows us the following:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | SELECT STATEMENT | | 1 | 27 | 200 (0)| 00:00:03 | | |
    |* 1 | FILTER | | 1 | 27 | 200 (0)| 00:00:03 | | |
    | 2 | REMOTE | REMOTE_TABLE | | | | | DB_LINK | R->S |
    Predicate Information (identified by operation id):
    1 - filter("END_TIME">=TO_DATE('2011-10-11 00:00:00','rrrr-mm-dd hh24:mi:ss') OR
    "END_TIME" IS NULL AND "START_TIME">=TO_DATE('2011-10-11 00:00:00','rrrr-mm-dd hh24:mi:ss'))
    Remote SQL Information (identified by operation id):
    2 - SELECT "END_TIME","IP_ADDRESS","START_TIME" FROM "REMOTE_TABLE" WHERE
    "IP_ADDRESS"='127.0.0.1' AND "START_TIME"<=:1 (accessing 'DB_LINK' )
    This actually means that Oracle CBO decided that it will apply filter on END_TIME column after having retrieved the data from the remote site. We don't want this behaviour but have no idea how to affect execution plan in this case.
    So, the question is: How can we force Oracle CBO to not change the initial query and pass it to the remote site "as is"? Is there any way we can achieve this goal?
    Edited by: user12024904 on 28-Oct-2011 04:05

    Hi,
    Our Oracle DB and Gateway are running on the following system:
    HP-UX B.11.31 U ia64
    The following SQL code is executed in SQLPlus:
    SELECT start_time,end_time,ip_address
    FROM ip_acc_complete@gr_link
    WHERE
    END_TIME >= to_date('2010-10-21 00:00:00','rrrr-mm-dd hh24:mi:ss')
    OR (
    END_TIME is null AND START_TIME >= to_date('2010-10-21 00:00:00','rrrr-mm-dd hh24:mi:ss')
    AND START_TIME <= to_date('2010-10-22 00:00:00','rrrr-mm-dd hh24:mi:ss')
    AND IP_ADDRESS = '127.0.0.1';
    Gateway debug trace shows the following:
    Oracle Corporation --- TUESDAY NOV 01 2011 14:59:15.254
    Heterogeneous Agent Release
    11.2.0.2.0
    Oracle Corporation --- TUESDAY NOV 01 2011 14:59:15.254
    Version 11.2.0.2.0
    HOSGIP for "HS_FDS_TRACE_LEVEL" returned "ON"
    HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/local/greenwich64/lib/libodbc.so.1"
    HOSGIP for "HS_OPEN_CURSORS" returned "50"
    HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
    HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
    HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
    HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
    HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
    HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
    HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
    HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
    HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
    HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
    HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
    HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
    HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
    HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
    HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
    using query as default value for "HS_FDS_DEFAULT_OWNER"
    HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
    SQL text from hgopars, id=1, len=117 ...
    00: 53454C45 43542022 454E445F 54494D45 [SELECT "END_TIME]
    10: 222C2249 505F4144 44524553 53222C22 [","IP_ADDRESS","]
    20: 53544152 545F5449 4D452220 46524F4D [START_TIME" FROM]
    30: 20224950 5F414343 5F434F4D 504C4554 [ "IP_ACC_COMPLET]
    40: 45222057 48455245 20224950 5F414444 [E" WHERE "IP_ADD]
    50: 52455353 223D2731 32372E30 2E302E31 [RESS"='127.0.0.1]
    60: 2720414E 44202253 54415254 5F54494D [' AND "START_TIM]
    70: 45223C3D 3F [E"<=?]
    Deferred open until first fetch.
    Performing delayed open.
    The non-Oracle DB is CopperEye Retrieval Server with its own custom ODBC driver.
    CopperEye query log shows that the following query is received from Oracle Gateway:
    01/11/2011 14:26:31 - NEW QUERY :
    SELECT "END_TIME","IP_ADDRESS","START_TIME" FROM "IP_ACC_COMPLETE" WHERE "IP_ADDRESS"='127.0.0.1' AND "START_TIME"<=?
    which complies with the information in Oracle Gateway trace file.
    So, it seems that it's Oracle DB decision to split the original WHERE clause into two parts, delegate one part to the remote site, retrieve the data and then apply the remaining filter locally.

  • Oracle 8 and 8i ODBC drivers

    I have written a win32 client application with Visual C++ for accessing an oracle 8.0.5 server on a linux platform.I have used an ODBC connection (MFC classes CDatabase e CRecordset). In application I have used a recordset on a view for updating the view's base table. On a view I have defined an instead of update trigger. All works fine. Now I must migrating it on an oracle 8.1.7 oracle server (or on win2k or linux). End now start the problem. On 8i server, after executing the query on the view, the function SQLGetStmtOption with SQL_CONCURRENCY param return SQL_CONCUR_READ_ONLY, making the recordset read only and i don't modify the view. What's the differences between Oracle 8 and Oracle 8i ODBC driver? Why with Oracle 8i I don't modify a view?
    null

    Executed query is
    SELECT * FROM VIEW_NAME WHERE ID = value
    where ID is a primary key of the only key preserving table of the view.

  • Oracle database (10.2.0.4) and HTTP server / HTML DB conflict

    Hi there,
    I installed a fresh 10.2.0.1 (patched with 10.2.0.4) oracle database on Oracle Entreprise linux 5.7, and HTTP server + HTML DB products from the companion CD. Both are located in different home directory:
    ODB:  $ORACLE_BASE/product/10.2.0/db_1
    APEX: $ORACLE_BASE/product/10.2.0/apex
    I just discovered that logs files ($APEX/opmn/logs/) have filled up my entire disk this week end. After some googling / digging, I've read that there is a conflict between the ONS services that run for both products on the same port. Opening the configuration files of both products:
    +$ODB/opnm/conf/ons.config+
    +$APEX/opnm/conf/opnm.xml+ (btw, ons.conf is empty)
    I indeed saw that they both use port 6113 as local port and 6200 as remote port. The workaround I've found in variuos places is to either change the port number, or unsuscribe ONS for the database listener (and sometimes both).
    Question 1: what is the best solution ? what are the consequences for the database listener in case of unsuscribtion ?
    I also saw that opnm.xml in APEX configuration file is making use of the $ORACLE_HOME environment variable, which I define in my /etc/profile as $ORACLE_BASE/product/10.2.0/db_1. So I guess the opnm of APEX is looking at the wrong place... Yet if I change ORACLE_HOME in my /etc/profile, I won't be able to run dbstart upon stgartup, as it is run using ORACLE_HOME in a init.d script...
    Question 2: Can someone clarify things up about the exact relationship between oracle database and HTTP server ? How should I deal with ORACLE_HOME environment variable, which one use it and when... ?
    Note that I'm completely new to Oracle (and hence APEX).
    Thanks in advance!

    Billy  Verreynne  wrote:
    There should be no conflicts - except for configuration ones.
    Oracle is multi home capable. Thus multiple Oracle s/w products installed into different homes and these products running side by side.
    The conflict is system resources - like a TCP port. That port cannot be shared by multiple processes. So you need to make sure that each s/w component that needs a TCP listener end-point, has a unique port number allocated for it to use.
    As mentioned, the Oracle Apache server is an Oracle client with respect to Oracle client-server architecture. It simply needs a client OCI driver to connect to the Oracle database instance. So whether you run Oracle Apache on the same server as the database instance, or on another server all together - this makes no difference. The Oracle Apache s/w will be using its home for running. It has no need for anything from the database instance's home directory. Thus there are no conflicts - as long as you correctly keep them separated and not set the wrong home for the wrong component or include the wrong path (to another home's executables).
    OK, so to summarize a bit:
    - I should just be carefull when running startup script which will launch all services upon startup, i.e. changing the value of ORACLE_HOME before running each product startup script (dbstart => ORACLE_HOME = (..)/10.2.0/db_1, opmnctl => ORACLE_HOME = (..)/apex). I'm still quite worried because ORACLE_HOME is heavily used in opmn.xml but anyways.
    - That's basically it: when each product's services are running, they do not use ORACLE_HOME (and such) anymore, hence no conflict from this point of view.
    Also do not attempt to use IPC connectivity between the mod_plsql Apache module and the database instance. Does not make sense ito performance. Shared server should be considered and localhost TCP connectivity can be used.Well as I don't really know IPC yet, so hopefully I won't get into troubles. Just to be clear about that, i've this in my listener.ora:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = apex.nwk)(PORT = 1521))
    Does that mean that ICP will be used somehow ?
    Thanks again from your help.
    Edited by: lv on 27 févr. 2012 06:42

  • Ms-access XP front-end and oracle ODBC driver

    Hi all,
    I need to set up 5 workstations with ms-access front end accessing an oracle database through Oracle ODBC 9.2.0.5.0 driver and linked tables.
    My main concern is to learn about any issues that may limit what can and can�t be done through access as opposed to an oracle client. I found out that the maximum size of an access XP database is 2GB, but I have not found accurate information as to the maximum number of records ms-access can handle per table. This would be of critical importance to me because the tables I'm working with may eventually hold up to hundreds of thousands of records.
    Concurrency control is also an important topic since 2 or more of the clients may at some point read or write information on the same tables.
    Answers to these questions and any other issues of special importance would be greatly appreciated.
    Thanks a lot,
    JP.

    Just seen this message you had posted to OTN. I am currently looking for some sample codes developing applications using MS Access as front end connected to Oracle database. I appreciate if you can provide me some sample codes that has a master-detail-relationship type of access form that performs an inserts into the master and detail table. Thanks a lot.

  • ODBC connectivity between Oracle 11G and MSSQL Server on Solaris 10

    When we were running in 10G, I was able to successfully configure hsodbc using unixODBC and freeTDS to allow for an ODBC connection between Oracle and MSSQL Server.
    A few weeks ago we upgraded to 11G and I've been struggling to get the connectivity (dg4odbc) working.
    In our 10g environment unixODBC and freeTDS were compiled as 32-bit. I have recompiled them as 64-bit and switched over to an 11G listener and I am getting the following error:
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    here are my configuration files:
    /usr/local/unixODBC/etc[PPRD]> more odbc.ini
    [ODBC Data Sources]
    identipass = MS SQL Server
    [identipass]
    Driver = /usr/local/freetds/lib/libtdsodbc.so
    Setup = /usr/local/freetds/lib/libtdsodbc.so
    Description = MS SQL Server
    Trace = 1
    TraceFile = /export/home/oracle/ODBC/odbc.trace
    Server = stormwind
    QuoteID = Yes
    AnsiNPW = No
    Database = identipass
    Port = 1433
    TDS_Version = 8.0
    [Default]
    Driver = /usr/local/freetds/lib/libtdsodbc.so
    /usr/local/unixODBC/etc[PPRD]> more odbcinst.ini
    [TDS]
    Description=FreeTDS driver
    Driver=/usr/local/freetds/lib/libtdsodbc.so
    Setup=/usr/local/freetds/lib/libtdsodbc.so
    Trace=Yes
    TraceFile=/tmp/freetds.log
    FileUsage=1
    UsageCount=2
    tnsnames.ora
    identipass =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = tcp)(HOST = localhost)(PORT = 1522))
    (CONNECT_DATA =
    (SID = identipass)
    (HS = OK)
    listener.ora
    LISTENERODBC =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    SID_LIST_LISTENERODBC=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=identipass)
    (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
    (ENV="LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:/u01/app/oracle/product/11.2.0/db_1/hs/lib")
    (PROGRAM=dg4odbc)
    And finally, output from the trace file:
    /u01/app/oracle/product/11.2.0/db_1/hs/log[PPRD]> more identipass_agt_1381.trc
    Oracle Corporation --- THURSDAY NOV 18 2010 16:00:16.010
    Heterogeneous Agent Release
    11.2.0.1.0
    Oracle Corporation --- THURSDAY NOV 18 2010 16:00:16.008
    Version 11.2.0.1.0
    Entered hgogprd
    HOSGIP for "HS_FDS_TRACE_LEVEL" returned "Debug"
    Entered hgosdip
    setting HS_OPEN_CURSORS to default of 50
    setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
    setting HS_FDS_RECOVERY_PWD to default value
    setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
    setting HS_IDLE_TIMEOUT to default of 0
    setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
    setting HS_NLS_NCHAR to default of "AL32UTF8"
    setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
    setting HS_FDS_DATE_MAPPING to default of "DATE"
    setting HS_RPC_FETCH_REBLOCKING to default of "ON"
    setting HS_FDS_FETCH_ROWS to default of "100"
    setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
    setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
    setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
    setting HS_FDS_CHARACTER_SEMANTICS to default of "FALSE"
    setting HS_FDS_MAP_NCHAR to default of "TRUE"
    setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
    setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
    setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
    setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
    setting HS_FDS_QUERY_DRIVER to default of "TRUE"
    HOSGIP returned value of "FALSE" for HS_FDS_SUPPORT_STATISTICS
    Parameter HS_FDS_QUOTE_IDENTIFIER is not set
    setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
    setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
    setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
    Default value of 64 assumed for HS_FDS_SQLLEN_INTERPRETATION
    setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLSt
    atistics;gtw$:SQLGetInfo"
    setting HS_FDS_DELAYED_OPEN to default of "TRUE"
    setting HS_FDS_WORKAROUNDS to default of "0"
    Exiting hgosdip, rc=0
    ORACLE_SID is "identipass"
    Product-Info:
    Port Rls/Upd:1/0 PrdStat:0
    Agent:Oracle Database Gateway for ODBC
    Facility:hsa
    Class:ODBC, ClassVsn:11.2.0.1.0_0008, Instance:identipass
    Exiting hgogprd, rc=0
    Entered hgoinit
    HOCXU_COMP_CSET=1
    HOCXU_DRV_CSET=873
    HOCXU_DRV_NCHAR=873
    HOCXU_DB_CSET=873
    HOCXU_SEM_VER=112000
    Entered hgolofn at 2010/11/18-16:00:16
    HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/local/unixODBC/lib/libodbc.so"
    Entered hgolofns at 2010/11/18-16:00:16
    symbol_peflctx=0x7a715450
    hoaerr:0
    Exiting hgolofns at 2010/11/18-16:00:16
    Exiting hgolofn, rc=0 at 2010/11/18-16:00:16
    HOSGIP for "HS_OPEN_CURSORS" returned "50"
    HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
    HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
    HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
    HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
    HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
    HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
    HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
    HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
    Invalid value of 64 given for HS_FDS_SQLLEN_INTERPRETATION
    treat_SQLLEN_as_compiled = 1
    Exiting hgoinit, rc=0 at 2010/11/18-16:00:16
    Entered hgolgon at 2010/11/18-16:00:16
    reco:0, name:identipass, tflag:0
    Entered hgosuec at 2010/11/18-16:00:16
    Exiting hgosuec, rc=0 at 2010/11/18-16:00:16
    HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
    HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
    HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_CHARACTER_SEMANTICS" returned "FALSE"
    HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
    HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
    HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
    HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
    HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
    using identipass as default value for "HS_FDS_DEFAULT_OWNER"
    HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
    Entered hgocont at 2010/11/18-16:00:16
    HS_FDS_CONNECT_INFO = "identipass"
    RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
    Entered hgogenconstr at 2010/11/18-16:00:16
    dsn:identipass, name:identipass
    optn:
    Entered hgocip at 2010/11/18-16:00:16
    dsn:identipass
    Exiting hgocip, rc=0 at 2010/11/18-16:00:16
    Exiting hgogenconstr, rc=0 at 2010/11/18-16:00:16
    Entered hgopoer at 2010/11/18-16:00:16
    hgopoer, line 233: got native error 0 and sqlstate ; message follows...
    Exiting hgopoer, rc=0 at 2010/11/18-16:00:16
    hgocont, line 2753: calling SqlDriverConnect got sqlstate
    Exiting hgocont, rc=28500 at 2010/11/18-16:00:16 with error ptr FILE:hgocont.c LINE:2772 ID:Something other than invalid authoriza
    tion
    Exiting hgolgon, rc=28500 at 2010/11/18-16:00:16 with error ptr FILE:hgolgon.c LINE:781 ID:Calling hgocont
    Entered hgoexit at 2010/11/18-16:00:16
    Exiting hgoexit, rc=0
    Can anyone help me see what I'm missing?

    Thank you for your response.
    I modified the envs LD_LIBRARY_PATH parameter in my SID_LIST_LISTENERODBC to be:
    (ENV="LD_LIBRARY_PATH=/usr/local/freetds/lib:/usr/local/unixODBC/lib:/u01/app/oracle/product/11.2.0/db_1/lib:/
    u01/app/oracle/product/11.2.0/db_1/hs/lib")
    and bounced the listener, but I'm still getting the same error.
    I do not have a lib64 directory in my Freetds installation, but all the files in the lib directory are 64-bit.
    Here is a listing of my DG4ODBC init file:
    /u01/app/oracle/product/11.2.0/db_1/hs/admin[PPRD]> more initidentipass.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an ODBC Agent.
    # HS init parameters
    HS_FDS_CONNECT_INFO = identipass
    #HS_FDS_TRACE_LEVEL = 0
    HS_FDS_TRACE_LEVEL = Debug
    HS_FDS_SHAREABLE_NAME = /usr/local/unixODBC/lib/libodbc.so
    HS_FDS_SUPPORT_STATISTICS=FALSE
    HS_LANGUAGE=AMERICAN.AMERICA.WE8ISO8859P15
    # ODBC specific environment variables
    set ODBCINI=/usr/local/unixODBC/etc/odbc.ini
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>
    Thanks for your help with this!
    Catina

  • Download and installing oracle odbc driver alone

    Hi all,
    I wanted to find out if I can download just the oracle odbc driver and install in without actually installing oracle database or client version on windows PC.
    thank you

    You will need to have some Oracle software on your machine for the Oracle ODBC driver to function.
    If you can use the 10g client, you can install the 10g Instant Client and the ODBC driver. The Instant Client is a minimal set of libraries that allow components like the Oracle ODBC driver to work. The 10g client, though, is not certified to connect to databases earlier than 8.1.7.
    If you have to use an earlier version, you have to install the full Oracle client, which is not a small install, to be able to use the Oracle ODBC driver.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Multiple Charsets with Oracle 9i and ODBC

    I am using the latest Oracle ODBC driver to connect my C++ COM application running under IIS 5.0 to a multilingual Oracle 9i database running on a Win2K server.
    Currently, all characters are displayed correctly except for a few special accented characters in the Czech alphabet. The erratic Czech characters are displayed as upside down question marks.
    These characters display correctly when I connect to Oracle with JDBC, but not with ODBC. These characters also display correctly when I query them out of a MSSQL 2000 database using ODBC or OLEDB. NOTE: These characters are also displayed as upside down question marks when I query Oracle from SQL Plus directly on the server.
    I have read the FAQ's on multilingual applications and Oracle/ODBC, but I don't see what I am missing. Force W_CHAR Support is set to true in my ODBC configuration settings.
    I've spent many hours trying to work out a solution to this problem with no luck. My customer would like to fix this problem ASAP, and would also like to be certain that we can go ahead with data using other character sets - Han, Cyrillic, Greek, etc.
    Another question - is it possible to set up an Oracle 9i database to not support Unicode / UTF8, and if our databased is configured in such a manner, should we expect problems with the data coming out of it when connecting via ODBC?

    Also, I realize now that I got some terminology mixed up in my first post. Obviously "Unicode" encompasses both UTF8 and UTF16 encoding, but I understand that one usually means UTF16 when one says Unicode.
    My client is so far unwilling to set this database up to use UTF16 encoding, so I am trying to find another solution that allows me to display special characters from an Oracle database using UTF8 encoding. As I mentioned before, JDBC corrects the erratic data, and I have come across information about a rather expensive third party ODBC driver that supposedly corrects the data, as well. I would like to know if it's possible for me to correct the data without converting the DB to use UTF16.

  • Oracle 8i and Windows 2000 - ODBC issue

    Oracle ODBC Test will not connect to a DSN that worked in Windows NT 4.0. After upgrading to Windows 2000, my ODBC stuff is hammered. I have many applications that rely on these DSN's. Does anybody have any suggestions? Please send comments/suggestions to [email protected] HELP! PLEASE!

    Hello:
    I need the following product:
    ORACLE COM.DOT this suit include:
    Oracle 8i, oracle webdb, oracle bronze support and others.
    Please, somebody can tell me which is de part number or what package include all this aplicattions.
    Thanks and i4m waiting for an answer.
    null

  • Oracle 01g and forms 6i with BLOB Data type

    Dear All,
    I have upgraded my database from oracle 9i R2 to oracle 10g R2. i have an application developed using oracle forms and reports 6i. this application have a form where it stores and retirive an image from the database, this image is stored in a table with a BLOB data type, it was being retrieved fine until we did the upgrade and now it is impossible for me to see the image and i am getting an error every time i retrive the data. it always pop a message saying that "INCONSISTENT DATA TYPE"
    please guys help.
    Regards

    you can try this procedure
    DECLARE
    t_blob BLOB;
    t_len NUMBER;
    t_file_name VARCHAR2(100);
    t_output UTL_FILE.file_type;
    t_TotalSize number;
    t_position number := 1;
    t_chucklen NUMBER := 4096;
    t_chuck raw(4096);
    t_remain number;
    BEGIN
    -- Get length of blob
    SELECT DBMS_LOB.getlength (PHOTO), ename || '_1.jpg'
    INTO t_TotalSize, t_file_name FROM DEMO WHERE ENAME ='moon';
    t_remain := t_TotalSize;
    -- The directory TEMPDIR should exist before executing
    t_output := UTL_FILE.fopen ('TEMPDIR', t_file_name, 'wb', 32760);
    -- Get BLOB
    SELECT PHOTO INTO t_blob FROM DEMO WHERE ENAME ='moon';
    -- Retrieving BLOB
    WHILE t_position < t_TotalSize
    LOOP
    DBMS_LOB.READ (t_blob, t_chucklen, t_position, t_chuck);
    UTL_FILE.put_raw (t_output, t_chuck);
    UTL_FILE.fflush (t_output);
    t_position := t_position + t_chucklen;
    t_remain := t_remain - t_chucklen;
    IF t_remain < 4096
    THEN
    t_chucklen := t_remain;
    END IF;
    END LOOP;
    END;
    it will work

Maybe you are looking for