× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Vicky,

I assume you defined your CLOB as clob variable with SQL SQLTYPE(CLOB:
2000000).
When using a clob variable the SQL precompiler converts the Stand alone
field into a Data Structure: 
MYCLOB   S                   SQLTYPE(CLOB: 1024)
Is converted into 
MYCLOB       DS
   MYCLOB_LEN              10U 0
   MYCLOB_DATA                A         LEN(1024)

When passing the variable to another function, you either may try to define
the parameter with the SQLTYPE keyword or pass a data structure with the
appropriated subfields.

XML_CLOB is a (RPG) variable with a special type of a large object that can
only hold well-formed XML documents in a single byte character set. A
wellformed XML document in an XML column is converted into an internal
representation that cannot be compared with neither with an other character
string nor with an other XML document. That's why XMLSERIALIZED is used to
convert the XML into a character representation (CLOB).

CLOB_FILE is converted by the SQL precompiler either, but points on an IFS
file that contains any data to be used.
CLOB_FILEs and CLOB_LOCATORS can be accessed with SQL functions (such as
SUBSTR or POSSTR) like any character field, but cannot be accessed with RPG
functions, because the data is not copied into RPG but located on the server
When using CLOB variables data is copied into the RPG Host variable and can
be accessed with RPG Functions.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Vicki
Wilson
Gesendet: Wednesday, 13.5 2015 18:31
An: rpg400-l@xxxxxxxxxxxx
Betreff: I have a CLOB? What do I do with it now?

Used some of the knowledge picked up at COMMON to build my XML in SQL.
Woohoo.

I'm creating the XML as a CLOB
                      Select xmlserialize(xmlelement(Name "tXML",
                           xmlconcat(headerxml, messagexml))
                      As Clob(2M) Including XMLDECLARATION) Into :XMLClob
                      From header Cross Join watermark;

Now I'm stumbling all over myself trying to manage the clob.

The program is written with a declared MAIN.  Originally the CLOB was
defined within a subprocedure.  After creating it I wanted to pass it to
another procedure for MQ processing.  However I could not quite figure out
the correct definition for the procedure interface for the called
subprocedure.  How do I define a prototype for passing the clob?

I realize when you declare a CLOB that you actually get a DS created with
the length and data.  So do I pass the data structure?  Or is this the point
where I need to understand pointers and pass a pointer?

For now - I broke down and defined the CLOB globally.

Also I'm wondering what the difference between XML_CLOB, CLOB and CLOB_FILE
are?

We are on v7r1 and I'm using RDI 9.1.1.1

Vicki Wilson


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.