-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoracharset.pas
More file actions
109 lines (100 loc) · 2.54 KB
/
oracharset.pas
File metadata and controls
109 lines (100 loc) · 2.54 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
program oracharset;
{ Shows client and server character set/NLS info}
{ PLEASE EDIT PASSWORDS ETC BELOW. }
{$mode objfpc}{$H+}
uses {$IFDEF UNIX} {$IFDEF UseCThreads}
cthreads, {$ENDIF} {$ENDIF}
Classes,
SysUtils,
sqldb,
oracleconnection;
var
Col: integer;
Conn: TOracleConnection;
Tran: TSQLTransaction;
Q: TSQLQuery;
begin
Conn := TOracleConnection.Create(nil);
Tran := TSQLTransaction.Create(nil);
Q := TSQLQuery.Create(nil);
try
// * EDIT IDENTIFYING INFO AS NEEDED*
Conn.HostName := 'hlbst02';
Conn.UserName := 'sysadm';
Conn.Password := 'sysadm';
Conn.DatabaseName := 'VASP';
// *END IDENTIFIYING INFO*
Conn.Transaction := Tran;
Q.DataBase := Conn;
Conn.Open;
Tran.Active := true;
(* Begin TEST nur so als Test*)
writeln('Tabelle F2FSV COUNT(*):');
Q.SQL.Text := 'SELECT COUNT(*) FROM F2FSV';
Q.Open;
Q.First;
while not (Q.EOF) do
begin
writeln('*****************');
for Col := 0 to Q.Fields.Count - 1 do
begin
try
writeln(Q.Fields[Col].DisplayLabel + ':');
writeln(Q.Fields[Col].AsString);
except
writeln('Error retrieving field ', Col);
end;
end;
Q.Next;
end;
Q.Close;
(* End TEST *)
writeln('Server character set info:');
Q.SQL.Text := 'SELECT value$ FROM sys.props$ WHERE name like ''NLS_%'' ';
Q.Open;
Q.First;
while not (Q.EOF) do
begin
writeln('*****************');
for Col := 0 to Q.Fields.Count - 1 do
begin
try
writeln(Q.Fields[Col].DisplayLabel + ':');
writeln(Q.Fields[Col].AsString);
except
writeln('Error retrieving field ', Col);
end;
end;
Q.Next;
end;
Q.Close;
writeln('');
writeln('Client character set info:');
Q.SQL.Text := 'SELECT * FROM NLS_SESSION_PARAMETERS ';
Q.Open;
Q.First;
while not (Q.EOF) do
begin
writeln('*****************');
for Col := 0 to Q.Fields.Count - 1 do
begin
try
writeln(Q.Fields[Col].DisplayLabel + ':');
writeln(Q.Fields[Col].AsString);
except
writeln('Error retrieving field ', Col);
end;
end;
Q.Next;
end;
Q.Close;
// *END EXAMPLE BUG TESTING CODE*
Conn.Close;
finally
Q.Free;
Tran.Free;
Conn.Free;
end;
writeln('Program complete. Press a key to continue.');
readln;
end.