You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Øystein Grøvlen (JIRA)" <ji...@apache.org> on 2007/01/23 12:22:49 UTC

[jira] Commented: (DERBY-208) Add support to retrieve lobs for Network Server by locator rather than matierializing the LOB

    [ https://issues.apache.org/jira/browse/DERBY-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466717 ] 

Øystein Grøvlen commented on DERBY-208:
---------------------------------------

With respect to the proposed stored procedures for accessing locators,
I think we will need separate routines for Blob and Clob with
different in parameter types.  Routines for Clobs will operate on
VARCHAR parameters, while Blob routines will operate on
VARBINARY/VARCHAR FOR BIT DATA.  I propose that we create separate
routines also where the parameter types does no vary.  That way, we
can get tid of the LocatorType parameter.  Based on this, the
following procedures are needed:

Blob procedures:

 * BlobCreateLocator(Locator OUT INTEGER)
        -> Allocates a new Blob in a temporary space and returns its Locator

 * BlobReleaseLocator(Locator IN INTEGER)
        -> Releases a Blob.

 * BlobGetPosition(Locator IN INTEGER,
                   SearchLocator IN INTEGER, 
                   SearchLiteral IN VARCHAR FOR BIT DATA,
                   FromPosition IN INTEGER, 
                   LocatedAt OUT INTEGER)
        -> Returns the position in bytes of the first occurrence of
           SearchLocator or SearchLiteral within the Blob.

 * BlobGetLength(SourceLocator IN INTEGER,
                 Length OUT INTEGER)
        -> Returns the length in bytes of the Blob

 * BlobGetBytes(SourceLocator IN INTEGER,
                FromPosition IN INTEGER,
                ForLength IN INTEGER,
                Bytes OUT VARCHAR FOR BIT DATA)
        -> Returns a byte array containing the bytes starting at
           FromPosition and with length ForLength

 * BlobSetBytes(SourceLocator IN INTEGER,
                FromPosition IN INTEGER, 
                ForLength IN INTEGER,
                Bytes IN VARCHAR FOR BIT DATA)
        -> Replaces the bytes at position FromPosition with
           ForLength bytes from Bytes

 * BlobTruncate(SourceLocator IN INTEGER,
                Length IN INTEGER)
        -> Truncates the Blob to Length


Clob procedures:

 * ClobCreateLocator(Locator OUT INTEGER)
        -> Allocates a new Clob in a temporary space and returns its Locator

 * ClobReleaseLocator(Locator IN INTEGER)
        -> Releases a Clob.

 * ClobGetPosition(Locator IN INTEGER,
                   SearchLocator IN INTEGER, 
                   SearchLiteral IN VARCHAR,
                   FromPosition IN INTEGER, 
                   LocatedAt OUT INTEGER)
        -> Returns the position in characters of the first occurrence of
           SearchLocator or SearchLiteral within the Clob.

 * ClobGetLength(SourceLocator IN INTEGER,
                 Length OUT INTEGER)
        -> Returns the length in characters of the Clob

 * ClobGetSubString(SourceLocator IN INTEGER,
                    FromPosition IN INTEGER,
                    ForLength IN INTEGER,
                    String OUT VARCHAR)
        -> Returns a string containing the characters
           starting at FromPosition and with length ForLength

 * ClobSetSubString(SourceLocator IN INTEGER,
                    FromPosition IN INTEGER, 
                    ForLength IN INTEGER,
                    String IN VARCHAR)
        -> Replaces the characters at position FromPosition with
           ForLength characters from String

 * ClobTruncate(SourceLocator IN INTEGER,
                Length IN INTEGER)
        -> Truncates the Clob to Length


One may also consider using functions instead of procedures for those
routines that have an OUT parameter.  If DERBY-2201 is fixed, we could
let BlobGetBytes/ClobGetSubstring return Blob/Clob and avoid having to
partition the Clob/Blob into fragments that fits into VARCHARS.


> Add support to retrieve lobs for Network Server by locator rather than matierializing the LOB
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-208
>                 URL: https://issues.apache.org/jira/browse/DERBY-208
>             Project: Derby
>          Issue Type: New Feature
>          Components: Network Server
>    Affects Versions: 10.1.1.0
>            Reporter: Kathey Marsden
>         Attachments: LOBLocator.pdf
>
>
> Currently Network Server materializes all LOB objects.  LOB locator support is part of the DRDA spec so could be added to network server.  See
> http://www.opengroup.org/dbiop/
> It is not clear if SQL Support for LOB locators would also be required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.