How can I retrieve a LONG data type using ADO

In VB I am using an ADODB object to retrieve data from an Oracle table that has a LONG data type column...
specifically: SELECT TRIGGER_BODY FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'MYTRIGGER'
I have tried using the GETCHUNK method but it only returns the first 150 or so characters no matter how
many times I call it???? here is the sample code I'm using........
Dim Cn As ADODB.Connection, Rs As ADODB.Recordset, SQL As String
Dim sChunk() As Byte
Set Cn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Cn.CursorLocation = adUseServer
Cn.Open "Provider=OraOLEDB.Oracle.1;Password=hrzadmin;Persist Security
Info=True;UserID=hadmin;Data Source=xxx.local"
SQL = "SELECT trigger_body from user_triggers where trigger_name = 'MYTRIGGER'"
Rs.Open SQL, Cn, adOpenStatic, adLockReadOnly
Debug.Print Rs!trigger_name
Debug.Print Rs!trigger_body
sChunk = rs.Fields("trigger_body").GetChunk(500)
Debug.Print sChunk

I have a similar code which works for chunk size >400,
The image I am trying to retrieve is huge so the chunksize is also more.
Did you try with any non meta table?
For your reference I am pasting my application code below.
Hope it helps.
--Jagriti
Private Sub cmdGetImage_Click()
Dim bytchunk() As Byte 'variable to store binary data
Dim destinationFileNum As Integer 'variable for filenumber
'recordset for fetching Product Image for the product selected form the list
Dim recProductImage As New ADODB.Recordset
Dim offset As Long
Dim totalsize As Long
Dim roundTrips As Long
'variables used in calculation of time taken to fetch the image
Dim startTime As Currency, EndTime As Currency, time As Currency, Freq As Currency
Dim i As Integer 'counter variable
i = 0
On Error GoTo ErrorText 'redirect to error handler
'** Step 1 **'
'validating if product is selected from the list
If cboSelectProduct.Text = "" Then
MsgBox "Select product from the list!"
Exit Sub
End If
'** Step 2 **'
'validating if "optChunk" optionbox is selected then
'"txtChunksize" textbox should contain a value
If optchunk.Value = True Then
'validate if chunksize value is null
If txtChunkSize.Text = "" Then
MsgBox "Enter value for chunksize "
Exit Sub
End If
'validating that the chunk size entered should be a positive value
If CInt(txtChunkSize.Text) < 1 Then
MsgBox "ChunkSize value should be positive!"
Exit Sub
End If
End If
'** Step 3 **'
'open image column from product_information table using m_Oracon connection
recProductImage.Open "SELECT product_image FROM product_information " & _
" WHERE product_id =" & cboSelectProduct.ItemData(cboSelectProduct.ListIndex) _
, m_Oracon, adOpenStatic _
, adLockOptimistic, adCmdText
'check if product image exists for the product selected
If Not IsNull(recProductImage!product_image) Then
'setting mouse pointer on the form "frmChunkSize" to wait state
frmChunkSize.MousePointer = vbHourglass
'** Step 4 **'
'assigning "desitinationFileNum" variable to next file number
'available for use
destinationFileNum = FreeFile
'allocates a buffer for I/O to the temporary file "tempImage.bmp"
'at the current application path
Open App.Path & "\tempImage.bmp" For Binary As destinationFileNum
'** Step 5 **'
'Get the frequency of internal timer in Freq variable
QueryPerformanceFrequency Freq
'start the timer
QueryPerformanceCounter startTime
'clear "imgProduct" imagebox
imgProduct.Picture = LoadPicture("")
'** Step 6 **
If optValue.Value = True And optchunk.Value = False Then
'** Step 7 **
'using ADO Value property
bytchunk = recProductImage("product_image").Value
'appending byte arrary data to the temporary file
Put destinationFileNum, , bytchunk
'displaying "No. of Round Trips" in a label to 1
lblRoundTrips = 1
ElseIf optchunk.Value = True Then
'** Step 8 **
'converting the value entered "txtChunkSize" textbox to long
'and assigning it to chunksize variable
m_chunksize = CLng(txtChunkSize.Text)
'assigning the actual size of the image retrieved to a variable
totalsize = recProductImage("product_image").ActualSize
'calculating and assigning the "No. of Round Trips" to a variable
roundTrips = totalsize / m_chunksize
'in case fragment of data left, incrementing roundtrips by 1
If (totalsize Mod m_chunksize) > 0 Then
roundTrips = roundTrips + 1
End If
'In this loop the image is retrieved in terms of chunksize
'and appended to the temporary file
Do While offset < totalsize
'** Step 9 **
'retrieving product_image from the recordset, in chunks of bytes
bytchunk = recProductImage("product_image").GetChunk(m_chunksize)
offset = offset + m_chunksize
'appending byte arrary data to the temporary file
Put destinationFileNum, , bytchunk
Loop
'displaying "No. of Round Trips" in a label
lblRoundTrips = roundTrips
End If
'** Step 10 **'
'stop the timer after image retrieval is done
QueryPerformanceCounter EndTime
'close the opened file handle
Close destinationFileNum

