17.00 - Example: Using SET QUERY_BAND … FOR TRANSACTION As a Parameterized JDBC Request - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Advanced SQL Engine
Teradata Database
Release Number
Release Date
September 2020
Content Type
Programming Reference
Publication ID
English (United States)

The following example shows how you can specify the SET QUERY_BAND … FOR TRANSACTION request as a parameterized JDBC request.

     public static void main(String args[])
          // Creation of URL to be passed to the JDBC driver
          String url = "jdbc:teradata://borg";
          // Strings representing a prepared statement 
          // and its parameter values
          String ssetqbpm = "SET QUERY_BAND = ? FOR TRANSACTION;";
          String txnqb = "cat=asta;tree=palm;flower=rose;";
          PreparedStatement pstmt = con.prepareStatement(ssetqbpm);
          // Set parameter values indicated by ? (dynamic update)
          pstmt.setString(1, txnqb);