添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • InterSystems IRIS Data Platform 2025.2
  • Embedded Language Development
  • InterSystems SQL Reference
  • SQL Functions
  • CONVERT
  • InterSystems IRIS Data Platform
  • About...
  • New in 2025.2
  • New in 2025.1
  • New in 2024.3
  • New in 2024.2
  • New in 2024.1
  • New in 2023.3
  • New in 2023.2
  • New in 2023.1
  • New in 2022.3
  • New in 2022.2
  • New in 2022.1
  • New in 2021.2
  • New in 2021.1
  • New in 2020.1
  • New in 2019.1
  • Known Issues and Notes
  • Deprecated & Discontinued
  • Supported Technologies
  • Supported Languages
  • Deprecated & Discontinued
  • Version Compatibility
  • Cross-Product Support
  • Releases and Prerelease Software
  • Licensing
  • Downloading Samples
  • About...
  • About...
  • Container How-to
  • Deploy Right Now
  • Running in Containers
  • Deploying with Kubernetes
  • About...
  • Overview
  • Pre-Install
  • Attended Install
  • Development
  • Server
  • Client
  • Web Server
  • Custom
  • Unattended Install
  • Post-Install
  • Overview
  • Pre-Install
  • Attended Install
  • Development
  • Server
  • Custom
  • Client-only
  • Unattended Install
  • Post-Install
  • Installation Directory
  • Setup Types
  • Character Width Setting
  • Port Numbers
  • Installer Manifests
  • Configure Multiple Instances
  • Change Your Language
  • Web Server Troubleshooting
  • User Accounts
  • Web Server
  • Command Line Reference
  • Auto-start
  • The Write-cache Buffer
  • Red Hat Linux
  • Ubuntu
  • Web Server
  • Owners & Groups
  • Nonroot User Install
  • Install Parameters
  • Install Packages
  • Starting InterSystems IRIS
  • macOS Concurrent Processes
  • Development Evironments
  • UNIX® Install Packages
  • Script Command Reference
  • Customization
  • Running the Terminal Application from the Command Line
  • Advanced Topics
  • Connecting an IDE
  • Source Control Integration
  • Classes Page
  • Routines Page
  • Class Reference
  • About %UnitTest
  • Creating Unit Tests
  • Execute Unit Tests
  • Viewing %UnitTest Results
  • Scanning for Deprecated Code
  • Embedded Language Development
  • About...
  • Multiple Data Models
  • Introduction
  • Classes
  • Objects
  • Persistent Objects and InterSystems SQL
  • Namespaces and Databases
  • Security
  • Applications
  • Localization
  • Server Configuration Options
  • Useful Skills to Learn
  • Unicode Support
  • What’s That?
  • Transaction Processing
  • About...
  • Introduction
  • Syntax Basics
  • Procedure Syntax
  • Commands
  • Operators
  • Invoking Code & Passing Arguments
  • Variables
  • Process-Private Globals
  • Extended References
  • Multidimensional Arrays
  • Data Types
  • Numeric Values
  • Strings
  • Boolean Values
  • Lists
  • Bit Strings
  • Date & Time Values
  • Macros & Include Files
  • Embedded SQL
  • Locking & Concurrency
  • Details of Lock Requests and Deadlocks
  • Managing the Lock Table
  • %Status Values
  • Using TRY-CATCH
  • Error Logging
  • Command-Line Routine Debugging
  • (Legacy) Using ^%ETN for Error Logging
  • (Legacy) Traditional Error Processing
  • Legacy Forms of Subroutines
  • Symbols & Abbreviations
  • Operators
  • Commands
  • Routine & Debugging Commands
  • Functions
  • Special Variables
  • Structured System Variables
  • Macro Preprocessor Directives
  • Identifiers
  • General System Limits
  • System Macros
  • Flags & Qualifiers
  • Regular Expressions
  • Translation Tables
  • Numeric Computing
  • Overview of the ObjectScript Tutorial
  • Class Methods
  • Terminal
  • VS Code - ObjectScript
  • Do Command
  • Class Methods and Routines
  • Method Details
  • Passing Arguments by Reference
  • Return and Quit Commands
  • Write Command
  • Read Command
  • Set Command
  • Operator Precedence
  • Syntax
  • Common Errors
  • Write (again) and Kill Commands
  • If Construct
  • Simple Conditions
  • Complex Conditions
  • Hands-On Exercise 1
  • Class Compilation
  • Controlling Execution Flow
  • $Case Function
  • For Construct
  • While and Do/While Constructs
  • Try/Catch Construct, and Throw Command
  • Multiple Purpose Characters
  • Hands-On Exercise 2
  • Recap of Part 1
  • Strings
  • Storing a String
  • Concatenation Operator
  • Pattern Matching and Regular Expressions
  • Pattern Matching Examples
  • String Functions
  • String Functions, continued
  • Lists
  • Compare Pieces and Lists
  • Setting Substrings, Pieces, and List Items
  • More List Functions
  • Bitstrings
  • Dates
  • Hands-On Exercise 3
  • JavaScript Object Notation (JSON)
  • Arrays
  • Ordered Trees
  • Ordered Trees, continued
  • Value and Existence, and the $Data Function
  • Viewing and Killing Arrays
  • Globals
  • $Increment and $Sequence Functions
  • Storage Method
  • Storage Method, continued
  • Example of Globals
  • Hands-On Exercise 4
  • Recap of Part 2
  • $Order Function
  • $Order Function, continued
  • Working With Indexes
  • $Order Loop
  • Nested $Order Loops
  • Starting Focused $Order Loops
  • Ending Focused $Order Loops
  • Hands-On Exercise 5
  • Conversion Functions
  • $Get Function
  • Hands-On Exercise 6
  • Database Integrity
  • Lock Command
  • Lock Command, continued
  • Lock Command and $Test
  • Transaction Processing
  • Hands-On Exercise 7
  • InterSystems IRIS Objects and SQL
  • Object Methods
  • Object Storage
  • SQL Queries
  • Recap Of Part 3
  • Right Triangle Example Class
  • Exercise 1: First Data Entry Class
  • Exercise 2: Second Data Entry Class
  • Exercise 3: Third Data Entry Class
  • Exercise 4: Storage Method
  • Exercise 5: First Lookup Class
  • Exercise 6: Second Lookup Class
  • Exercise 7: Third Lookup Class
  • Install and Import Python Packages
  • Run Embedded Python
  • Call Embedded Python Code from ObjectScript
  • Call InterSystems IRIS from Embedded Python
  • Bridge the Gap Between ObjectScript and Embedded Python
  • Use Embedded Python in Interoperability Productions
  • Use the Flexible Python Runtime Feature
  • InterSystems IRIS Python Module Reference
  • Querying the Database
  • Defining and Using Stored Procedures
  • Storing and Using Stream Data (BLOBs and CLOBs)
  • SQL Users, Roles, and Privileges
  • Using Vector Search
  • SQL Settings Reference
  • Importing SQL Code
  • Importing and Exporting SQL Data
  • About SQL Search
  • Basics: SQL Search
  • Using SQL Search
  • SQL Search REST Interface
  • SQL Security
  • SQL Performance Overview
  • How InterSystems IRIS Processes SQL Statements
  • Best Practices for Improving SQL Performance
  • Analyze SQL Statements and Statistics
  • Interpreting an SQL Query Plan
  • SQL Performance Analysis Toolkit
  • Get SQL Performance Help
  • Table Statistics for Query Optimizer
  • Define and Build Indexes
  • Choose an SQL Table Storage Layout
  • Define SQL Optimized Tables Through Persistent Classes
  • Configure Parallel Query Processing
  • Using Runtime Plan Choice
  • Configure Frozen Plans
  • Using Adaptive Mode to Improve Performance
  • Working with Cached Queries
  • Specify Optimization Hints in Queries
  • SQL Gateway Overview
  • Accessing a Database with the SQL Gateway
  • Connecting the SQL Gateway via JDBC
  • Connecting the SQL Gateway via ODBC
  • Using the SQL Gateway Programmatically
  • XDBC Gateway Overview
  • Connecting with the XDBC Gateway
  • Using the XDBC Gateway
  • Introducing InterSystems IRIS Document Database (DocDB)
  • Managing Documents
  • REST Client Methods
  • About...
  • Introduction
  • Access Built-in Web Apps with Your Web Server
  • Setup Overview
  • Install a Standalone Web Gateway
  • Extend Your Web Server Configuration
  • Choose URL Paths to Route
  • Overview of the Web Gateway Management Pages
  • Define Server Access Profiles
  • Define Application Access Profiles
  • Configure System-Wide Parameters
  • Protecting Web Gateway Connections to InterSystems IRIS
  • Managing and Monitoring the Web Gateway
  • CGI Environment Variables Passed by the Web Gateway
  • HTTP Response Headers Returned by the Web Gateway
  • Compressing the Response to Requests for CSP Forms (GZIP/ZLIB)
  • Implementing HTTP Authentication for Web Applications
  • Load Balancing, Failover, and Mirrored Configurations
  • Process Affinity and State-Aware Mode (Preserve Mode 1)
  • Web Gateway Registry in InterSystems IRIS
  • CSP.ini Parameter Reference
  • Using the NSD (Windows)
  • Using the NSD (UNIX®/Linux/macOS)
  • Alternative Options for Apache (UNIX®/Linux/macOS)
  • Locked-Down Apache
  • Alternative Options for IIS 7 or Later (Windows)
  • Apache Considerations (UNIX®/Linux/macOS)
  • IIS Considerations (Windows)
  • About...
  • Introduction to Creating REST Services
  • Creating and Editing REST Services
  • Modifying the Implementation Class
  • Modifying the Specification Class
  • Securing REST Services
  • Listing and Documenting REST APIs
  • /api/mgmnt/ API Endpoints
  • OpenAPI Properties in Use
  • Creating a REST Service Manually
  • Using JSON in ObjectScript
  • Creating and Modifying Dynamic Entities
  • Iteration and Sparse Arrays
  • Working with Datatypes
  • Converting Dynamic Entities to and from JSON
  • Using the JSON Adaptor
  • Quick Reference for Dynamic Entity Methods
  • Requiring a Username and Password
  • Controlling the XML Types
  • Controlling the Namespaces of the Schema and Types
  • Including Documentation for the Types
  • Adding Namespace Declarations to the SOAP Envelope
  • Checking for Required Elements and Attributes
  • Controlling the Form of Null String Arguments
  • Controlling the Message Name of the SOAP Response
  • Overriding the HTTP SOAP Action and Request Message Name
  • Specifying Whether Elements Are Qualified
  • Controlling Whether Message Parts Use Elements or Types
  • Controlling Use of the xsi:type Attribute
  • Controlling Use of Inline References in Encoded Format
  • Specifying the SOAP Envelope Prefix
  • Restricting the SOAP Versions Handled by a Web Service
  • Sending Responses Compressed by gzip
  • Defining a One-Way Web Method
  • Adding Line Breaks to Binary Data
  • Adding a Byte-Order Mark
  • Customizing the Timeout Period
  • Using Process-Private Globals to Support Very Large Messages
  • Customizing Callbacks of a Web Service
  • Specifying Custom Transport for a Web Service
  • Defining Custom Processing in a Web Service
  • Modifying a Web Client
  • Disabling Keep-Alive for a Web Client
  • Controlling the Form of Null String Arguments
  • Controlling the Client Timeout
  • Using a Proxy Server
  • Setting HTTP Headers
  • Specifying the HTTP Version to Use
  • Disabling SSL Server Name Checking
  • Controlling Use of the xsi:type Attribute
  • Controlling Use of Inline References for Encoded Format
  • Specifying the Envelope Prefix
  • Adding Namespace Declarations to the SOAP Envelope
  • Sending Responses Compressed by gzip
  • Quoting the SOAP Action (SOAP 1.1 Only)
  • Treating HTTP Status 202 Like Status 200
  • Defining a One-Way Web Method
  • Adding Line Breaks to Binary Data
  • Adding a Byte-Order Mark
  • Using Process-Private Globals When Parsing
  • Creating Custom SOAP Messages
  • Specifying Custom HTTP Requests
  • Customizing Callbacks of a Web Client
  • Specifying Custom Transport from a Web Client
  • Specifying Flags for the SAX Parser
  • Using the WS-Security Login Feature
  • Using HTTP Authentication
  • Securing Web Services with SOAP
  • Setup and Other Common Activities
  • Creating and Using Policies
  • WS-Policy Configuration Class Details
  • Adding Security Elements Manually
  • Adding Timestamps and Username Tokens
  • Encrypting the SOAP Body
  • Encrypting Security Header Elements
  • Adding Digital Signatures
  • Using Derived Key Tokens for Encryption and Signing
  • Combining Encryption and Signing
  • Validating and Decrypting Inbound Messages
  • Creating Secure Conversations
  • Using WS-ReliableMessaging
  • Creating and Adding SAML Tokens
  • Troubleshooting Security Problems
  • Details of the Security Elements
  • What Is %Library.File?
  • Query Directories and Drives
  • File and Directory Properties and Attributes
  • File and Directory Names
  • Work with Directories
  • Work with Files
  • Work with the %File Object
  • %File Example
  • Introduction
  • Considerations When Using the XML Tools
  • Reading & Validating
  • Using %XML.TextReader
  • Importing into Objects
  • Representing as DOM
  • Writing XML from Objects (Basics)
  • Writing XML (Details)
  • Encryption
  • Signing
  • XPath Expressions
  • XSLT Transformations
  • Customizing Parser
  • Classes from Schemas
  • Schemas from Classes
  • Examining Namespaces and Classes
  • XML Standards
  • XML Background
  • Introduction to Object-XML Projections
  • Projecting Objects to XML
  • Controlling Transformations of Values
  • Handling Empty Strings and Null Values
  • Controlling the XML Element and Attribute Names
  • Specifying Namespaces for Elements and Attributes
  • Controlling the Projection to XML Schemas
  • Advanced Options for XML Schemas
  • Special Topics
  • Summary of XML Projection Parameters
  • HTTP Request
  • HTTP Response
  • Email Support
  • Creating Email Messages
  • Sending via SMTP
  • Retrieving via POP3
  • Working with Received Email
  • IBM WebSphere MQ
  • Using the Messaging APIs
  • Kafka
  • RabbitMQ
  • Amazon SNS
  • Amazon SQS
  • Introduction
  • Tutorial
  • Reference
  • Tools Index
  • Introduction to InterSystems External Servers
  • Working with External Languages
  • Managing External Server Connections
  • Customizing External Server Definitions
  • InterSystems External Server Requirements
  • Quick Reference for the ObjectScript $system.external Interface
  • About...
  • JDBC for Relational Access
  • Demo: Connect with JDBC
  • Demo: Java and XEP
  • Java with InterSystems Overview
  • InterSystems Java Connectivity Options
  • Using the JDBC Driver
  • Configuration and Requirements
  • JDBC Fundamentals
  • JDBC Quick Reference
  • Introduction to the Java Native SDK
  • Calling ObjectScript Methods from Java
  • Using Java Inverse Proxy Objects
  • Working with Global Arrays
  • Transactions and Locking
  • Java Native SDK Quick Reference
  • The InterSystems Persister for Java
  • Overview of the Java Persister
  • Serializing Data with Persister
  • Implementing Schemas with SchemaManager
  • Designing Schemas with SchemaBuilder
  • Java Persister Examples
  • Quick Reference for Java Persister Classes
  • Using XEP with Java Overview
  • Introduction to XEP
  • Using XEP Event Persistence
  • XEP Quick Reference
  • Overview of Java Third-party Software
  • JDBC Driver Support
  • Hibernate Support
  • R Gateway Support
  • R Gateway Support
  • About...
  • Demo: .NET and XEP
  • Introduction to Using .NET with InterSystems Software
  • Connecting to the Database with .NET
  • .NET Requirements and Configuration
  • Using the ADO.NET Managed Provider
  • Quick Reference for the .NET Managed Provider
  • Native SDK for .NET Overview
  • Introduction to the .NET Native SDK
  • Calling ObjectScript Methods from .NET
  • Using .NET Inverse Proxy Objects
  • Working with Global Arrays in .NET
  • Transactions and Locking
  • Native SDK for .NET Quick Reference
  • Introduction to XEP for .NET
  • Using XEP Event Persistence with .NET
  • Quick Reference for XEP .NET Classes
  • About...
  • Document Overview
  • Getting Started
  • Defining an ODBC Data Source on Windows
  • Defining an ODBC Data Source on UNIX®
  • ODBC Installation and Validation on UNIX® Systems
  • ODBC Support for Python and Node.js
  • Logging and Environment Variables
  • Orientation for Python Developers
  • Introduction to Python InterSystems IRIS Development
  • Basic SQL via Python: Using InterSystems IRIS as a Relational Database
  • Building InterSystems IRIS Applications with Familiar Python Tools
  • Deciding How to Use InterSystems IRIS with Python
  • Becoming an InterSystems IRIS Power User
  • Introduction to the Native SDK for Python
  • Native Python SDK Installation and Setup
  • Calling Database Methods from Python
  • Controlling Database Objects from Python
  • Accessing Global Arrays with Python
  • Managing Transactions and Locking with Python
  • Using the Python DB-API
  • Native SDK for Python Quick Reference
  • Introduction to the Native SDK for Node.js
  • Calling Class Methods from Node.js
  • Controlling Database Objects from Node.js
  • Accessing Global Arrays with Node.js
  • Managing Transactions and Locking with Node.js
  • Native SDK for Node.js Quick Reference
  • The InterSystems $ZF Callout Interface
  • Overview of the $ZF Callout Functions
  • Running Programs or System Commands with $ZF(-100)
  • Creating an InterSystems Callout Library
  • Invoking Callout Library Functions
  • InterSystems $ZF Callout Quick Reference
  • Introduction to Interoperability Productions
  • Connectivity Options
  • Business Processes and Business Logic
  • Other Production Options
  • Production Roadmap
  • Planning a Deployment
  • Best Practices for Production Development
  • Design Model for a Routing Production
  • Converting Interfaces to Production Elements
  • Managing Databases for Productions
  • About...
  • Introduction
  • Coding Business Hosts
  • Defining Messages
  • Business Service Class
  • Business Process Class
  • Business Operation Class
  • Alert Processor
  • Data Transformations
  • Business Metrics
  • Enterprise Message Bank
  • Record Mapper
  • Complex Record Mapper
  • Record Map Batch
  • Other Development Tasks
  • Test and Debug
  • Deploy Production
  • Production Lifecycle
  • Introduction
  • Getting Started
  • About Business Hosts and Adapters
  • PEX Messaging
  • Inbound Adapters
  • PEX Outbound Adapters
  • Business Services
  • PEX Business Processes
  • PEX Business Operations
  • Registering a PEX Component
  • Connecting with External Language Servers
  • PEX API Reference
  • Introduction
  • Listing the Business Processes
  • Creating
  • Editing
  • Variables Available in BPL
  • BPL Syntax Rules
  • List of BPL Elements
  • Handling Errors in BPL
  • BPL Business Process Example
  • DTL Tools
  • Introduction to the DTL Editor
  • Creating Data Transformations
  • Adding and Editing Actions
  • DTL Syntax Rules
  • Actions That Set or Clear Values
  • Other Actions
  • Listing & Managing
  • Testing
  • BPL Elements
  • DTL Elements
  • About Business Rules
  • Getting Started
  • Working with Rules
  • Debugging Routing Rules
  • Utility Functions for Use in Productions
  • Enterprise Service Bus and Registry Overview
  • Accessing the Public Service Registry through the Public REST API
  • Administering the Public Service and External Service Registries
  • Configuring an ESB
  • Configuring ESB Services and Operations
  • Configuring an InterSystems IRIS System and Creating a Namespace
  • Configuring a Web Application for a Pass-through Business Service
  • Pass-through Service and Operation Walkthrough
  • Service Registry Public API Reference
  • Overview
  • Developing a Workflow
  • Including Custom Features in a Workflow
  • Testing a Workflow
  • Exploring the Workflow Sample
  • Available Workflow Metrics
  • Push Notifications Overview
  • Configuring and Using Push Notifications
  • System Default Settings
  • Interoperability Settings
  • Configuring a Mirror Virtual IP as the Network Interface
  • Enterprise Message Bank
  • Identifying Enterprise Systems for Viewing and Monitoring
  • Settings Reference
  • Introduction
  • Starting and Stopping
  • Deploying Productions
  • Purging Data
  • Using the Archive Manager
  • Managing Workflows
  • Publish and Subscribe
  • Controlling Data Storage
  • Security Roles and Resources
  • Menu Items
  • Core Concepts
  • Monitoring All Namespaces
  • Monitoring a Production
  • Viewing, Searching, and Managing Messages
  • Event Log
  • Tracing
  • Business Rule Log
  • Business Process Instances
  • I/O Archive
  • Viewing Messages from Multiple Productions
  • Enterprise Message Viewer
  • Enterprise Message Bank
  • Interface Maps
  • Interface References
  • Alerts
  • Activity Volume
  • Port Usage
  • Testing Productions Tutorial
  • TestControl
  • Callback Methods
  • Auxiliary Methods
  • Parameters and Properties
  • Creating a Test - Summary
  • Executing a Test
  • Example Overview
  • Example: Example Production
  • Example: Production Test
  • Example: OnAfterProductionStart
  • Example: CheckResults
  • Example: CheckErrors
  • Example: Executing the Test
  • Recap
  • Creating Tutorial.ExampleOperation
  • JMS Overview (Legacy)
  • JMS Business Services & Operations (Legacy)
  • Custom JMS Services & Operations (Legacy)
  • Introduction
  • Inbound Adapter
  • Outbound Adapter
  • Troubleshooting IBM WebSphere MQ Adapters
  • Settings Reference
  • Introduction
  • MQTT Adapters
  • Passthrough
  • Settings Reference
  • REST Services
  • REST Operations
  • Introduction
  • Web Services
  • Web Clients
  • Configuring the Production
  • Inbound Adapter (Alternative)
  • Older Web Service Variation
  • Settings Reference
  • Overview
  • Setup Tasks
  • Using the SAP Java Connector
  • Introduction
  • Using an SQL Business Service
  • Using an SQL Business Operation
  • More About Messages
  • More About Procedures
  • Custom SQL Business Services
  • Custom SQL Business Operations
  • Creating Adapter Methods
  • Using Result Sets (SQL Adapters)
  • Using Snapshots (SQL Adapters)
  • Inbound Adapters
  • Outbound Adapters
  • Special Topics
  • Settings Reference
  • Introduction
  • Prerequisites & Configuration
  • Configuring the Production
  • MFT API
  • Introduction to Business Intelligence
  • Introduction to the Business Intelligence User Interfaces
  • Introduction to the Other Business Intelligence Tools
  • Business Intelligence Glossary
  • Overview of InterSystems IRIS Business Intelligence Models
  • Basic Concepts
  • Summary of Model Options
  • Principles and Recommendations
  • Defining Models for InterSystems Business Intelligence
  • Compiling and Building Cubes
  • Defining Dimensions, Hierarchies, and Levels
  • Details of Defining Levels
  • Defining Properties
  • Defining Measures
  • Defining Listings
  • Defining Listing Fields
  • Defining Calculated Members
  • Defining a Named Set
  • Defining Subject Areas
  • Defining Listing Groups
  • Reference Information for Cube Classes
  • Reference Information for Subject Area Classes
  • Details for the Fact and Dimension Tables
  • Defining Computed Dimensions
  • Defining Shared Dimensions and Compound Cubes
  • Defining Cube-Cube Relationships
  • Using Text Analytics in Cubes
  • Defining Term Lists
  • Defining Worksheets
  • Defining Quality Measures
  • Defining Basic KPIs
  • Defining KPIs with Filters and Listings
  • Defining Advanced KPIs
  • Defining Plug-ins
  • Using Cube Inheritance
  • Defining Intermediate Expressions
  • Other Options
  • Reference Information for KPI and Plug-in Classes
  • Generating Secondary Cubes for Use with Text Analytics
  • Introduction to the User Portal
  • Using the Portal Features
  • Orientation to Dashboards
  • Using Dashboards
  • Using the Pivot Analysis Window
  • Introduction to Dashboards
  • Creating and Modifying Dashboards
  • Specifying Common Widget Options
  • Adding Pivot Table Widgets
  • Adding Chart Widgets
  • Customizing the Appearance of a Chart Widget
  • Adding Meter Widgets
  • Adding Scorecard Widgets
  • Adding Other Widgets
  • Defining and Using Themes
  • Adding Widget Controls
  • Overview of Business Intelligence
  • Initial Steps
  • Settings
  • Data Connectors
  • Performance Tips
  • Custom Actions
  • Accessing Dashboards from Your Application
  • Keeping the Cubes Current
  • Using Cube Synchronization
  • Using the Cube Manager
  • Executing Queries Programmatically
  • Localization
  • Packaging Business Intelligence Elements into Classes
  • Portlets
  • Additional Steps
  • Controlling Access
  • Cube Versions
  • How the Analytics Engine Works
  • MDX Performance Utility
  • Logging and Diagnostics
  • Other Export/Import Options
  • Disaster Recovery
  • Introduction to the Analyzer
  • Creating Pivot Tables
  • Filtering Pivot Tables
  • Defining Calculated Elements
  • Defining and Using Pivot Variables
  • Customizing Pivot Tables
  • Working with Pivot Tables
  • Performing Ad Hoc Analysis
  • Configuring InterSystems IRIS for PDF Output
  • Business Intelligence and MDX
  • Basic MDX Queries
  • Working with Levels
  • Working with Dimensions and Hierarchies
  • Working with Sets
  • Tuples and Cubes
  • Filtering a Query
  • Adding Summaries
  • Creating Calculated Measures and Members
  • Basic Rules
  • Expression Types (MDX)
  • MDX Statements and Clauses
  • MDX Functions
  • Intrinsic Properties (MDX)
  • NOW Member for Time Levels
  • Quick Function Reference (MDX)
  • Power BI
  • Using Business Intelligence
  • DeepSee.js
  • Business Intelligence REST API
  • Business Intelligence Tutorial: Getting Started
  • Introduction to Cube Elements
  • Creating a Cube
  • Expanding the Cube Definition
  • Creating Subject Areas
  • Creating & Packaging Pivot Tables & Dashboards
  • Creating an NLP Environment Manually
  • Loading Text Data Programmatically
  • Performance Considerations when Loading Texts
  • NLP Queries
  • Semantic Attributes
  • Stemming
  • Skiplists
  • Filtering Sources
  • Text Categorization
  • Dominance and Proximity
  • Custom Metrics
  • Smart Matching: Creating a Dictionary
  • Smart Matching: Using a Dictionary
  • User Interfaces
  • InterSystems IRIS Natural Language Processing (NLP) Tools
  • iKnow Web Services
  • KPIs and Dashboards
  • Customizing NLP
  • Language Identification
  • Domain Parameters
  • Predictive Modeling Markup Language
  • Using UIMA Support
  • InterSystems Reports
  • InterSystems IRIS Adaptive Analytics
  • If you're experiencing an issue with AskMe or want to provide feedback, email us at [email protected]

    Include relevant details, such as the response text or screenshots, to help us resolve the issue.

    Thanks for your feedback!
    Need to tell us more? Click here or use the Feedback button.

    Is this page helpful?

    CONVERT is more flexible than CAST . For example, CONVERT supports the conversion of stream data and enables formatting of date and time values.

    CAST provides more database compatibility than CONVERT . Whereas CAST is implemented using the ANSI SQL-92 standard, CONVERT implementations are database-specific. InterSystems SQL provides CONVERT implementations that are compatible with MS SQL Server and ODBC.

    MS SQL Server Compatibility

    This implementation of CONVERT is a general InterSystems IRIS® scalar function that is compatible with MS SQL Server. This function supports the formatting of dates and times and the conversion of stream data .

    CONVERT( type , expression ) converts an expression to the specified data type. For a list of the data types supported by InterSystems SQL, see Data Types .

    This statement converts a decimal number (an approximation of pi) to a character string, truncating the number to four characters.

    SELECT CONVERT(CHAR(4),3.14159) -- '3.14'

    Examples:

    Convert Between Numeric Types

    Convert Between Character Strings

    Convert Stream Data to Character String

    Convert Character String to Numeric Type

    Convert Date to Timestamp

    Convert Date to Numeric Type

    CONVERT( type , expression , formatCode ) converts the expression to the specified data type and formats the returned value based on the specified format code.

    This statement converts a date string to the TIMESTAMP data type. The function converts the input based on format code 103, which represents the mm/dd/yy format. For a complete list of format codes, see the formatCode argument.

    SELECT CONVERT(TIMESTAMP,'1/1/99',103) -- '01/01/1999 00:00:00'

    Example: Convert Date to Character String

    ODBC Compatibility

    This implementation of CONVERT is a general InterSystems IRIS ODBC scalar function. This function does not support the formatting of dates and times. It also does not support the conversion of stream data.

    {fn CONVERT( expression , type )} converts the expression to the specified data type. In this implementation of CONVERT , you must precede each data type argument with the SQL_ keyword. These data types do not accept parameter. For example, for string data types, you cannot set a maximum length. For numeric data types, you cannot set the precision (maximum number of digits) and scale (maximum number of decimal digits).

    This statement converts a decimal number to a character string. The returned string performs no truncation. Maximum length specifications such as SQL_VARCHAR(4) are not permitted.

    SELECT {fn CONVERT(3.14159,SQL_VARCHAR) } -- '3.14159'

    Examples:

    Convert Between Numeric Types

    Convert Between Character Strings

    Convert Character String to Numeric Type

    Convert Date to Timestamp

    Convert Date to Numeric Type

    The data type to convert expression to. The types you can specify depend on whether you are using the InterSystems IRIS CONVERT() syntax or the ODBC {fn CONVERT()} syntax.

    CONVERT() Function

    The InterSystems IRIS CONVERT() syntax supports the data types described in Data Types . Common data types that you can specify include:

    Character string data types: CHAR, CHARACTER, VARCHAR. For some character string types, you can optionally specify a maximum length parameter. For example: VARCHAR(10)

    Numeric data types: INTEGER, DECIMAL, DOUBLE, MONEY. For some numeric types, you can optionally specify precision and scale parameters. For example: DECIMAL(8,4)

    Data and time data types: DATE, TIME, TIMESTAMP, POSIXTIME

    Bit and binary data types: BIT, BINARY, VARBINARY

    {fn CONVERT()} Function

    The ODBC {fn CONVERT()} syntax supports a more limited set of data types than the CONVERT() syntax. The supported data types correspond to the ones you specify for the CONVERT() syntax but must be preceded by the SQL_ keyword.

    This table describes the valid data types that you can specify, separated into two groups:

    The first group converts both the data value and the data type. For example, converting a %Date source to SQL_VARCHAR transforms the date to a text value and the query processes it as a VARCHAR data type.

    The second group converts the data type but does not convert the data value. For example, converting a %Date source to INTEGER does not transform the %Date source but the query processes the integer form of the date as an INTEGER data type.

    Source Valid Conversion Types (Type and Value Converted) Valid Conversion Types (Only Type Converted) Any numeric data type SQL_VARCHAR, SQL_DOUBLE, SQL_DATE, SQL_TIME %String SQL_DATE, SQL_TIME, SQL_TIMESTAMP %Date SQL_VARCHAR, SQL_POSIXTIME, SQL_TIMESTAMP SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT, SQL_DATE %Time SQL_VARCHAR, SQL_POSIXTIME, SQL_TIMESTAMP SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT, SQL_TIME %PosixTime SQL_TIMESTAMP, SQL_DATE, SQL_TIME SQL_VARCHAR, SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT %TimeStamp SQL_POSIXTIME, SQL_DATE, SQL_TIME SQL_VARCHAR, SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT Any non-stream data type SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT SQL_DOUBLE

    When specifying data types for this, keep these points in mind:

    SQL_VARCHAR is the standard ODBC representation. When converting to SQL_VARCHAR, dates and times are converted to their appropriate ODBC representations; numeric datatype values are converted to a string representation. When converting from SQL_VARCHAR, the value must be a valid ODBC Time, Timestamp, or Date representation.

    When converting a time value to SQL_TIMESTAMP or SQL_POSIXTIME, an unspecified date defaults to 1841-01-01. In the CONVERT() syntax, the date defaults to 1900-01-01.

    When converting a date value to SQL_TIMESTAMP or SQL_POSIXTIME the time defaults to 00:00:00.

    Fractional seconds can be preceded by either a period (.) or a colon (:). The symbols have different meanings. A period indicates a standard fraction; thus 12:00:00.4 indicates four-tenths of a second, and 12:00:00.004 indicates four-thousandth of a second. A colon indicates that what follows is in thousandths of a second; thus 12:00:00:4 indicates four-thousandth of a second. The permitted number of digits following a colon is limited to three.

    When converting to an integer data type or the SQL_DOUBLE data type, the CONVERT function converts data values (including dates and times) to a numeric representation. For SQL_DATE, this is the number of days since January 1, 1841. For SQL_TIME, this is the number of seconds since midnight. When CONVERT encounters a nonnumeric character, it truncates the input string at that character. The integer data types also truncate decimal digits, returning the integer portion of the number.

    If expression does not have a defined data type (for example, a host variable supplied by ObjectScript) its data type defaults to the string data type.

    If expression contains stream data and you are using the {fn CONVERT( expression , type )} syntax, then CONVERT issues an SQLCODE -37 error.

    If expression is NULL, the converted value remains NULL, regardless of the specified type.

    If expression is an empty string ('') or a nonnumeric string value, the returned value depends on the specified type :

    If type is a string data type, then CONVERT returns the supplied value.

    If type is a numeric data type or type TIME, SQL_TIME, or SQL_DATE, then CONVERT returns 0 (zero).

    Specifying an invalid value given the type results in an SQLCODE -141 error.

    formatCode

    An integer code that specifies date, datetime, and time formats.

    Use formatCode to define the output when converting from a date/time/timestamp data type to a character string. For example:

    SELECT CONVERT(VARCHAR,TO_DATE('22 FEB 2022'),1) -- '02/22/22'

    You can also use formatCode to define the input when converting from a character string to a date/time/timestamp data type. For example:

    SELECT CONVERT(DATE,'22 FEB 2022',106) -- '02/22/2022'

    Only the CONVERT() syntax supports formatCode .

    Specifying an expression with an invalid format or a format that does not match the formatCode generates an SQLCODE -141 error. Specifying a non-existent formatCode returns 1900-01-01 00:00:00.

    This table describes the supported format codes, where:

    The first column lists codes that output a two-digit year.

    The second column lists code that output a four-digit year or do not output a year.

    Default Values

    For the CONVERT() syntax, when converting a time value to TIMESTAMP, POSIXTIME, DATETIME, or SMALLDATETIME, the date defaults to 1900-01-01. For the {fn CONVERT()} syntax, the date defaults to 1841-01-01.

    When converting a date value to TIMESTAMP, POSIXTIME, DATETIME, or SMALLDATETIME, the time defaults to 00:00:00.

    Default Format

    If you do not specify formatCode , CONVERT tries to determine the format from the specified value. If it cannot, it defaults to formatCode 100 (mm-dd-yy).

    Two-Digit Years

    Two-digit years from 00 through 49 are converted to 21st century dates (2000 through 2049).

    Two-digit years from 50 through 99 are converted to 20th century dates (1950 through 1999).

    Fractional Seconds

    You can precede fractional seconds by either a period (.) or a colon (:). The symbols have different meanings:

    Period (default) — Valid for all formatCode values. A period indicates a standard fraction. For example, 12:00:00.4 indicates four-tenths of a second and 12:00:00.004 indicates four-thousandth of a second. CONVERT has no limit on the number of digits of fractional precision.

    Colon — Valid only for formatCode values 9/109, 13/113, 14/114, 130, and 131. A colon indicates that the number that follows is in thousandths of a second. For example, 12:00:00:4 indicates four-thousandth of a second ( 12:00:00.004 ). You can specify a maximum of three digits of fractional precision.

    Convert Between Numeric Types

    This example compares the conversion of a fractional number using the DECIMAL and DOUBLE data types. It uses the InterSystems IRIS CONVERT() syntax. The conversion to DOUBLE results in a loss of precision.

    SELECT CONVERT(DECIMAL,-123456789.0000123456789) AS DecimalVal, -- -123456789.0000123457
           CONVERT(DOUBLE,-123456789.0000123456789) AS DoubleVal -- -123456789.00001235306

    This statement uses the ODBC {fn CONVERT()} syntax to perform a similar conversion. This syntax does not support a DECIMAL data type, so the statement converts to a DOUBLE data type only.

    SELECT {fn CONVERT(-123456789.0000123456789,SQL_DOUBLE) } AS DecimalVal -- -123456789.00001235306

    Convert Between Character Strings

    This example shows how to truncate a string by performing a VARCHAR-to-VARCHAR conversion, specifying an output string length shorter than the expression string length. Truncation is supported only for the InterSystems IRIS CONVERT() syntax. The only supported character string format for the ODBC {fn CONVERT()} syntax is SQL_VARCHAR.

    SELECT CONVERT(VARCHAR(5),'Hello, World') As TruncatedValue -- 'Hello'

    If a character data type has no specified length, the default maximum length is 30 characters.

    SELECT CONVERT(VARCHAR,'This string is more than 30 characters.') --This string is more than 30 ch
    SELECT {fn CONVERT('This string is more than 30 characters.',SQL_VARCHAR) } --This string is more than 30 ch

    For the CONVERT() syntax, this maximum length also applies to converts to BINARY or VARBINARY types. Otherwise, these data types with no specified length are mapped to a MAXLEN of 1 character, as shown in the Data Types table.

    Convert Stream Data to Character String

    This example converts a character stream field to a VARCHAR text string. It also displays the length of the character stream field using CHAR_LENGTH:

    SELECT Notes,CONVERT(VARCHAR(80),Notes) AS NoteText,CHAR_LENGTH(Notes) AS TextLen
    FROM Sample.Employee WHERE Notes IS NOT NULL

    The ODBC {fn CONVERT()} syntax does not support character streams.

    Convert Date to Character String

    This example converts dates in the "DOB" (Date Of Birth) column to the SQL_VARCHAR data type. The resulting string is in the format: yyyy-mm-dd .

    SELECT DOB,CONVERT(VARCHAR,DOB) AS DOBtoVChar
    FROM Sample.Person
    SELECT DOB,{fn CONVERT(DOB,SQL_VARCHAR)} AS DOBtoVChar
    FROM Sample.Person

    This example shows several conversions of the date-of-birth field (DOB) to a formatted character string. A sample output date string appears in a comment after each conversion.

    SELECT DOB,
           CONVERT(VARCHAR(20),DOB) AS DOBDefault, -- Mar 20 1983 12:00AM
           CONVERT(VARCHAR(20),DOB,100) AS DOB100, -- Mar 20 1983 12:00AM
           CONVERT(VARCHAR(20),DOB,107) AS DOB107, -- Mar 20, 1983
           CONVERT(VARCHAR(20),DOB,114) AS DOB114, -- 00:00:00.000
           CONVERT(VARCHAR(20),DOB,126) AS DOB126  -- 1983-03-20T00:00:00:
    FROM Sample.Person

    The default format and the code-100 format are the same. Because the DOB field does not contain a time value, formats that display time (here including the default, 100, 114, and 126) supply a zero value, which represents 12:00AM (midnight). The code-126 format provides a date and time string that contains no spaces.

    Only the InterSystems IRIS CONVERT() syntax supports date string formatting, not ODBC {fn CONVERT()} syntax.

    Convert Character String to Numeric Type

    This example converts a mixed string to an integer. InterSystems IRIS truncates the string at the first nonnumeric character and then converts the resulting numeric to canonical form :

    SELECT CONVERT(INTEGER,'007 James Bond') -- 7
    SELECT {fn CONVERT('007 James Bond',SQL_INTEGER)} -- 7

    Convert Date to Timestamp

    This example converts dates in the "DOB" (Date Of Birth) column to timestamp data types. The resulting timestamp is in the format yyyy-mm-dd hh:mm:ss .

    SELECT DOB,CONVERT(TIMESTAMP,DOB) AS DOBtoTstamp
    FROM Sample.Person
    SELECT DOB,{fn CONVERT(DOB,SQL_TIMESTAMP)} AS DOBtoTstamp
    FROM Sample.Person

    Convert Date to Numeric Type

    This example converts dates in the "DOB" (Date Of Birth) column to integer data types. The resulting integer is the $HOROLOG count of days since December 31, 1840.

    SELECT DOB,CONVERT(INTEGER,DOB) AS DOBtoInt
    FROM Sample.Person
    SELECT DOB,{fn CONVERT(DOB,SQL_INTEGER)} AS DOBtoInt
    FROM Sample.Person

    Convert Bit Values

    You can perform a BIT data type conversion. The permitted values are 1, 0, or NULL. If you specify any other value, InterSystems IRIS issues an SQLCODE -141 error. This example shows two BIT conversions of a NULL:

      SET a=""
      &sql(SELECT CONVERT(BIT,:a),
           CONVERT(BIT,NULL)
           INTO :x,:y)
      WRITE !,"SQLCODE=",SQLCODE
      WRITE !,"the host variable is:",x
      WRITE !,"the NULL keyword is:",y

    You can specify empty strings in bit conversion only when it is stored in a host variable using embedded SQL. If you specify an empty string directly, as in CONVERT(BIT,'') , InterSystems IRIS issues an SQLCODE -141 error.

    More About

    CONVERT Class Method

    You can also perform data type conversions using the CONVERT() Opens in a new tab method call, specifying data types as SQL_ keywords, as shown in this syntax:

    $SYSTEM.SQL.Functions.CONVERT(expression,SQL_convertToType,SQL_convertFromType)
    

    For example:

      write $SYSTEM.SQL.Functions.CONVERT(66225,"SQL_VARCHAR","SQL_DATE")
    © 2025 InterSystems Corporation, Boston, MA. All rights reserved.
    PrivacyOpens in a new tab & TermsOpens in a new tab GuaranteeOpens in a new tab AccessibilityOpens in a new tab
    Content date/time: 2025-11-13 22:30:54