CREATE/REPLACE PROCEDURE Syntax | Teradata Database - CREATE PROCEDURE and REPLACE PROCEDURE Syntax (External Form) - Teradata Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Database
Release Number
20.00
Publication Date
June 2025
Content Type
SQL Reference
Publication ID
B035-1144-200K
ft:locale
en-US
ft:lastEdition
2026-09-23
dita:mapPath
mbm1747160743883.ditamap
dita:ditavalPath
jlp1749501702948.ditaval
ft:sourceId
dita
dita:id
mdr1472255012272
lifecycle
latest
{ CREATE | REPLACE } PROCEDURE [ database_name. | user_name. ] procedure_name
  ( parameter_specification [,...] )
  [ DYNAMIC RESULT SETS number_of_sets ]
  language_and_access_specification
  parameter_style_specification
  [ USING GLOP SET GLOP_set_name ]
  [ SQL SECURITY privilege_option ]
  EXTERNAL [ NAME { external_procedure_name | 'code_specification [delimiter...]' | 'JAR_ID_specification' } ] 
  [ parameter_style_specification ]
  [ EXTERNAL SECURITY { DEFINER [ authorization_name ] | INVOKER } ] [;]
You can specify language_and_access_specification and parameter_style_specification in the reverse order.
parameter_specification
[ IN | OUT | INOUT ] parameter_name data_type
language_and_access_specification
{ language_clause [ SQL_data_access ] |
  SQL_data_access [ language_clause ] |
  external_data_access
}
parameter_style_specification
PARAMETER STYLE { SQL | TD_GENERAL | JAVA }
code_specification
{ F delimiter function_entry_name |
  D |
  { S | C } path_specification
}
JAR_ID_specification
JAR_ID:java_class_name.java_method_name
  [ ( java_parameter_class [,...] ) returns java_parameter_class ]
data_type
{ INTEGER | SMALLINT | BIGINT | BYTEINT | DATE |

  { TIME | TIMESTAMP } [( fractional_seconds_precision)] [WITH TIME ZONE] |

  INTERVAL YEAR [( precision)] [TO MONTH] |

  INTERVAL MONTH [( precision)] |

  INTERVAL DAY [( precision)]
    [TO { HOUR | MINUTE | SECOND [(fractional_seconds_precision)] } ] |

  INTERVAL HOUR [(precision)]
    [TO { MINUTE | SECOND [(fractional_seconds_precision)] } ] |

  INTERVAL MINUTE [(precision)]
    [ TO SECOND [(fractional_seconds_precision)] ] |

  INTERVAL SECOND [ ( precision [, fractional_seconds_precision ] ) |

  PERIOD (DATE) |

  PERIOD ({ TIME | TIMESTAMP } [(precision)] [ WITH TIME ZONE ]) |

  REAL |

  DOUBLE PRECISION |

  FLOAT [(integer)] |

  NUMBER [({ integer | *} [, integer ]...)] |

  { DECIMAL | NUMERIC } [(integer [, integer ]...)] |

  { CHAR | BYTE | GRAPHIC } [(integer)] |

  { VARCHAR | CHAR VARYING | VARBYTE | VARGRAPHIC } [(integer)] |

  LONG VARCHAR |

  LONG VARGRAPHIC |

  { BINARY LARGE OBJECT | BLOB | CHARACTER LARGE OBJECT | CLOB } (integer [ G | K | M ]) |

  [SYSUDTLIB.] { XML | XMLTYPE } [(integer [ G | K | M ])] [ INLINE LENGTH integer ] |

  [SYSUDTLIB.] JSON [(integer [ K | M ])] [ INLINE LENGTH integer ]
    [ CHARACTER SET { UNICODE | LATIN } ] |

  [SYSUDTLIB.] ST_GEOMETRY [(integer [ K | M ])] [ INLINE LENGTH integer ] |

  [SYSUDTLIB.] DATASET [(integer [ K | M ])]
    [ INLINE LENGTH integer ] storage_format |

  [SYSUDTLIB.] { UDT_name | MBR | ARRAY_name | VARRAY_name }
}
path_specification
{ I delimiter name_on_server delimiter include_name |
  L delimiter library_name |
  O delimiter name_on_server delimiter object_name |
  P delimiter package_name |
  S delimiter name_on_server delimiter source_name |
  NS delimiter source_file delimiter include_file
}
java_parameter_class
{ primitive [] [ [] ]] | object [ [] ] }
You must type the colored or bold braces.
storage_format
STORAGE FORMAT { Avro | CSV [ CHARACTER SET { UNICODE | LATIN } ] }
  [ WITH SCHEMA [ database. ] schema_name ]