Oracle Text - Problem with filtering binary documents (.doc, .pdf, etc...)

Hi, I have a problem with filtering binary documents (.doc, .pdf, etc...). I use SQL*PLUS for remote access to Oracle 10.2 on Linux and I create table:
CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
I insert to this table:
INSERT into test values(1, 'PATH/text1.doc‘);
INSERT into test values(2,'PATH/text2.doc‘);
and then:
CREATE INDEX test_index ON test(text) indextype is ctxsys.context
parameters (’datastore ctxsys.file_datastore
filter ctxsys.auto_filter’);
Message "Index created" is displayed, but objects: DR$test_index$I, DR$test_index$K, DR$test_index$N, DR$test_index$R and DR$test_index$P are empty => index wasn´t created probably.
I don´t know, where is bug, either bug is somewhere in this code or on the server (wrong installation oracle or constraint privileges). Do you know in what is bug?

The following is an excerpt from the 10g online documentation. Note the items that I have put in bold.
"FILE_DATASTORE
The FILE_DATASTORE type is used for text stored in files accessed through the local file system.
Note:
FILE_DATASTORE may not work with certain types of remote mounted file systems.
FILE_DATASTORE has the following attribute(s):
Table 2-4 FILE_DATASTORE Attributes
Attribute Attribute Value
path path1:path2:pathn
path
Specify the full directory path name of the files stored externally in a file system. When you specify the full directory path as such, you need only include file names in your text column.
You can specify multiple paths for path, with each path separated by a colon (:) on UNIX and semicolon(;) on Windows. File names are stored in the text column in the text table.
If you do not specify a path for external files with this attribute, Oracle Text requires that the path be included in the file names stored in the text column.
PATH Attribute Limitations
The PATH attribute has the following limitations:
If you specify a PATH attribute, you can only use a simple filename in the indexed column. You cannot combine the PATH attribute with a path as part of the filename. If the files exist in multiple folders or directories, you must leave the PATH attribute unset, and include the full file name, with PATH, in the indexed column.
On Windows systems, the files must be located on a local drive. They cannot be on a remote drive, whether the remote drive is mapped to a local drive letter."
With accessible paths and files, you get something like:
SCOTT@orcl_11g> CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
Table created.
SCOTT@orcl_11g>
SCOTT@orcl_11g>
SCOTT@orcl_11g> INSERT into test values(1,'c:\oracle11g\banana.pdf');
1 row created.
SCOTT@orcl_11g> INSERT into test values(2,'c:\oracle11g\cranberry.pdf');
1 row created.
SCOTT@orcl_11g>
SCOTT@orcl_11g> CREATE INDEX test_index ON test(text) indextype is ctxsys.context
  2  parameters ('datastore ctxsys.file_datastore
  3  filter ctxsys.auto_filter');
Index created.
SCOTT@orcl_11g>
SCOTT@orcl_11g> select count(*) from dr$test_index$i
  2  /
  COUNT(*)
       608
SCOTT@orcl_11g> In the following, I used a non-existent path and non-existent file name, which produces the same results as when you use a remote path that does not exist locally.
SCOTT@orcl_11g> CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
Table created.
SCOTT@orcl_11g>
SCOTT@orcl_11g>
SCOTT@orcl_11g> INSERT into test values(3,'c:\nosuchpath\nosuchfile.pdf');
1 row created.
SCOTT@orcl_11g>
SCOTT@orcl_11g> CREATE INDEX test_index ON test(text) indextype is ctxsys.context
  2  parameters ('datastore ctxsys.file_datastore
  3  filter ctxsys.auto_filter');
Index created.
SCOTT@orcl_11g>
SCOTT@orcl_11g> select count(*) from dr$test_index$i
  2  /
  COUNT(*)
         0
SCOTT@orcl_11g>

Similar Messages

  • Can oracle text be used to compare documents?

    lets say that i 've some documents stored in binary(LOB). can oracle text be used to compare documents and show their similarity on the basis of their content. how would i be able to compare documents using Oracle text. does it require mining algorithm like neural network. please help.
    thanks for reading.

    Thank you for your interest in my question. Let me see whether  I can further clarify it. In an ordinary PDF document, assume that I have a picture of a user interface for microsoft Word. The common method for identifying items in the picture, such as a toolbar, would be to either:
    --use a callout labeled "toolbar" that points to the toolbar
    or 
    --use a callout labelled "A" and have a caption underneath the picture that says: A) toolbar.
    What I would like to do is have text underneath the picture such as:
    "The major features of the interface shown above are:
    toolbar
    main menu
    status bar
    formatting menu"
    such that, when the user clicks one of the bullet items, the object becomes highlighted in the picture. The bullet list also needs to be translatable into Japanese. So, as far as I know, it can't be part of the swf file. Or can it?

  • Problem with freeze on Document forms

    Hi all,
    i've a problem with freeze on document's forms (like invoice) when i make changes on matrix.
    For example i've an addon that calculate discounts for items and update the information in the matrix. But when I update the info in the Matrix I see the cursor run across the matrix.
    This create two problems. The first one is the orrible aspect that the operation assume, the second is that sometimes some cells turn to black and remain ofthis color.
    Can someone help me?
    Here I post a piece of my code:
        Dim oForm As SAPbouiCOM.Form = SBOApplication.Forms.Item(FormUID)
        Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item("38").Specific
        Dim oRefLine As Integer = 0
        oForm.Freeze(True)
        Dim Cnt As Integer = 1
        Try
          While Cnt <= oMatrix.RowCount
            If oMatrix.Columns.Item("U_RefLineId").Cells.Item(Cnt).Specific.Value <> "" Then
              Dim apDouble As Double = oMatrix.Columns.Item("15").Cells.Item(Cnt).Specific.Value.ToString.Replace(".", ",")
              If apDouble <> 100 Then
                SetMatrixValue(oMatrix, "U_RefLineId", Cnt, "")
                SetMatrixValue(oMatrix, "11", Cnt, oMatrix.Columns.Item("U_OrigQtyMN").Cells.Item(Cnt).Specific.Value)
                SetMatrixValue(oMatrix, "U_OrigQtyMN", Cnt, 0)
                Cnt = Cnt + 1
              Else
                oMatrix.Columns.Item("15").Cells.Item(Cnt).Click()
                SBOApplication.ActivateMenuItem("1293")
              End If
            Else
              SetMatrixValue(oMatrix, "15", Cnt, 0)
              Cnt = Cnt + 1
            End If
          End While
        Catch ex As Exception
          SBOApplication.StatusBar.SetText("Error: " & ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
        End Try
        oForm.Freeze(False)

    Hi Daniele,
    I use a little different approach because the Freeze on a Form is like parenthesis on formula. You must be sure that the Freeze(true) are balanced by a Freeze(false).
    So my pattern is:
    Try
        oForm.Freeze(True)
        ' the operation you need to do with the freezed form
    Catch Ex as Exception
        ' Menage the errors here
    Finally
        oForm.Freeze(False)
    End Try
    The Finally statement is executed in both case when an Exception is raised or when the code is right executed.
    But I think this is not the problem in your code.
    If you still having problem, probably we need to examine your sub-routine "SetMatrixValue".
    It is also important to know your SAP Business One version because in the past there was a version with a problem in the refresh of matrix.
    I use SAP Business One 2007A SP01 PL06 HF1 and I do not have problem with the freezing.
    Hope it helps.
    Carmine

  • Problem with Assign reference document.

    Hi all,
    I defined transaction input parameter type Xml.
    I used Reference Document Loader to load document (structure.xml) below.
    <?xml version="1.0" encoding="UTF-8"?>
    <SO_VALIDATION>
        <L4_SO_ID/>
        <L4_SOI_NO/>
        <PPC_STATUS/>
        <PPC_INFO/>
    </SO_VALIDATION>
    I used menu command Assign Reference Document, to assign above document to transaction input.
    I tryed to use this transaction in vs.net application as a web service.
    But there is no xml structure in InputParams in web service.
    I tryed alot but i did not achieve.
    What must i do?
    Thanks.

    cml_bzl,
    I'm using version 12.04 and I have not had any problems with assigning reference documents and using .NET.
    You should not have to do anyting special to get the transaction inputs to show up in .Net. To map the output I do the following:
    1. Create an output transaction variable and assign it's type as XML
    2. Using a XML document block to create and XML document for your output transaction variable
    3. Assign the XML document as the reference for the output transaction variable.
    THis works for me every time. If you change the transaction parameters, make sure you update the web service form the .NET side.
    Glenn

  • Problems with Filters

    I am having a problem with filtering on a BM 3.8 SP5 server. There is an application running on a workstation that goes out to the internet every 10-15 minutes. With the filters down, everything works fine. I have tried setting up a filter exception to allow full access out to the internet for this machine, but anything I try will not work. I have even created an Any Any rule (in filtcfg filter exceptions, create a new filter exception, select any for the protocol and save) I have always been under the impression that creating this type of filter will allow anybody in or out through BM. I have done a packet capture with ethereal and have found the IP address that this workstation is connecting to. The protocols it seems to be using is FTP, TCP, and FTP-DA. I also found that the workstation is attempting to connect to a MS FTP server. Why will this not work.
    Any suggestions?
    THanks in advance
    Brian

    Thanks for the response Cat.
    In the past we have had to allow this machine to have full access.
    Setting the packet type to Any
    source interface to Any
    Destination interface to Any
    Should open things right up shouldn't it?
    I have created a filter like this just to test, and the app still fails.
    I am starting to wonder if blowing away all of the filters and recreating them will help.
    Brian
    >>> Caterina Luppi<[email protected]> 28-Feb-07 4:47 PM >>>
    hi Brian,
    do you want to allow ANY kind of access from this workstation, or only FTP?
    for any kind of access you need the following exception:
    packet type TCP source port 1024-65535 dest port any STATEFUL
    source interface: any
    dest interface: public
    source IP address: the IP address of the PC
    Dest Ip address: the Ip address of the MS server
    if you want to restrict this access to FTP only you'll need the
    following exception:
    packet type: FTP_PORT_PASV_ST (select this from the list of predefined)
    source interface: any
    dest interface: public
    source IP address: the IP address of the PC
    Dest Ip address: the Ip address of the MS server
    Let me know.
    Cat
    NSC Volunteer Sysop

  • Problems with tablesalignment (from Word to PDF)

    Hello,
    Ive downloaded the trialversion of Acrobat because our company needs to make little pdf's out of 40/50 documents and i want to try what program is best for our...
    The thing is: i just cant get the tables right (sry for my bad english ) This problem exist with: Docx, doc, pdf, etc. etc.
    When i have a table, with the upper standardscellsalignment set to 0,1 cm. The tables get messed up when i export it to an PDF. However, when i print it, its normal !!! (???)
    The most upper horizontale lines are gone and the vertical connections arent any good.
    I tried every setting, but i just cant seem to find whats wrong. I also tried 4 other programs, but same problems (also the standard saveoption in word: save word to pdf makes the same error.
    There are 2 weird (part)-solutions: when i dissable the upper standard cell alignment in the table, so set to 0, and then save.... and the problem is gone (but i really need this upper cell alignment).
    Other solution: When i dissable all the collours in the table, it is (almost) oke, but not completly. (but this isnt an option also)
    I inserted  some pictures to give you the full view:
    Picture 1: on the left you see the result when i save it with word tot pdf acrobat, on the right you see the originaldocument.
    Picture 2: An closeup of the problems with the lines.
    Picture 3: The settings in Word, what is causing the problem
    Thank you in advance!
    Greetings, Coen
    Select table, right mouse, tabble options --> options --> standard cell margin, uppercellmargin)

    Hi Coen1413,
    Is it possible for you to share your doc also from which you created the PDF?
    Also please let us know your Office version and OS details.
    Thanks,
    Vishal/Adobe

  • Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it

    Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it.
    This happens only when a load my pdf file on my server, because if i click on the link when the file is on my iPad, the page opens without problem.
    Any help please?
    thanx

    the % sign is often used when there's a space in a name. HTML doesn't like spaces so it fills them with % or %20
    try, on the end of that link, see if there's a space built into the page or the link when the page was made
    On the web address you may be able to 'backspace' at the end and erase that space to get the address, but whomever made the page possibly put a mistake in the link

  • If I have a repeating event in iCal, can I attach different docs, pdfs, etc., do the events. I am entering lessonplans and want each date to have an attachment.

    If I have a repeating event in iCal, can I attach different docs, pdfs, etc., do the events. I am entering lessonplans and want each date to have an attachment.

    Yes. As you edit each one, you will get a dialog asking whether you want to change all or just the current one.

  • Using Oracle Text to search through WORD, EXCEL and PDF documents

    Hello again,
    What I would like to know is if I have a WORD or PDF document stored in a table. Is it possible to use Oracle Text to search through the actual WORD or PDF document?
    Thanks
    Doug

    Yes you can do context sensitive searches on both PDF and Word docs. With the PDF you need to make sure they are text and not images. Some scanners will create PDFs that are nothing more than images of document.
    Below is code sample that I made some time back to demonstrate the searching capabilities of Oracle Text. Note that the example makes use of the inso_filter that is no longer shipped with Oracle begging with Patch set 10.1.0.4. See metalink note 298017.1 for the changes. See the following link for more information on developing with Oracle Text.
    http://download-west.oracle.com/docs/cd/B14117_01/text.101/b10729/toc.htm
    begin example.
    -- The following needs to be executed
    -- as sys.
    DROP DIRECTORY docs_dir;
    CREATE OR REPLACE DIRECTORY docs_dir
    AS 'C:\sql\oracle_text\documents';
    GRANT READ ON DIRECTORY docs_dir TO text;
    -- End sys ran SQL
    DROP TABLE db_docs CASCADE CONSTRAINTS PURGE;
    CREATE TABLE db_docs (
    id NUMBER,
    format VARCHAR2(10),
    location VARCHAR2(50),
    document BLOB,
    CONSTRAINT i_db_docs_p PRIMARY KEY(id)
    -- Several notes need to be made about this anonymous block.
    -- First the 'DOCS_DIR' parameter is a directory object name.
    -- This directory object name must be in upper case.
    DECLARE
    f_lob BFILE;
    b_lob BLOB;
    document_name VARCHAR2(50);
    BEGIN
    document_name := 'externaltables.doc';
    INSERT INTO db_docs
    VALUES (1, 'binary', 'C:\sql\oracle_text\documents\externaltables.doc', empty_blob())
    RETURN document INTO b_lob;
    f_lob := BFILENAME('DOCS_DIR', document_name);
    DBMS_LOB.FILEOPEN(f_lob, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.LOADFROMFILE(b_lob, f_lob, DBMS_LOB.GETLENGTH(f_lob));
    DBMS_LOB.FILECLOSE(f_lob);
    COMMIT;
    END;
    -- build the index
    -- Note that this index differs than the file system stored file
    -- in that paramter datastore is ctxsys.defautl_datastore and not
    -- ctxsys.file_datastore. FILE_DATASTORE is for documents that
    -- exist on the file system. DEFAULT_DATASTORE is for documents
    -- that are stored in the column.
    create index db_docs_ctx on db_docs(document)
    indextype is ctxsys.context
    parameters (
    'datastore ctxsys.default_datastore
    filter ctxsys.inso_filter
    format column format');
    --search for something that is known to not be in the document.
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Jenkinson', 1) > 0;
    --search for something that is known to be in the document.  
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Albright', 1) > 0;

  • Oracle Text Help with XML column values

    Hello. In addition to being new to Oracle Text, I am inheriting an Oracle Text application and have a couple of questions.
    First, A context-based index has been set-up on a CLOB column which contains an XML formatted document. The Auto Section Group parameter has been set to created zones for each tag of the XML document. I have found that when using a browser to display the content of the CLOB, some of the column values have trouble displaying in the browser, where I receive an XML processing error. I believe this is due to the fact that some of the XML document rows contain URLs that are not embedded in the CDATA tag. In any case, if the browser has trouble displaying the XML, will oracle text have trouble indexing the XML and creating the section group zones?
    Second, I understand that the NOT operator takes a right operand term and left operand term. Can either of the terms be the results of the WITHIN operator, i.e. "dogs not (cats within animals)".
    Thank you.

    I bet you just whipped that out, and I thank you with all my
    heart, its amazing to me how many ways I tried to do what you did.
    Thanks
    I have a second question relating to the same problem and
    that is in referencing the over state. Currently, I can write
    'text' into the text field and see what I have coming in from xml
    in its place during the 'up' state.
    However, when the timeline hits the 'over' state, the
    textfield will display nothing, or 'text' if I have that written
    in. I suspect that I am not referencing the'over' state correctly.
    Should I add one line of code sort of referencing the text
    field and not just the button while in the over state?

  • Problem with filtering data

    Hi!
    I'm having trouble with filtering data from my table and don't know how to resolve it properly.
    I created a tabular form my table, a few text fields that are used as input for different columns of the filter and a filter button that submits the page.
    The problem appeared when I try to filter a column that has null values in the table and is editable...that's as far as I have concluded.
    So when I press the button I get zero rows even though there should be some.
    This is the submitted query:
    select
    "MSR_PRD_ID",
    "SRC_STM_ID",
    "ID",
    "ISIN",
    from "#OWNER#"."IZV_SLOG_DET"
    WHERE
    lower(MSR_PRD_ID) = lower(nvl(:P7_X_MSR_PRD_ID,MSR_PRD_ID)) and
    lower(SRC_STM_ID) = lower(nvl(:P7_X_SRC_STM_ID,SRC_STM_ID)) and
    lower(ISIN) = lower(nvl(:P7_X_ISIN,ISIN)) and
    The nvl function is used so that if the user leaves the field empty it only filters by the fields that have input.
    Does anyone know how I could circumvent this?
    Regards,
    Ivan

    LOWER (NVL (ISIN,'Y')) = LOWER (NVL (:P7_X_ISIN, LOWER (NVL (ISIN,'Y'))))
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494

  • Update Results not Displayed in Oracle Text search with Transactional Index

    Hi,
    I am working on a solution utilising Oracle Text to give me a probable list of matching records. The problem I have the table I am searching on is prepopulated with seed data and the application we are building is assigning a record and updating the details(columns) against it. This detail is what we are searching on using an Multi Column Datastore index which is refreshed every hr and also has the transactional parameter specified. Unfortunately the Transactional Index does not pick up the updated details, it only seems to work if I insert a new record (which will never happen). This to me sounds like a bug. Any assistance would be greatly appreciated.

    Barbara,
    I think you may have eluded to my problem. I haven't updated the "dummy" column
    The table structure is as follows:
    CREATE TABLE WAGN (
         WAGN               VARCHAR2(8) NOT NULL PRIMARY KEY,
         last_name          VARCHAR2(240),
         first_name          VARCHAR2(240),
         middle_name          VARCHAR2(240),
         date_of_birth     DATE,
         gender               VARCHAR2(1),
         status               VARCHAR2(1) NOT NULL,
         signature          RAW(64));
    The preference creation is:
    BEGIN
         ctx_ddl.create_preference('WAGN_NAME_SRCH', 'MULTI_COLUMN_DATASTORE');
         ctx_ddl.set_attribute('WAGN_NAME_SRCH', 'columns', 'last_name, first_name, middle_name, date_of_birth, gender');
    END;     
    The Index Creation statement is:
    CREATE INDEX wagn_srch_idx1 ON WAGN(signature) --Dummy Column
    INDEXTYPE IS ctxsys.CONTEXT
    PARAMETERS ('DATASTORE WAGN_NAME_SRCH SYNC(EVERY "SYSDATE+60/24/60" PARALLEL 10) TRANSACTIONAL');
    And a typical update statement is (contained with PL/SQL):
         UPDATE WAGN
              SET status = x_wagn_assigned_status,
                   last_name = p_employee_details.last_name,
                   first_name = p_employee_details.first_name,
                   middle_name = p_employee_details.middle_name,
                   date_of_birth = p_employee_details.date_of_birth,
                   gender = p_employee_details.gender
              WHERE WAGN = l_wagn;
    So my guess is that because the dummy column (signature) is not updated it is not being reflected in the transactional memory area.

  • Oracle Text:Problems in starting

    hi all
    i am working on Oracle 10g in windows and i want to do Text Mining,but i am having some problems.when i use the JDeveloper and start the text wizard it createa a jsp file but it is not loading properly.is there any document from which i can learn how to do it.i think i missed out some configurations for the http server.i really need it very soon.
    thanks in advance

    hello
    i had followed the tutorial "Building JSP Applications that Use Oracle Text to Search Content in the Database using JDeveloper" and using that now i am able to load the jsp file but cant search as it shows the following error.
    The requested method POST is not allowed for the URL /textsearch/mysearch.jsp.
    i dont know what is the problem.can u help me.i am using Oracle 10g and i have added a Alias in the httpd.conf instead of the ojsp.conf file that has been mentioned in the tutorial as there is no such file in 10g.can u help me

  • Text problems with Illustrator CS6

    Hello. We are having problems with text in Illustrator CS6. 1. When we copy / paste text within illustrator all color information is lost. 2. When we save documents in Illustrator CS6 then re-open text with color attributes changes to different random colors!! For example: If we save an Illustrator document with a paragraph of text that is part red and part black when we re-open the same paragraph might be all gray, or orange or (you pick a color). Can anyone help us here as this is causing no end of grief. Mac OSX 10.8.2

    As promised. This is the response received from iClipboard re the text color problems with Illustrator CS6.
    "Sounds like an Adobe problem especially given their last fix which changed how they worked with the system clipboard. We don't mess with any of the data put on the system clipboard. We simply make an exact copy of it and store it in iClipboard. It's a READ operation, not a WRITE operation so no data on the clipboard is changed. We use standard Apple API's to do all of this (proof is that iClipboard is in the Mac App Store--Apple's review process doesn't allow undocumented API calls)."
    My thanks to the people at iClipboard however the problem still exists. I'll sum up the issue this way. I have created a paragraph of text in Illustrator that combines black text with red text. I copy then paste the text with iClipboard running and the pasted text is all black. I copy then paste the text with iClipboard disabled and the copied text maintains the color information. When I save the Illustrator document with iClipboard running then reopen the black / red text reopens as grey / orange. With iClipboard disabled the reopened document is fine - go figure. The problems only occur with text - images are fine though they were a problem with the first version of Illustrator CS6. Anyone got any suggestions??

  • Problems with Concatenating Binary Data

    Hi
    I am experiencing a problem with the unreliable concatenation of binary data.
    I have a stored procedure that I wrote to perform cell encryption on long text fields (> 4000 characters in length). This takes the string, splits it into chunks of a set length, encrypts and concatenates the encrypted chunks into a varbinary(max) variable.
    It then stores the length of the encrypted chunk at the beginning of the data (the length of output when encrypting strings of a set length is always be the same), e.g.
    DECLARE @output VARBINARY(MAX), @length INT
    SELECT @length = LEN(@encryptedchunk1)
    SELECT @output = CONVERT(binary(8), @length) + @encryptedchunk1 + @encryptedchunk2 + @encryptedchunk3 + ...
    So far so good, and when I decrypt the data, I can read the first 8 bytes of data at beginning of the binary data to get the length of the chunk:
    -- get the length of the encrypted chunk
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    -- then remove the first 8 bytes of data
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 8))
    <snip> code to split into chunks of length @length and decrypt
    </snip>
    This is where I am experiencing an issue. 99.4% of the time, the above code is reliable. However, 0.6% of the time this fails for one of two reasons:
    the length is stored incorrectly. The length of the encrypted chunks is usually 4052 and substituting 4052 for the returned value (4051) allows the encrypted chunks to be decrypted.
    the encrypted data sometimes starts at offset 8 instead of 9. The @length variable is correctly read at length 8 but only 7 bytes should be removed from the start, e.g.
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 7))
    Has anyone any ideas on why this is happening and how the process can be made more reliable?
    Julian

    Use datalength, not len. Len() is designed for character strings and will ignore trailing bytes. And count characters. Datalength does exactly what you want: it counts bytes. Look at this:
    DECLARE @b varbinary(200)
    SELECT @b = 0x4142434420202020
    SELECT @b, len(@b), datalength(@b)
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Imported files to wrong location

    I am using Lightroon 4 on a Macbook pro, OS Lion. I forgot to change the location of all my local wordpress images before importing them to a new folder, and they ended up being moved to my default dated folders i.e. Pictures/2012/2012-01-01. How can

  • Multiple users/devices on one PC

    We have three devices in our household, all identified by the same apple user id and password. (probably the first mistake.) The PC recognizes the three separate devices, but I cannot sync my device (iphone 4s) without getting all of my husband's app

  • Destination Drive - Limit visibility of certain drives?

    Hello! Final Cut Server uses about 10 Fiber drives on our system, however - I only want users to see 2 of them when uploading Clips. They will still need to have the ability to search for clips on all drives though. I'm only referring to the uploadin

  • Transformation related info in CAD Integration

    Hello All, we are trying to migrate the Legacy Solid Edge assemblies. does any one have any idea which table in SAP does the transformation information for the DIRs below an assemby get stored from CDESK. Thanks & Regards Srikanth Aduri.

  • Diferences between HA solutions

    Could someone explain differences between Data Guard, Oracle Streams and Golden Gate? One or two sentence will be enough.