[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Table with filed CLOB



   Hello Mr. Scott
   I understand that my question doesn't concern HTTPAPI,
   do I ask if it is possible support to my problem?
   In the attached source modified EXAMPLE2,
   I use the field XDOC type VARCHAR,
   while I am having to read an a chart that contains a field XDOC type
   CLOB ,
   from documentation IBM I read that the structure of the lines CLOB is:
D MY_FILE         S          SQLTYPE(CLOB_FILE)

   Results in the generation of the following structure:
D MY_FILE          DS
D MY_FILE_NL                      10U
D MY_FILE_DL                      10U
D MY_FILE_FO                      10U
D MY_FILE_NAME                   255A

   How can I modify the following program, if my Table is called RESULT
   and the field type CLOB is called XDOC?
   FDocXml    IF   F32740        DISK

   D/copy qrpglesrc,httpapi_h

   D cmd             pr                  extpgm('QCMDEXC')
   D  command                     200A   const
   D  length                       15P 5 const

   D CRLF            C                   CONST(x'0D25')
   D rc              s             10I 0
   D msg             s             52A

   D Enc             s                   like(HTTP_URL_ENCODER)
   D myPointer       s               *
   D dataSize        s             10I 0

   IDocXml    NS
   I                                  1    3  Tipo
   I                                  632740  Xdoc

   c                   open(e)   DocXml
   c                   read      DocXml

    **
    ** To do URL encoding data, you must create a "URL Encoder"
    ** and then use it to encode each variable of the web form
    ** as follows:
    **

   C                   eval      Enc = http_url_encoder_new

   c                   callp     http_url_encoder_addvar( Enc
   c                                                  : 'xmlString'
   c                                                  : %addr(Xdoc)
   c                                                  : %len(%trimr(Xdoc)
   c                   callp     http_url_encoder_addvar_s( Enc
   c                                                  : 'type'
   c                                                  : tipo )

    **
    ** The http_url_encoder_getptr() routine can be used to get a
    ** pointer to the encoded data.  This is especially useful for
    ** the http_url_post() function.
    **
   c                   callp     http_url_encoder_getptr( Enc
   c                                                    : myPointer
   c                                                    : dataSize )

    **
    **  The http_url_post() function does an HTTP POST operation
    **  sending any data at the pointer you specify.
    **
    **  The results, in this case, are saved to the IFS in a file
    **  called '/tmp/result.xml'
    *
   c                   eval      rc = http_url_post(
   c                              '[1]http://10.1.1.199:80/AMMWeb/' +
   c                                  'FileUploadServlet?'
   c                               + http_url_encoder_getstr(Enc)
   c                             : myPointer
   c                             : dataSize
   c                             : '/tmp/result.xml' )
   c                   if        rc <> 1
   c                   eval      msg = http_error
   c                   dsply                   msg
   c                   else
   c                   callp     cmd('DSPF ''/tmp/result.xml''': 200)
   c                   endif
     **
     ** When done, make sure you call this function to free up
     ** the memory that the URL Encoder used.
     **
    c                   callp     http_url_encoder_free(Enc)

    c                   close     DocXml
    c                   eval      *inlr = *on
   Thanks Antonio
     _________________________________________________________________
     _________________________________________________________________

   L'email della prossima generazione? Puoi averla con la [2]nuova Yahoo!
   Mail

References

   1. http://10.1.1.199/AMMWeb/
   2. http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*http://it.docs.yahoo.com/nowyoucan.html
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------