# 22. Virtuoso Functions Guide - mime_part

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
mime_body
mime_part
mime_tree
nntp_auth_get
nntp_auth_post
nntp_get
nntp_post
pem_certificates_to_...
pop3_get
smime_sign
smime_verify
smtp_send
uuvalidate
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## mime_part

used to compose a MIME message body part.
any mime_part (in content_type varchar, in content_disposition varchar, in transfer_encoding varchar, in data varchar);
Description

This function is used to make a MIME part that can be used with the mime_body() function.

Parameters
content_type – This parameter is used to specify the media type and subtype of data in the body of a message and to fully specify the native representation of such data. This header embodies much of the power of MIME. The IETF can add new official content types. Additionally, private content-type values can be defined by anyone. Such private content types have values of "x-something" or "X-something", where "something" can take on any value.
content_disposition – This parameter provides information about how to present a body part. When a body part is to be treated as an attached file, the Content-Disposition header should include a file name parameter.
transfer_encoding – The encoding method to use, such as base64.
data – The content of the message.
Return Types

The function returns a MIME part for use with the mime_body() function.

Examples
Creating a MIME message body

This example will show the output in ISQL of producing a two part MIME message using the mime_body() and mime_part() functions.

    SQL> select MIME_BODY (vector (MIME_PART (null,null,null,'this is a first'),
    MIME_PART (null,null,'base64','this is a second')));
    callret
    VARCHAR
    _______________________________________________________________________________

    Date: Tue, 25 Jun 2002 11:13:05 GMT
    Content-Type: multipart/mixed; boundary="----43c7f8b88e14a87dc3f2d840db93c731"
    Mime-Version: 1.0
    X-Mailer: Virtuoso

    This is a multi-part message in MIME format.

    ------43c7f8b88e14a87dc3f2d840db93c731
    Content-Type: text/plain
    Content-Transfer-Encoding: 8bit

    this is a first
    ------43c7f8b88e14a87dc3f2d840db93c731
    Content-Type: text/plain
    Content-Transfer-Encoding: base64

    dGhpcyBpcyBhIHNlY29uZA==
    ------43c7f8b88e14a87dc3f2d840db93c731--

    1 Rows. -- 21 msec.

See Also

mime_part()

mime_body()