Using ESQL/C to Begin Work Without Replication
The following example shows how to use to begin work without replication as well as update the Enterprise Replication shadow columns cdrserver and cdrtime:
MAIN (argc, argv)
INT argc;
CHAR *argv[];
{
EXEC SQL CHAR stmt[256];
EXEC SQL database mydatabase;
sprintf(stmt, “BEGIN WORK WITHOUT REPLICATION”);
EXEC SQL execute immediate :stmt;
EXEC SQL insert into mytable (col1, col2, ...)
values (value1, value2, ...);
EXEC SQL commit work;
}
Important: You must use the following
syntax when you issue the BEGIN WORK WITHOUT REPLICATION statement
from programs.
Do not use the ‘$' syntax.
sprintf(stmt, “BEGIN WORK WITHOUT REPLICATION”);
EXEC SQL execute immediate :stmt;