Similar Messages

  • Urgent please: lost all datas while sync my new iPhone. how can i retrieve my old datas? through icloud?

    urgent please: I have a new iphone 4S and while sync with itunes, it was not done using the data of my old iphone but with a new virgin iphone. how can I retrieve and sync with my old datas? through icloud? or have I lost everything? please help

    to be more precise
    I have saved all my datas of my old iphone on itunes and icloud. I got a new phone 4s that I connected to itunes in order to load it and sync with my old datas. but I don't konw how but when itunes sync my new iphone i did not take my old datas. at the end of the sync process, I got an iphone totally virgin, but none of my previous apps, neither contact neither calendar neither anything. what happened? did itunes erased all my previous datas?? i hope not but if it's the case, can I recuperate my old datas through icloud? please help because as a lot of us, all my life is in this iphone.. (contacts, photos of my 18months girl, etc etc)
    thank you very much

  • How can I retrieve the col data size and Null information from table using labview connectivity toolset

    Hi, there,
    I am wondering how to get the table information by labview database
    connectivity toolset. The table list vi comes with the toolset can get
    only col name, data type and data size. And I found the the data size
    always gives back -1, even though it is a string type. Do somebody has
    some idea about it?
    Thanks.
    JJ

    JJ,
    Go into the diagrams of the DBTools List Columns and DBTools Get Properties respectively. When you inspect this diagram, you will see the raw ActiveX properties and methods called to get the size information. The value of -1 means the requested recordset is already closed. This is the sort of thing that is controled by the driver (ODBC, OLE DB, Jet, etc) you are using. Notice that you can right click on the property and invoke nodes and get more information about these specific items directly from the ADO online help.
    Crystal

  • How can i retrieve documents(.doc,.pdf, .txt) using forms from the database.

    How can i retrieve documents(e.g .doc,.pdf, .txt etc) using forms from the database.
    i inserted the documents using sql*loader, below is the control and data files.
    -- control file
    LOAD DATA
    infile 'load.txt'
    INTO TABLE husman
    APPEND
    FIELDS TERMINATED BY ','
    (id integer external,
    fname FILLER CHAR(50),
    docu LOBFILE(fname) TERMINATED BY EOF)
    --data file
    1,../husman/dell.doc,
    2,../husman/me.pdf,
    3,../husman/export.txt,
    in the form i have a text field to display the id and an OLE container to display the document as an icon. but when i execute query, i only get the id number and not the document.
    any help will be appreciated.
    Thanks
    Hussein Saiger

    Step by step
    1. Erase all contents and settings
    2. You'll be asked twice to confirm
    3. You'll see Apple logo and progress bar
    4. You'll see a big iPad logo on screen
    5. Configuration start
    6. Set language
    7. Set country
    8. Enable Location Service
    9. Select network, enter password and join network
    10. You'll be given 3 options (a) Setup as New iPad (b) Restore from iCloud Backup (c) Restore from iTune Backup
    11. Selected Restore from iCloud Backup
    12. You'll be required to enter Apple ID and Password
    13. Agree to Terms and Conditions
    14. Select Backup file
    15. You'll see progress bar
    16. Red slider will appear; slide to unlock; step #1 to #16 is fast
    17. Pre-installed apps will be restored first
    18. Message: Purchased apps and media will now be automatically downloaded
    19. You'll see a pageful of apps with Waiting/Loading/Installing
    20. Message: Some apps cannot be downloaded, please sync with computer

  • How can i modify SLT mapping data types ?

    I am modeling an Attribute view in HANA sp05 and i need to create a join betwwen two standard tables CRMD_ORDERADM_H and SRRELROLES using files GUID and OBJKEY.
    these two fields have two different types of data ( GUID = RAW and OBJKEY = CHAR).
    When SLT replicate these files in HANA the data types are (RAW = VARBINARY and CHAR = NVARCHAR). I can't create these join in HANA.
    So i have to change the transformation rule in in SLT for something like: In table SRRELROLES for field OBJKEY the tranformation rule will be (CHAR to VARBINARY).
    How can i do this in SLT?
    I have to use the transaction IUUC_REPL_CONTENT?
    OR
    Can I insert records in tables IUUC_REPL_TABSTG and IUUC_REPL_TAB_DV ?
    Thanks and best regards for all!

    HI,
    use IUUC_REPL_CONTENT. It will insert the relevant values to table IUUC_REPL_TABSTG and IUUC_REPL_TAB_DV .
    Best,
    Tobias

  • How can i validate(compare) two date type attribute in EO.

    Hi All,
    jdev version 11.1.2.1.0
    i have created one EO where two date type attribute ToDate and FromDate now i want to add validation rule.
    which validate that difference b/w ToDate and FromDate not more than 3 month.
    How can i validate this?

    You can create script expression
    Something like
    if((toDate.getTime()-fromDate.getTime())/(1000 * 60 * 60 * 24)>30)
      return true;
    else
      return false;-Arun
    P.S : Above example calculates based on number of Days (30). If you want 3 months, you need to put a logic - Simply 90 days? What about the months with 31 days and 28/29 days? etc.

  • EWS: How can I retrieve password expiration date?

    Hi,
    I am using EWS API's in web application. Can you please tell me how can I get the exchange account password expiration date?
    I tried this:https://code.msdn.microsoft.com/office/Exchange-2013-Get-the-date-3a92c007
    But no luck, please help.
    Thanks,
    Prashant Mahajan

    Hello Prashant,
    Good Day..
    Request you to please try the below command.
    Get-ADUser -identity username -properties *
    For More Info:
    http://oxfordsbsguy.com/2013/11/25/powershell-get-aduser-to-retrieve-password-last-set-and-expiry-information/
    Regards,
    Praveen
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts @ Techrid.com

  • How can I create a custom data type that is a 2D array of string by using TestStand API?

    Hi all,
    I'm new in TestStand:
    I'm able to create a custom data type that is a 1D array of string but I cannot find the way to create a 2D array of string.
    Can anyone help me?
    Thank you in advance.
    Federico

    I made it!!
    Indeed my 2D array is an item of a container:
    /*  Create a new container */
    RunState.Engine.NewPropertyObject(Locals.NewDataType,PropValType_Container,False,"",0)
    /*  Create an array of strings as item of the container */
    Locals.NewDataType.NewSubProperty("Array_2D",PropValType_String,True,"",0)
    /*  Reshape the array as an empty 2D array */
    Locals.NewDataType.GetPropertyObject("Array_2D",0).Type.ArrayDimensions.SetBoundsByStrings("[0][0]","[][]")
    being:
    NewDataType a local property (type Object)
    Attachments:
    AddCustomTypeAndCreateFileGlobals.seq ‏11 KB

  • How can i retrieve the output of procedure using a select statement ?

    Hi every one.
    this mite be dumm ?
    how can i use the output of the a procedure containing multiple rows of data in a select statement ?

    This is not  a SQL Developer question. You should ask it in the SQL and PL/SQL forum.
    The short answer is you can't.  Sounds is if you are trying to use MSSQL techniques in oracle. Learn oracle techniques

  • How can i retrieve Items and Dates from an specific Service Order in a Report?

    Hi Partners,
    i was debbuging a lot without a good solution,
    My team develop a new report (SE38 Report)  to list on the screen an specific Service Order (BTQSrvOrd) with their corresponding Items & Dates (BTHeaderDates)
    Here is my code (Attached on Message), i reach the data of the service order but i need to get the children information for Items & Dates but i saw thar those 2 types are in a 4 lower level and it's a little difficult to access througt code.
    Regards.

    Let me get this straight.....You lost your phone.  You never backed it up, either to your computer or to a cloud service.
    How in the world would you expect to get data back?

  • Can't update oracle Long data type

    Hi All,
    Setup
    Weblogic 5.1.0sp11, oracle 8.1.6, Solaris8, classes12.zip,
    Solaris_JDK_1.2.1_03a
    ConnectionPool:
    weblogic.jdbc.connectionPool.XXXDBPool=\
    url=jdbc:oracle:thin:@10.2.30.50:1521:ZZZZ,\
    driver=oracle.jdbc.driver.OracleDriver,\...etc
    Problem
    I can't seem to write to (insert/update) an oracle type Long column
    using connections from the weblogic connection pool. Each entry(as
    XML) into this column is fairly large (>1MB). Reading from works fine,
    however.
    The same configuration(minus connection pool and associated
    code/config) via tomcat works fine(read/write), so I'm thinking the
    weblogic connection pool is giving me a connection object which
    doesn't update this Long column properly.
    Using the usual(again works fine for tomcat) :-
    //Url = jdbc:weblogic:pool:XXXDBPool
    //driver = weblogic.jdbc.pool.Driver
    stat = con.prepareStatement("UPDATE BM_RM_USER_DIARY set DIARY=? where
    id=?");
    //stat.setString(1,diaryData); //use an inputstream instead.
    ByteArrayInputStream bais = new
    ByteArrayInputStream(diaryData.getBytes());
    //StringBufferInputStream bais = new
    StringBufferInputStream(diaryData); //deprecated
    stat.setAsciiStream(1, bais, bais.available());
    stat.setLong(2,userId);
    I'm not getting any errors from this update, so I can't really see
    what I might be doing wrong. It just returns fine as if it has
    succeeded (rows updated = 1)
    Assuming I CAN NOT change these settings, are there any other ways I
    can programmatically get these inserts working ? Is this even a known
    issue ? as i can't find a problem in these postings that quite matches
    mine.
    Any help appreciated.
    Cheers
    Alkesh

    Hi All
    Just to follow up on this.
    The problem was solved by explicitly calling commit() after
    the update has taken place.
    It seems as though my connection from the connection pool has
    autocommit set to false.
    Thanks
    Alkesh
    [email protected] (Alkesh) wrote in message news:<[email protected]>...
    Hi All,
    Setup
    Weblogic 5.1.0sp11, oracle 8.1.6, Solaris8, classes12.zip,
    Solaris_JDK_1.2.1_03a
    ConnectionPool:
    weblogic.jdbc.connectionPool.XXXDBPool=\
    url=jdbc:oracle:thin:@10.2.30.50:1521:ZZZZ,\
    driver=oracle.jdbc.driver.OracleDriver,\...etc
    Problem
    I can't seem to write to (insert/update) an oracle type Long column
    using connections from the weblogic connection pool. Each entry(as
    XML) into this column is fairly large (>1MB). Reading from works fine,
    however.
    The same configuration(minus connection pool and associated
    code/config) via tomcat works fine(read/write), so I'm thinking the
    weblogic connection pool is giving me a connection object which
    doesn't update this Long column properly.
    Using the usual(again works fine for tomcat) :-
    //Url = jdbc:weblogic:pool:XXXDBPool
    //driver = weblogic.jdbc.pool.Driver
    stat = con.prepareStatement("UPDATE BM_RM_USER_DIARY set DIARY=? where
    id=?");
    //stat.setString(1,diaryData); //use an inputstream instead.
    ByteArrayInputStream bais = new
    ByteArrayInputStream(diaryData.getBytes());
    //StringBufferInputStream bais = new
    StringBufferInputStream(diaryData); //deprecated
    stat.setAsciiStream(1, bais, bais.available());
    stat.setLong(2,userId);
    I'm not getting any errors from this update, so I can't really see
    what I might be doing wrong. It just returns fine as if it has
    succeeded (rows updated = 1)
    Assuming I CAN NOT change these settings, are there any other ways I
    can programmatically get these inserts working ? Is this even a known
    issue ? as i can't find a problem in these postings that quite matches
    mine.
    Any help appreciated.
    Cheers
    Alkesh

  • How to deal with LONG data type in RTF template

    Hi,
    I'm developing a PO request report in which I should print some attachments. The attachments are stored in the database in table fnd_attachments_long_text in column long_text which data type is LONG. In my case the content of the column long_text is always plain text.
    The query I use to get the text from the table is something like:
    select long_text
    from fnd_documents_long_text
    where <some_conditions....>
    The query runs fine in SQL developer but when I run the XML report I get following error: "Stream has already been closed". The XML file generated is complete in its structure but the XML node which should contain the text of the attachment is empty, therefore I cannot print the attachment in the report.
    I made some researches on metalink and I've found note 832903.1 which explains the same error I'm getting. Looks like I cannot execute more than 1 query using the same JDBC connection if one of these queries retrieves a LONG data type.
    Any advice on how can I get the attachment text to show correctly in my report?
    Thank you

    Hi,
    Thank you for your reply,
    Yes, I tried to get the text as described in that article but maybe I'm missing something because my data template doesn't show the attachment text.
    The article talks about support for BLOB, CLOB and RAW and at the end it states "but we do not have support for RAW and LONG column types at the moment - we're looking into that for a future release". So this makes me think that I won't be albe to retrieve my text since it's stored in a LONG column.
    I think that the error I'm getting is not strictly related to XML publisher but it is in some way related to the JDBC connection used to get the data. Infact I have an old version of the same report I'm trying do develop which is made in Report Builder and it is retrieving the attachment text correctly.
    Right now I'm trying to use the Report Builder engine to get the XML data and then use XML Publisher to create the PDF output. Anyway, if it is possible, I would like to avoid Report Builder and use only XMLP.
    Thanks

  • Using DBMS_DATAPUMP with LONG data type

    I've got a procedure below that calls the DBMS_DATAPUMP procedure using a REMOTE_LINK to move a schema from one database to another. However, a couple of the tables within that schema have columns with the LONG data type. And when I run it I get an error saying that you cannot move data with the LONG data type using a REMOTE LINK. So no data in those particular tables gets moved over.
    Has anyone else had this issue? If so, do you have a work around? I tried adding a CLOB column to my table and setting the new CLOB to equal the LONG, but I couldn't get that to work either...even when I tried using a TO_LOB. If I could get that to, then I could just drop the LONG, move the schema, then recreate the LONG column on the opposite side.
    Here's my procedure....
    DECLARE
         /* EXPORT/IMPORT VARIABLES */
         v_dp_job_handle                    NUMBER ;          -- Data Pump job handle
         v_count                              NUMBER ;          -- Loop index
         v_percent_done                    NUMBER ;          -- Percentage of job complete
         v_job_state                         VARCHAR2(30) ;     -- To keep track of job state
         v_message                         KU$_LOGENTRY ;     -- For WIP and error messages
         v_job_status                    KU$_JOBSTATUS ;     -- The job status from get_status
         v_status                         KU$_STATUS ;     -- The status object returned by get_status
         v_logfile                         NUMBER ;
         v_date                              VARCHAR2(13) ;
         v_source_server_name          VARCHAR2(50) ;
         v_destination_server_name     VARCHAR2(50) ;
    BEGIN
         v_project := 'TEST' ;
         v_date := TO_CHAR(SYSDATE, 'MMDDYYYY_HHMI') ;
         v_source_server_name := 'TEST_DB' ;
         v_dp_job_handle := DBMS_DATAPUMP.OPEN(
              OPERATION     => 'IMPORT',
              JOB_MODE     => 'SCHEMA',
              REMOTE_LINK => v_source_server_name,
              JOB_NAME     => v_project||'_EXP_'||v_date,
              VERSION          => 'LATEST') ;
         v_logfile := DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE ;
         DBMS_DATAPUMP.ADD_FILE(
              HANDLE          => v_dp_job_handle,
              FILENAME     => v_project||'_EXP_'||v_date||'.LOG',
              DIRECTORY     => 'DATAPUMP',
              FILETYPE     => v_logfile) ;
         DBMS_DATAPUMP.METADATA_FILTER(
              HANDLE          => v_dp_job_handle,
              NAME          => 'SCHEMA_EXPR',
              VALUE          => '= '''||v_project||''' ') ;
         DBMS_DATAPUMP.START_JOB(v_dp_job_handle) ;
         v_percent_done := 0 ;
         v_job_state := 'UNDEFINED' ;
         WHILE (v_job_state != 'COMPLETED') AND (v_job_state != 'STOPPED')
         LOOP
              DBMS_DATAPUMP.GET_STATUS(
                   v_dp_job_handle,
                   DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR + DBMS_DATAPUMP.KU$_STATUS_JOB_STATUS + DBMS_DATAPUMP.KU$_STATUS_WIP,
                   -1,
                   v_job_state,
                   v_status) ;
                   v_job_status := v_status.JOB_STATUS ;
              IF v_job_status.PERCENT_DONE != v_percent_done THEN
                   DBMS_OUTPUT.PUT_LINE('*** Job percent done = '||TO_CHAR(v_job_status.PERCENT_DONE)) ;
                   v_percent_done := v_job_status.PERCENT_DONE ;
              END IF ;
              IF BITAND(v_status.MASK, DBMS_DATAPUMP.KU$_STATUS_WIP) != 0 THEN
                   v_message := v_status.WIP ;
              ELSIF BITAND(v_status.mask, DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR) != 0 THEN
                   v_message := v_status.ERROR ;
              ELSE
                   v_message := NULL ;
              END IF ;
              IF v_message IS NOT NULL THEN
                   v_count := v_message.FIRST ;
                   WHILE v_count IS NOT NULL
                   LOOP
                        DBMS_OUTPUT.PUT_LINE(v_message(v_count).LOGTEXT) ;
                        v_count := v_message.NEXT(v_count) ;
                   END LOOP ;
              END IF ;
         END LOOP ;
         DBMS_OUTPUT.PUT_LINE('Job has completed') ;
         DBMS_OUTPUT.PUT_LINE('Final job state = '||v_job_state) ;
         DBMS_DATAPUMP.DETACH(v_dp_job_handle) ;
    END ;

    But the application we have that uses the database cannot be changed to read from a CLOBWhy can't you change the application?
    Well, anyway you should point out to your superiors that Oracle documented years ago to not use LONGS anymore...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3806
    It clearly states:
    LONG Datatype
    Note:
    Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.
    Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
    How do I go from CLOB to LONG?I'm sorry, cannot help you on that one, I don't think you can do that at all (Oracle wants us to stop using LONGS, so, it's a one-way conversion...):
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1037232794454#15512131314505
    So: NO built_in, you'll need to write a program if the clob is ALWAYS LESS THAN 32k in size, you can use plsql..but is that the case in your case? Only you know that.
    I believe that question is still unanswered on this forum, but you might try searchin for answers on this forum, and
    the 'Database-General' forum: General Database Discussions
    Perhaps you can google a Q&D workaround...
    ( And consider convincing your collegues to just convert your LONGS to LOBS)
    Edited by: hoek on Apr 8, 2009 5:43 PM

  • How can I transfer all my data including SMS to my mac/windows computer?

    My friend has asked me to help her transfer all the data from her iPhone 3GS to a computer then to a hard drive. She has several folders with pictures in but image capture on mac is only picking up the one. I have an iPhone 4S and iPad 3 installed already on iTunes so don't want to accidentally erase her phone.
    She also needs some of the SMS messages taking off of her phone and saving either as they are or in some form of text file so they are readable in the future.
    How can I retrieve all this data including the messages without losing anything and can it be done for free?
    If you need anymore info please just ask and I'll try and pass it on to the best of my (limited) knowledge.
    Thanks in advance!

    http://www.iphonebackupextractor.com/
    SHe can also do a backup of her phone and it will save the text message, but she won't be able to view the text unless she restores to the backup.

  • Retrieve data from LONG data types

    Hi,
    I am trying to retrieve data from LONG data types with following query.
    select * from all_views where upper(text) like '%TABLE_NAME%';
    In above query text column has long datatype. This query works for varchar, but it returns an error for long.
    How can I modify the query so that it returns data from text column.
    Thanks in advance,
    Aditya

    You can't use any expressions against LONG. One solution is to use PL/SQL:
    BEGIN
        FOR v_rec IN (SELECT * FROM ALL_VIEWS) LOOP
          IF UPPER(v_rec.text) LIKE '%TABLE_NAME%'
            THEN
              DBMS_OUTPUT.PUT_LINE(v_rec.text);
          END IF;
        END LOOP;
    END;
    /SY.

Maybe you are looking for