File tree 16 files changed +1002
-22
lines changed
16 files changed +1002
-22
lines changed Original file line number Diff line number Diff line change @@ -809,5 +809,10 @@ Tue Feb 15 17:39:19 CET 2000
809
809
Wed Feb 16 11:57:02 CET 2000
810
810
811
811
- Fixed library to be able to input complete arrays.
812
+
813
+ Wed Feb 16 17:04:41 CET 2000
814
+
815
+ - Apply patch by Christof Petig <christof.petig@wtal.de> that adds
816
+ descriptors.
812
817
- Set library version to 3.1.0.
813
818
- Set ecpg version to 2.7.0.
Original file line number Diff line number Diff line change
1
+ descriptor statements have the following shortcomings
2
+
3
+ - up to now the only reasonable statement is
4
+ FETCH ... INTO SQL DESCRIPTOR <name>
5
+ no input variables allowed!
6
+
7
+ Reason: to fully support dynamic SQL the frontend/backend communication
8
+ should change to recognize input parameters.
9
+ Since this is not likely to happen in the near future and you
10
+ can cover the same functionality with the existing infrastructure
11
+ I'll leave the work to someone else.
12
+
13
+ - string buffer overflow does not always generate warnings
14
+ (beware: terminating 0 may be missing because strncpy is used)
15
+ :var=data sets sqlwarn accordingly (but not indicator)
16
+
17
+ - char variables pointing to NULL are not allocated on demand
18
+
19
+ - string truncation does not show up in indicator
20
+
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ cvariable for an array var
18
18
19
19
How can one insert arrays from c variables?
20
20
21
- support for dynamic SQL with unknown number of variables with DESCRIPTORS
22
-
23
21
What happens to the output variable during read if there was an
24
22
indicator-error?
25
23
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ install::
10
10
$(INSTALL ) $(INSTLOPTS ) ecpglib.h $(HEADERDIR )
11
11
$(INSTALL ) $(INSTLOPTS ) ecpgtype.h $(HEADERDIR )
12
12
$(INSTALL ) $(INSTLOPTS ) sqlca.h $(HEADERDIR )
13
+ $(INSTALL ) $(INSTLOPTS ) sql3types.h $(HEADERDIR )
13
14
14
15
uninstall ::
15
16
rm -f $(HEADERDIR ) /ecpgerrno.h
16
17
rm -f $(HEADERDIR ) /ecpglib.h
17
18
rm -f $(HEADERDIR ) /ecpgtype.h
18
19
rm -f $(HEADERDIR ) /sqlca.h
20
+ rm -f $(HEADERDIR ) /sql3types.h
19
21
20
22
dep depend :
Original file line number Diff line number Diff line change 29
29
30
30
#define ECPG_INVALID_STMT -230
31
31
32
+ /* dynamic SQL related */
33
+ #define ECPG_UNKNOWN_DESCRIPTOR -240
34
+ #define ECPG_INVALID_DESCRIPTOR_INDEX -241
35
+
32
36
/* finally the backend error messages, they start at 400 */
33
37
#define ECPG_PGSQL -400
34
38
#define ECPG_TRANS -401
Original file line number Diff line number Diff line change 1
1
#include <postgres.h>
2
+ #include <libpq-fe.h>
2
3
3
4
#ifdef __cplusplus
4
5
extern "C"
@@ -49,6 +50,17 @@ extern "C"
49
50
50
51
#define SQLCODE sqlca.sqlcode
51
52
53
+ /* dynamic SQL */
54
+
55
+ unsigned int ECPGDynamicType (Oid type );
56
+ unsigned int ECPGDynamicType_DDT (Oid type );
57
+ PGresult * ECPGresultByDescriptor (int line ,const char * name );
58
+ bool ECPGdo_descriptor (int line ,const char * connection ,
59
+ const char * descriptor ,const char * query );
60
+ bool ECPGdeallocate_desc (int line ,const char * name );
61
+ bool ECPGallocate_desc (int line ,const char * name );
62
+ void ECPGraise (int line ,int code );
63
+
52
64
#ifdef __cplusplus
53
65
}
54
66
Original file line number Diff line number Diff line change
1
+ /* SQL3 dynamic type codes
2
+ *
3
+ * Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
4
+ *
5
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.1 2000/02/16 16:18:03 meskes Exp $
6
+ */
7
+
8
+ /* chapter 13.1 table 2: Codes used for SQL data types in Dynamic SQL */
9
+
10
+ enum { SQL3_CHARACTER = 1 ,
11
+ SQL3_NUMERIC ,
12
+ SQL3_DECIMAL ,
13
+ SQL3_INTEGER ,
14
+ SQL3_SMALLINT ,
15
+ SQL3_FLOAT ,
16
+ SQL3_REAL ,
17
+ SQL3_DOUBLE_PRECISION ,
18
+ SQL3_DATE_TIME_TIMESTAMP ,
19
+ SQL3_INTERVAL , //10
20
+ SQL3_CHARACTER_VARYING = 12 ,
21
+ SQL3_ENUMERATED ,
22
+ SQL3_BIT ,
23
+ SQL3_BIT_VARYING ,
24
+ SQL3_BOOLEAN ,
25
+ SQL3_abstract
26
+ // the rest is xLOB stuff
27
+ };
28
+
29
+ /* chapter 13.1 table 3: Codes associated with datetime data types in Dynamic SQL */
30
+
31
+ enum { SQL3_DDT_DATE = 1 ,
32
+ SQL3_DDT_TIME ,
33
+ SQL3_DDT_TIMESTAMP ,
34
+ SQL3_DDT_TIME_WITH_TIME_ZONE ,
35
+ SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE ,
36
+
37
+ SQL3_DDT_ILLEGAL /* not a datetime data type (not part of standard) */
38
+ };
Original file line number Diff line number Diff line change 6
6
# Copyright (c) 1994, Regents of the University of California
7
7
#
8
8
# IDENTIFICATION
9
- # $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.57 2000/02/16 11:52:24 meskes Exp $
9
+ # $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.58 2000/02/16 16:18:05 meskes Exp $
10
10
#
11
11
# -------------------------------------------------------------------------
12
12
@@ -36,7 +36,7 @@ include $(SRCDIR)/Makefile.shlib
36
36
install : install-lib $(install-shlib-dep )
37
37
38
38
# Handmade dependencies in case make depend not done
39
- ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
39
+ ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h dynamic.c
40
40
typename.o : typename.c ../include/ecpgtype.h
41
41
42
42
You can’t perform that action at this time.
0 commit comments