-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathHelpSession.ts
More file actions
28 lines (24 loc) · 823 Bytes
/
HelpSession.ts
File metadata and controls
28 lines (24 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2023 by Teradata Corporation. All rights reserved.
// This sample program demonstrates how to obtain and display session information.
// @ts-ignore
import * as teradatasql from "teradatasql";
type Row = any[] | null;
const con: teradatasql.TeradataConnection = teradatasql.connect({ host: "whomooz", user: "guest", password: "please" });
try {
const cur: teradatasql.TeradataCursor = con.cursor();
try {
cur.execute("help session");
const row: Row = cur.fetchone();
if (row) {
for (let i: number = 0; i < row.length; i++) {
if (cur.description) {
console.log(`${cur.description[i][0].padEnd(40)}, ${row[i]}`);
}
}
}
} finally {
cur.close();
}
} finally {
con.close();
}