skip to main content

Embedded SQL Statements : CALL

CALL
The CALL statement allows to invoke stored procedures.
General Format
Format 1
EXEC SQL [AT Database]
  CALL Procedure-Name ( [Parameters] ) [ INTO Host-Variable ]
Format 2
EXEC SQL [AT Database]
  [ Host-Variable = ] CALL Procedure-Name ( [Parameters] )
Syntax Rules
1.
2.
General Rules
1.
Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
2.
3.
Examples
Call a Database Stored Procedure that updates values on a totals table (the logic of the update is DB Server based and stored)
exec sql
  call update_totals()
Call a Database Stored Procedure with an input parameter and an output parameter, storing the result in a destination data item
exec sql
  call proc1(:p1 IN, :p2 OUT) into :exit-status

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left