Native and refresh escape sequences
- Last Updated: June 26, 2019
- 1 minute read
- DataDirect Connectors
- JDBC
- Aha! 6.0
- Amazon Redshift 6.0
- Apache Cassandra 6.0
- Apache Hive 6.0
- Apache Spark SQL 6.0
- Atlassian Jira 6.0
- Autonomous REST Connector 6.0
- Cloudera Impala 5.1
- + 24
- Apache Cassandra
- Salesforce
Native and Refresh escape sequences provide a method to embed data store-specific commands in SQL-92 statements. The Native escape sequence allows you to execute native commands directly through the client application, while the Refresh escape sequence is used to incorporate any changes introduced by the Native escape into the driver's relational map of the data.
The Native escape sequences can be used with the following syntax:
{native(command_text)}
where:
- command_text
- is a data store-specific command.
The Refresh escape sequence has no additional argument and takes the form:
{refresh}
The following example shows the execution of two data store-specific commands with a refresh of the driver's relational map of the data. Note that each Native escape sequence must have its own execute method. The Refresh escape, however, can be used in the same execute statement as the Native escape.
stmt.executeUpdate ("{native (CREATE TABLE emp (empid int, title varchar))}");
stmt.executeUpdate ("{native (CREATE TABLE dept (deptid int, city varchar))}{refresh}");