-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ref
More file actions
36 lines (30 loc) · 764 Bytes
/
example.ref
File metadata and controls
36 lines (30 loc) · 764 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
29
30
31
32
33
34
35
36
*$FROM pq
$EXTERN
PQ-ConnectDB,
PQ-Status,
PQ-ErrorMessage,
PQ-Finish,
PQ-ExecFetch;
$ENTRY Go {
, <PQ-ConnectDB 'host=localhost port=5432 dbname=postgres user=postgres password=postgres'> : s.ConnNo
, <PQ-Status s.ConnNo>
: {
0
= <Prout 'Connected successfully'>
<FetchData s.ConnNo>
<PQ-Finish s.ConnNo>;
s.Status
= <Prout 'Connection failed with status code ' s.Status ': ' <PQ-ErrorMessage s.ConnNo>>
<PQ-Finish s.ConnNo>;
}
}
FetchData {
s.ConnNo
, <PQ-ExecFetch s.ConnNo 'select * from schema1.orders'>
: {
2 e.Tuples
= <Prout 'Fetched data: ' e.Tuples>;
0
= <Prout 'Fetch data failed: ' <PQ-ErrorMessage s.ConnNo>>;
};
}