"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const teradatasql_1 = require("teradatasql");
const con = new teradatasql_1.TeradataConnection();
con.connect({ host: "whomooz", user: "guest", password: "please" });
const cur = con.cursor();
const sTableName = "agkrdemo";
cur.execute("drop table " + sTableName, undefined, 3807);
cur.execute("create table " + sTableName + " (c1 integer generated by default as identity, c2 varchar(100))");
try {
    console.log("Using AGKR option C to return identity column values only");
    cur.execute("{fn teradata_agkr(C)}insert into " + sTableName + " (c2) select InfoKey from DBC.DBCInfo");
    console.log("All identity column values are returned in one result set");
    console.log(cur.fetchall());
    console.log("Using AGKR option R to return entire inserted rows");
    cur.execute("{fn teradata_agkr(R)}insert into " + sTableName + " (c2) select InfoData from DBC.DBCInfo");
    console.log("All inserted rows are returned in one result set");
    console.log(cur.fetchall());
    console.log("Final contents of table");
    cur.execute("select * from " + sTableName + " order by 1");
    console.log(cur.fetchall());
}
finally {
    cur.execute("drop table " + sTableName);
}
cur.close();
con.close();
//# sourceMappingURL=AGKRInsertSelect.js.map