What is MIME type "text/x-plsql"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

text/x-plsql is a MIME type for files that hold PL/SQL code. PL/SQL adds procedural features to SQL and is used with Oracle databases.

This type marks files so that text editors and development tools apply proper syntax highlighting and formatting. It makes it easier for developers to work with database code.

Key use cases:
Files associated with this MIME type use extensions such as SQL, PCK, SPC, TPS, PRC, PLS, DDL, PLB, FNC, TRG, PKB, PKS, VW, TPB, PLSQL and BDY.

Systems use the MIME type to determine the fileโ€™s content, ensuring that PL/SQL code runs and displays correctly in developer environments.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: text/x-plsql    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="text/x-plsql">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'text/x-plsql');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

How do I configure Apache to serve PL/SQL files with the correct MIME type?

To associate PL/SQL extensions with this MIME type, add the AddType directive to your server's configuration or .htaccess file. For example, use AddType text/x-plsql .plsql .pck .pkb .trg. This ensures that when a user accesses these files, the server declares them as text/x-plsql rather than generic plain text.

Why does my browser download .pck or .sql files instead of displaying them?

Browsers do not have built-in rendering engines for text/x-plsql content, so they often default to downloading the file. To force the browser to display the code as text, you can set the Content-Disposition header to inline on the server, though it will appear without syntax highlighting.

What is the difference between text/x-plsql and application/sql?

text/x-plsql is specific to Oracle's Procedural Language extensions to SQL, while application/sql is a standard type for generic SQL queries. Using text/x-plsql helps specialized editors distinguish Oracle-specific syntax (like packages and triggers) from standard ANSI SQL commands found in generic SQL files.

Is text/x-plsql a standard IANA MIME type?

No, the x- prefix indicates that this is a non-standard or vendor-specific media type. It is commonly used by development environments, such as Oracle SQL Developer or VS Code extensions, to identify files like PLS or PCK for proper syntax coloring.

How can I map this MIME type in Nginx?

You can add the mapping inside the types block of your nginx.conf or mime.types file. Add the line text/x-plsql plsql pck pkb trg; to ensure Nginx serves these extensions with the correct header information.

Are files with the text/x-plsql MIME type safe to open?

Yes, these are plain text files containing source code and are generally safe to open in a text editor. However, you should never execute the SQL commands contained within a DDL or PRC file against a database unless you trust the source, as they can modify or delete data.

What software creates files with the text/x-plsql content type?

These files are typically created by Oracle database tools, such as Oracle SQL Developer, PL/SQL Developer, or Toad for Oracle. They can also be created in standard text editors like Notepad++ or Sublime Text when saving database logic into files like FNC (functions) or TRG (triggers).

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.