ruby-informix 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +14 -0
- data/README +7 -7
- data/informix.c +246 -231
- data/informix.ec +17 -9
- metadata +2 -2
data/Changelog
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
0.6.1 13/10/2007
|
2
|
+
------------------
|
3
|
+
Bugs fixed:
|
4
|
+
* Database#columns was returning an empty array from within the
|
5
|
+
Informix ActiveRecord adapter
|
6
|
+
(ActiveRecord::ConnectionAdapters::InformixAdapter#columns) if
|
7
|
+
called for different tables. This bug was raising the following
|
8
|
+
error in Ruby on Rails:
|
9
|
+
|
10
|
+
undefined method columname=
|
11
|
+
|
12
|
+
Noticed by Andr�s Rafael <aandresrafael at gmail dot com>
|
13
|
+
|
14
|
+
|
1
15
|
0.6.0 08/28/2007
|
2
16
|
------------------
|
3
17
|
New features:
|
data/README
CHANGED
@@ -18,9 +18,9 @@ Ruby/Informix has been tested succesfully on the following platforms:
|
|
18
18
|
|
19
19
|
Operating System Architecture Informix CSDK
|
20
20
|
-------------------------------------------------------------
|
21
|
-
Solaris 10
|
22
|
-
Solaris 10
|
23
|
-
Solaris 9
|
21
|
+
Solaris 10 SPARC64 11.10.UC1 3.00UC2
|
22
|
+
Solaris 10 SPARC64 9.40FC6 3.00UC2
|
23
|
+
Solaris 9 SPARC64 9.40FC6 2.90UC3
|
24
24
|
Fedora Core 5 x86 10.00.UC3R1 2.90UC4
|
25
25
|
Fedora Core 4 x86 10.00.UC3R1 2.90UC4
|
26
26
|
SuSE Linux 9.3 x86 9.30TC1 2.90UC4
|
@@ -65,9 +65,8 @@ Objects (CLOB/BLOB).
|
|
65
65
|
|
66
66
|
* use #drop for prepared statements and cursors or use them with blocks,
|
67
67
|
to release Informix resources.
|
68
|
-
* you can optimize cursor execution by changing the fetch and insert
|
69
|
-
setting the environment variable FET_BUF_SIZE to up to 32767
|
70
|
-
or BIG_FET_BUF_SIZE for Informix 10.x
|
68
|
+
* you can optimize cursor execution by changing the size of fetch and insert
|
69
|
+
buffers, setting the environment variable FET_BUF_SIZE to up to 32767.
|
71
70
|
|
72
71
|
|
73
72
|
5. Caveats
|
@@ -77,7 +76,8 @@ Objects (CLOB/BLOB).
|
|
77
76
|
6. Support
|
78
77
|
|
79
78
|
Feel free to send me bug reports, feature requests, comments, patches or
|
80
|
-
questions to my mailbox or Ruby/Informix's forums at
|
79
|
+
questions to my mailbox or Ruby/Informix's forums and mailing list at
|
80
|
+
Rubyforge (http://rubyforge.org/projects/ruby-informix/)
|
81
81
|
|
82
82
|
|
83
83
|
-----------------------------------------
|
data/informix.c
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#include <sqlhdr.h>
|
2
2
|
#include <sqliapi.h>
|
3
3
|
#line 1 "informix.ec"
|
4
|
-
/* $Id: informix.ec,v 1.
|
4
|
+
/* $Id: informix.ec,v 1.12 2007/10/14 00:18:50 santana Exp $ */
|
5
5
|
/*
|
6
6
|
* Copyright (c) 2006-2007, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
7
7
|
* All rights reserved.
|
@@ -31,7 +31,7 @@
|
|
31
31
|
* POSSIBILITY OF SUCH DAMAGE.
|
32
32
|
*/
|
33
33
|
|
34
|
-
static const char rcsid[] = "$Id: informix.ec,v 1.
|
34
|
+
static const char rcsid[] = "$Id: informix.ec,v 1.12 2007/10/14 00:18:50 santana Exp $";
|
35
35
|
|
36
36
|
#include "ruby.h"
|
37
37
|
#include "ifx_except.h"
|
@@ -2018,7 +2018,7 @@ rb_informix_connect(int argc, VALUE *argv, VALUE self)
|
|
2018
2018
|
*/
|
2019
2019
|
static VALUE rb_informix_version(void)
|
2020
2020
|
{
|
2021
|
-
static const char * const ver = "0.6.
|
2021
|
+
static const char * const ver = "0.6.1";
|
2022
2022
|
static VALUE driver_version;
|
2023
2023
|
|
2024
2024
|
if (driver_version == 0)
|
@@ -2614,39 +2614,46 @@ static ifx_cursor_t _SQ0 = {0};
|
|
2614
2614
|
result = rb_ary_new();
|
2615
2615
|
|
2616
2616
|
cid = did + IDSIZE;
|
2617
|
+
|
2617
2618
|
if (!*cid) {
|
2618
|
-
snprintf(cid, IDSIZE, "COLS%lX", self);
|
2619
2619
|
/*
|
2620
|
-
* EXEC SQL declare
|
2621
|
-
|
2620
|
+
* EXEC SQL begin declare section;
|
2621
|
+
*/
|
2622
|
+
#line 2149 "informix.ec"
|
2623
|
+
#line 2150 "informix.ec"
|
2624
|
+
char sid[IDSIZE];
|
2625
|
+
/*
|
2626
|
+
* EXEC SQL end declare section;
|
2627
|
+
*/
|
2628
|
+
#line 2151 "informix.ec"
|
2629
|
+
|
2630
|
+
|
2631
|
+
snprintf(sid, IDSIZE, "COLS%lX", self);
|
2632
|
+
snprintf(cid, IDSIZE, "COLC%lX", self);
|
2633
|
+
|
2634
|
+
/*
|
2635
|
+
* EXEC SQL prepare :sid from
|
2636
|
+
* 'select colname, coltype, collength, extended_id,
|
2622
2637
|
* type, default, c.colno
|
2623
2638
|
* from syscolumns c, outer sysdefaults d
|
2624
|
-
* where c.tabid =
|
2639
|
+
* where c.tabid = ? and c.tabid = d.tabid
|
2625
2640
|
* and c.colno = d.colno
|
2626
|
-
* order by c.colno;
|
2641
|
+
* order by c.colno';
|
2627
2642
|
*/
|
2628
|
-
#line
|
2643
|
+
#line 2156 "informix.ec"
|
2629
2644
|
{
|
2630
|
-
#line
|
2631
|
-
|
2632
|
-
#line
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
#line 2155 "informix.ec"
|
2643
|
-
};
|
2644
|
-
static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
|
2645
|
-
#line 2155 "informix.ec"
|
2646
|
-
_sqibind[0].sqldata = (char *) &tabid;
|
2647
|
-
#line 2155 "informix.ec"
|
2648
|
-
sqli_curs_decl_stat(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqlcmdtxt, &_SD0, (ifx_sqlda_t *)0, 0, (ifx_literal_t *)0, (ifx_namelist_t *)0, 2, 0, 0);
|
2649
|
-
#line 2155 "informix.ec"
|
2645
|
+
#line 2162 "informix.ec"
|
2646
|
+
sqli_prep(ESQLINTVERSION, sid, "select colname, coltype, collength, extended_id, type, default, c.colno from syscolumns c, outer sysdefaults d where c.tabid = ? and c.tabid = d.tabid and c.colno = d.colno order by c.colno",(ifx_literal_t *)0, (ifx_namelist_t *)0, 2, 0, 0 );
|
2647
|
+
#line 2162 "informix.ec"
|
2648
|
+
}
|
2649
|
+
/*
|
2650
|
+
* EXEC SQL declare :cid cursor for :sid;
|
2651
|
+
*/
|
2652
|
+
#line 2163 "informix.ec"
|
2653
|
+
{
|
2654
|
+
#line 2163 "informix.ec"
|
2655
|
+
sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqli_curs_locate(ESQLINTVERSION, sid, 1), 0, 0);
|
2656
|
+
#line 2163 "informix.ec"
|
2650
2657
|
}
|
2651
2658
|
if (SQLCODE < 0) {
|
2652
2659
|
cid[0] = 0;
|
@@ -2655,13 +2662,21 @@ sqli_curs_decl_stat(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), ci
|
|
2655
2662
|
}
|
2656
2663
|
|
2657
2664
|
/*
|
2658
|
-
* EXEC SQL open :cid;
|
2665
|
+
* EXEC SQL open :cid using :tabid;
|
2659
2666
|
*/
|
2660
|
-
#line
|
2667
|
+
#line 2170 "informix.ec"
|
2661
2668
|
{
|
2662
|
-
#line
|
2663
|
-
|
2664
|
-
|
2669
|
+
#line 2170 "informix.ec"
|
2670
|
+
static ifx_sqlvar_t _sqibind[] =
|
2671
|
+
{
|
2672
|
+
{ 102, sizeof(tabid), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
2673
|
+
#line 2170 "informix.ec"
|
2674
|
+
};
|
2675
|
+
static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
|
2676
|
+
#line 2170 "informix.ec"
|
2677
|
+
_sqibind[0].sqldata = (char *) &tabid;
|
2678
|
+
sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), &_SD0, (char *)0, (struct value *)0, 1, 0);
|
2679
|
+
#line 2170 "informix.ec"
|
2665
2680
|
}
|
2666
2681
|
if (SQLCODE < 0)
|
2667
2682
|
raise_ifx_extended();
|
@@ -2671,9 +2686,9 @@ sqli_curs_decl_stat(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), ci
|
|
2671
2686
|
* EXEC SQL fetch :cid into :colname, :coltype, :collength, :xid,
|
2672
2687
|
* :deftype, :defvalue;
|
2673
2688
|
*/
|
2674
|
-
#line
|
2689
|
+
#line 2175 "informix.ec"
|
2675
2690
|
{
|
2676
|
-
#line
|
2691
|
+
#line 2176 "informix.ec"
|
2677
2692
|
static ifx_sqlvar_t _sqobind[] =
|
2678
2693
|
{
|
2679
2694
|
{ 114, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
@@ -2682,24 +2697,24 @@ sqli_curs_decl_stat(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), ci
|
|
2682
2697
|
{ 102, sizeof(xid), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
2683
2698
|
{ 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
2684
2699
|
{ 114, 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
2685
|
-
#line
|
2700
|
+
#line 2176 "informix.ec"
|
2686
2701
|
};
|
2687
2702
|
static ifx_sqlda_t _SD0 = { 6, _sqobind, {0}, 6, 0 };
|
2688
2703
|
static _FetchSpec _FS1 = { 0, 1, 0 };
|
2689
|
-
#line
|
2704
|
+
#line 2176 "informix.ec"
|
2690
2705
|
_sqobind[0].sqldata = colname;
|
2691
|
-
#line
|
2706
|
+
#line 2176 "informix.ec"
|
2692
2707
|
_sqobind[1].sqldata = (char *) &coltype;
|
2693
|
-
#line
|
2708
|
+
#line 2176 "informix.ec"
|
2694
2709
|
_sqobind[2].sqldata = (char *) &collength;
|
2695
|
-
#line
|
2710
|
+
#line 2176 "informix.ec"
|
2696
2711
|
_sqobind[3].sqldata = (char *) &xid;
|
2697
|
-
#line
|
2712
|
+
#line 2176 "informix.ec"
|
2698
2713
|
_sqobind[4].sqldata = deftype;
|
2699
|
-
#line
|
2714
|
+
#line 2176 "informix.ec"
|
2700
2715
|
_sqobind[5].sqldata = defvalue;
|
2701
2716
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, &_SD0, (char *)0, &_FS1);
|
2702
|
-
#line
|
2717
|
+
#line 2176 "informix.ec"
|
2703
2718
|
}
|
2704
2719
|
if (SQLCODE < 0)
|
2705
2720
|
raise_ifx_extended();
|
@@ -2797,11 +2812,11 @@ sqli_curs_decl_stat(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), ci
|
|
2797
2812
|
/*
|
2798
2813
|
* EXEC SQL close :cid;
|
2799
2814
|
*/
|
2800
|
-
#line
|
2815
|
+
#line 2270 "informix.ec"
|
2801
2816
|
{
|
2802
|
-
#line
|
2817
|
+
#line 2270 "informix.ec"
|
2803
2818
|
sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256));
|
2804
|
-
#line
|
2819
|
+
#line 2270 "informix.ec"
|
2805
2820
|
}
|
2806
2821
|
|
2807
2822
|
return result;
|
@@ -2827,13 +2842,13 @@ statement_free(void *p)
|
|
2827
2842
|
/*
|
2828
2843
|
* EXEC SQL begin declare section;
|
2829
2844
|
*/
|
2830
|
-
#line
|
2831
|
-
#line
|
2845
|
+
#line 2292 "informix.ec"
|
2846
|
+
#line 2293 "informix.ec"
|
2832
2847
|
char *sid, *did;
|
2833
2848
|
/*
|
2834
2849
|
* EXEC SQL end declare section;
|
2835
2850
|
*/
|
2836
|
-
#line
|
2851
|
+
#line 2294 "informix.ec"
|
2837
2852
|
|
2838
2853
|
|
2839
2854
|
free_input_slots(p);
|
@@ -2843,22 +2858,22 @@ statement_free(void *p)
|
|
2843
2858
|
/*
|
2844
2859
|
* EXEC SQL set connection :did;
|
2845
2860
|
*/
|
2846
|
-
#line
|
2861
|
+
#line 2300 "informix.ec"
|
2847
2862
|
{
|
2848
|
-
#line
|
2863
|
+
#line 2300 "informix.ec"
|
2849
2864
|
sqli_connect_set(0, did, 0);
|
2850
|
-
#line
|
2865
|
+
#line 2300 "informix.ec"
|
2851
2866
|
}
|
2852
2867
|
if (SQLCODE >= 0) {
|
2853
2868
|
sid = ((cursor_t *)p)->stmt_id;
|
2854
2869
|
/*
|
2855
2870
|
* EXEC SQL free :sid;
|
2856
2871
|
*/
|
2857
|
-
#line
|
2872
|
+
#line 2303 "informix.ec"
|
2858
2873
|
{
|
2859
|
-
#line
|
2874
|
+
#line 2303 "informix.ec"
|
2860
2875
|
sqli_curs_free(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 258));
|
2861
|
-
#line
|
2876
|
+
#line 2303 "informix.ec"
|
2862
2877
|
}
|
2863
2878
|
}
|
2864
2879
|
|
@@ -2883,24 +2898,24 @@ statement_initialize(VALUE self, VALUE db, VALUE query)
|
|
2883
2898
|
/*
|
2884
2899
|
* EXEC SQL begin declare section;
|
2885
2900
|
*/
|
2886
|
-
#line
|
2887
|
-
#line
|
2901
|
+
#line 2324 "informix.ec"
|
2902
|
+
#line 2325 "informix.ec"
|
2888
2903
|
char *c_query, *sid, *did;
|
2889
2904
|
/*
|
2890
2905
|
* EXEC SQL end declare section;
|
2891
2906
|
*/
|
2892
|
-
#line
|
2907
|
+
#line 2326 "informix.ec"
|
2893
2908
|
|
2894
2909
|
|
2895
2910
|
Data_Get_Struct(db, char, did);
|
2896
2911
|
/*
|
2897
2912
|
* EXEC SQL set connection :did;
|
2898
2913
|
*/
|
2899
|
-
#line
|
2914
|
+
#line 2329 "informix.ec"
|
2900
2915
|
{
|
2901
|
-
#line
|
2916
|
+
#line 2329 "informix.ec"
|
2902
2917
|
sqli_connect_set(0, did, 0);
|
2903
|
-
#line
|
2918
|
+
#line 2329 "informix.ec"
|
2904
2919
|
}
|
2905
2920
|
if (SQLCODE < 0)
|
2906
2921
|
raise_ifx_extended();
|
@@ -2916,11 +2931,11 @@ statement_initialize(VALUE self, VALUE db, VALUE query)
|
|
2916
2931
|
/*
|
2917
2932
|
* EXEC SQL prepare :sid from :c_query;
|
2918
2933
|
*/
|
2919
|
-
#line
|
2934
|
+
#line 2341 "informix.ec"
|
2920
2935
|
{
|
2921
|
-
#line
|
2936
|
+
#line 2341 "informix.ec"
|
2922
2937
|
sqli_prep(ESQLINTVERSION, sid, c_query,(ifx_literal_t *)0, (ifx_namelist_t *)0, -1, 0, 0 );
|
2923
|
-
#line
|
2938
|
+
#line 2341 "informix.ec"
|
2924
2939
|
}
|
2925
2940
|
if (SQLCODE < 0)
|
2926
2941
|
raise_ifx_extended();
|
@@ -2929,11 +2944,11 @@ statement_initialize(VALUE self, VALUE db, VALUE query)
|
|
2929
2944
|
/*
|
2930
2945
|
* EXEC SQL describe :sid into output;
|
2931
2946
|
*/
|
2932
|
-
#line
|
2947
|
+
#line 2346 "informix.ec"
|
2933
2948
|
{
|
2934
|
-
#line
|
2949
|
+
#line 2346 "informix.ec"
|
2935
2950
|
sqli_describe_stmt(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), &output, 0);
|
2936
|
-
#line
|
2951
|
+
#line 2346 "informix.ec"
|
2937
2952
|
}
|
2938
2953
|
c->daOutput = output;
|
2939
2954
|
|
@@ -2997,13 +3012,13 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
2997
3012
|
/*
|
2998
3013
|
* EXEC SQL begin declare section;
|
2999
3014
|
*/
|
3000
|
-
#line
|
3001
|
-
#line
|
3015
|
+
#line 2406 "informix.ec"
|
3016
|
+
#line 2407 "informix.ec"
|
3002
3017
|
char *sid, *did;
|
3003
3018
|
/*
|
3004
3019
|
* EXEC SQL end declare section;
|
3005
3020
|
*/
|
3006
|
-
#line
|
3021
|
+
#line 2408 "informix.ec"
|
3007
3022
|
|
3008
3023
|
|
3009
3024
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -3012,11 +3027,11 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
3012
3027
|
/*
|
3013
3028
|
* EXEC SQL set connection :did;
|
3014
3029
|
*/
|
3015
|
-
#line
|
3030
|
+
#line 2413 "informix.ec"
|
3016
3031
|
{
|
3017
|
-
#line
|
3032
|
+
#line 2413 "informix.ec"
|
3018
3033
|
sqli_connect_set(0, did, 0);
|
3019
|
-
#line
|
3034
|
+
#line 2413 "informix.ec"
|
3020
3035
|
}
|
3021
3036
|
if (SQLCODE < 0)
|
3022
3037
|
raise_ifx_extended();
|
@@ -3036,11 +3051,11 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
3036
3051
|
* EXEC SQL execute :sid into descriptor output
|
3037
3052
|
* using descriptor input;
|
3038
3053
|
*/
|
3039
|
-
#line
|
3054
|
+
#line 2428 "informix.ec"
|
3040
3055
|
{
|
3041
|
-
#line
|
3056
|
+
#line 2429 "informix.ec"
|
3042
3057
|
sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), input, (char *)0, (struct value *)0, output, (char *)0, (struct value *)0, 0);
|
3043
|
-
#line
|
3058
|
+
#line 2429 "informix.ec"
|
3044
3059
|
}
|
3045
3060
|
clean_input_slots(c);
|
3046
3061
|
}
|
@@ -3048,11 +3063,11 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
3048
3063
|
/*
|
3049
3064
|
* EXEC SQL execute :sid into descriptor output;
|
3050
3065
|
*/
|
3051
|
-
#line
|
3066
|
+
#line 2433 "informix.ec"
|
3052
3067
|
{
|
3053
|
-
#line
|
3068
|
+
#line 2433 "informix.ec"
|
3054
3069
|
sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, output, (char *)0, (struct value *)0, 0);
|
3055
|
-
#line
|
3070
|
+
#line 2433 "informix.ec"
|
3056
3071
|
}
|
3057
3072
|
|
3058
3073
|
if (SQLCODE < 0)
|
@@ -3068,11 +3083,11 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
3068
3083
|
/*
|
3069
3084
|
* EXEC SQL execute :sid using descriptor input;
|
3070
3085
|
*/
|
3071
|
-
#line
|
3086
|
+
#line 2445 "informix.ec"
|
3072
3087
|
{
|
3073
|
-
#line
|
3088
|
+
#line 2445 "informix.ec"
|
3074
3089
|
sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), input, (char *)0, (struct value *)0, (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0);
|
3075
|
-
#line
|
3090
|
+
#line 2445 "informix.ec"
|
3076
3091
|
}
|
3077
3092
|
clean_input_slots(c);
|
3078
3093
|
}
|
@@ -3080,11 +3095,11 @@ statement_call(int argc, VALUE *argv, VALUE self)
|
|
3080
3095
|
/*
|
3081
3096
|
* EXEC SQL execute :sid;
|
3082
3097
|
*/
|
3083
|
-
#line
|
3098
|
+
#line 2449 "informix.ec"
|
3084
3099
|
{
|
3085
|
-
#line
|
3100
|
+
#line 2449 "informix.ec"
|
3086
3101
|
sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0);
|
3087
|
-
#line
|
3102
|
+
#line 2449 "informix.ec"
|
3088
3103
|
}
|
3089
3104
|
}
|
3090
3105
|
if (SQLCODE < 0)
|
@@ -3106,13 +3121,13 @@ statement_drop(VALUE self)
|
|
3106
3121
|
/*
|
3107
3122
|
* EXEC SQL begin declare section;
|
3108
3123
|
*/
|
3109
|
-
#line
|
3110
|
-
#line
|
3124
|
+
#line 2467 "informix.ec"
|
3125
|
+
#line 2468 "informix.ec"
|
3111
3126
|
char *sid, *did;
|
3112
3127
|
/*
|
3113
3128
|
* EXEC SQL end declare section;
|
3114
3129
|
*/
|
3115
|
-
#line
|
3130
|
+
#line 2469 "informix.ec"
|
3116
3131
|
|
3117
3132
|
|
3118
3133
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -3123,11 +3138,11 @@ statement_drop(VALUE self)
|
|
3123
3138
|
/*
|
3124
3139
|
* EXEC SQL set connection :did;
|
3125
3140
|
*/
|
3126
|
-
#line
|
3141
|
+
#line 2476 "informix.ec"
|
3127
3142
|
{
|
3128
|
-
#line
|
3143
|
+
#line 2476 "informix.ec"
|
3129
3144
|
sqli_connect_set(0, did, 0);
|
3130
|
-
#line
|
3145
|
+
#line 2476 "informix.ec"
|
3131
3146
|
}
|
3132
3147
|
if (SQLCODE < 0)
|
3133
3148
|
return Qnil;
|
@@ -3135,11 +3150,11 @@ statement_drop(VALUE self)
|
|
3135
3150
|
/*
|
3136
3151
|
* EXEC SQL free :sid;
|
3137
3152
|
*/
|
3138
|
-
#line
|
3153
|
+
#line 2480 "informix.ec"
|
3139
3154
|
{
|
3140
|
-
#line
|
3155
|
+
#line 2480 "informix.ec"
|
3141
3156
|
sqli_curs_free(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 258));
|
3142
|
-
#line
|
3157
|
+
#line 2480 "informix.ec"
|
3143
3158
|
}
|
3144
3159
|
|
3145
3160
|
return Qnil;
|
@@ -3181,13 +3196,13 @@ fetch(VALUE self, VALUE type, int bang)
|
|
3181
3196
|
/*
|
3182
3197
|
* EXEC SQL begin declare section;
|
3183
3198
|
*/
|
3184
|
-
#line
|
3185
|
-
#line
|
3199
|
+
#line 2518 "informix.ec"
|
3200
|
+
#line 2519 "informix.ec"
|
3186
3201
|
char *cid, *did;
|
3187
3202
|
/*
|
3188
3203
|
* EXEC SQL end declare section;
|
3189
3204
|
*/
|
3190
|
-
#line
|
3205
|
+
#line 2520 "informix.ec"
|
3191
3206
|
|
3192
3207
|
cursor_t *c;
|
3193
3208
|
struct sqlda *output;
|
@@ -3201,11 +3216,11 @@ fetch(VALUE self, VALUE type, int bang)
|
|
3201
3216
|
/*
|
3202
3217
|
* EXEC SQL set connection :did;
|
3203
3218
|
*/
|
3204
|
-
#line
|
3219
|
+
#line 2530 "informix.ec"
|
3205
3220
|
{
|
3206
|
-
#line
|
3221
|
+
#line 2530 "informix.ec"
|
3207
3222
|
sqli_connect_set(0, did, 0);
|
3208
|
-
#line
|
3223
|
+
#line 2530 "informix.ec"
|
3209
3224
|
}
|
3210
3225
|
if (SQLCODE < 0)
|
3211
3226
|
raise_ifx_extended();
|
@@ -3216,12 +3231,12 @@ fetch(VALUE self, VALUE type, int bang)
|
|
3216
3231
|
/*
|
3217
3232
|
* EXEC SQL fetch :cid using descriptor output;
|
3218
3233
|
*/
|
3219
|
-
#line
|
3234
|
+
#line 2537 "informix.ec"
|
3220
3235
|
{
|
3221
|
-
#line
|
3236
|
+
#line 2537 "informix.ec"
|
3222
3237
|
static _FetchSpec _FS0 = { 0, 1, 0 };
|
3223
3238
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, output, (char *)0, &_FS0);
|
3224
|
-
#line
|
3239
|
+
#line 2537 "informix.ec"
|
3225
3240
|
}
|
3226
3241
|
if (SQLCODE < 0)
|
3227
3242
|
raise_ifx_extended();
|
@@ -3304,13 +3319,13 @@ fetch_many(VALUE self, VALUE n, VALUE type)
|
|
3304
3319
|
/*
|
3305
3320
|
* EXEC SQL begin declare section;
|
3306
3321
|
*/
|
3307
|
-
#line
|
3308
|
-
#line
|
3322
|
+
#line 2616 "informix.ec"
|
3323
|
+
#line 2617 "informix.ec"
|
3309
3324
|
char *cid, *did;
|
3310
3325
|
/*
|
3311
3326
|
* EXEC SQL end declare section;
|
3312
3327
|
*/
|
3313
|
-
#line
|
3328
|
+
#line 2618 "informix.ec"
|
3314
3329
|
|
3315
3330
|
cursor_t *c;
|
3316
3331
|
struct sqlda *output;
|
@@ -3326,11 +3341,11 @@ fetch_many(VALUE self, VALUE n, VALUE type)
|
|
3326
3341
|
/*
|
3327
3342
|
* EXEC SQL set connection :did;
|
3328
3343
|
*/
|
3329
|
-
#line
|
3344
|
+
#line 2630 "informix.ec"
|
3330
3345
|
{
|
3331
|
-
#line
|
3346
|
+
#line 2630 "informix.ec"
|
3332
3347
|
sqli_connect_set(0, did, 0);
|
3333
|
-
#line
|
3348
|
+
#line 2630 "informix.ec"
|
3334
3349
|
}
|
3335
3350
|
if (SQLCODE < 0)
|
3336
3351
|
raise_ifx_extended();
|
@@ -3350,12 +3365,12 @@ fetch_many(VALUE self, VALUE n, VALUE type)
|
|
3350
3365
|
/*
|
3351
3366
|
* EXEC SQL fetch :cid using descriptor output;
|
3352
3367
|
*/
|
3353
|
-
#line
|
3368
|
+
#line 2646 "informix.ec"
|
3354
3369
|
{
|
3355
|
-
#line
|
3370
|
+
#line 2646 "informix.ec"
|
3356
3371
|
static _FetchSpec _FS0 = { 0, 1, 0 };
|
3357
3372
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, output, (char *)0, &_FS0);
|
3358
|
-
#line
|
3373
|
+
#line 2646 "informix.ec"
|
3359
3374
|
}
|
3360
3375
|
if (SQLCODE < 0)
|
3361
3376
|
raise_ifx_extended();
|
@@ -3434,13 +3449,13 @@ each(VALUE self, VALUE type, int bang)
|
|
3434
3449
|
/*
|
3435
3450
|
* EXEC SQL begin declare section;
|
3436
3451
|
*/
|
3437
|
-
#line
|
3438
|
-
#line
|
3452
|
+
#line 2721 "informix.ec"
|
3453
|
+
#line 2722 "informix.ec"
|
3439
3454
|
char *cid, *did;
|
3440
3455
|
/*
|
3441
3456
|
* EXEC SQL end declare section;
|
3442
3457
|
*/
|
3443
|
-
#line
|
3458
|
+
#line 2723 "informix.ec"
|
3444
3459
|
|
3445
3460
|
struct sqlda *output;
|
3446
3461
|
VALUE record;
|
@@ -3453,11 +3468,11 @@ each(VALUE self, VALUE type, int bang)
|
|
3453
3468
|
/*
|
3454
3469
|
* EXEC SQL set connection :did;
|
3455
3470
|
*/
|
3456
|
-
#line
|
3471
|
+
#line 2732 "informix.ec"
|
3457
3472
|
{
|
3458
|
-
#line
|
3473
|
+
#line 2732 "informix.ec"
|
3459
3474
|
sqli_connect_set(0, did, 0);
|
3460
|
-
#line
|
3475
|
+
#line 2732 "informix.ec"
|
3461
3476
|
}
|
3462
3477
|
if (SQLCODE < 0)
|
3463
3478
|
raise_ifx_extended();
|
@@ -3469,12 +3484,12 @@ each(VALUE self, VALUE type, int bang)
|
|
3469
3484
|
/*
|
3470
3485
|
* EXEC SQL fetch :cid using descriptor output;
|
3471
3486
|
*/
|
3472
|
-
#line
|
3487
|
+
#line 2740 "informix.ec"
|
3473
3488
|
{
|
3474
|
-
#line
|
3489
|
+
#line 2740 "informix.ec"
|
3475
3490
|
static _FetchSpec _FS0 = { 0, 1, 0 };
|
3476
3491
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, output, (char *)0, &_FS0);
|
3477
|
-
#line
|
3492
|
+
#line 2740 "informix.ec"
|
3478
3493
|
}
|
3479
3494
|
if (SQLCODE < 0)
|
3480
3495
|
raise_ifx_extended();
|
@@ -3613,13 +3628,13 @@ inscur_put(int argc, VALUE *argv, VALUE self)
|
|
3613
3628
|
/*
|
3614
3629
|
* EXEC SQL begin declare section;
|
3615
3630
|
*/
|
3616
|
-
#line
|
3617
|
-
#line
|
3631
|
+
#line 2875 "informix.ec"
|
3632
|
+
#line 2876 "informix.ec"
|
3618
3633
|
char *cid, *did;
|
3619
3634
|
/*
|
3620
3635
|
* EXEC SQL end declare section;
|
3621
3636
|
*/
|
3622
|
-
#line
|
3637
|
+
#line 2877 "informix.ec"
|
3623
3638
|
|
3624
3639
|
|
3625
3640
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -3630,11 +3645,11 @@ inscur_put(int argc, VALUE *argv, VALUE self)
|
|
3630
3645
|
/*
|
3631
3646
|
* EXEC SQL set connection :did;
|
3632
3647
|
*/
|
3633
|
-
#line
|
3648
|
+
#line 2884 "informix.ec"
|
3634
3649
|
{
|
3635
|
-
#line
|
3650
|
+
#line 2884 "informix.ec"
|
3636
3651
|
sqli_connect_set(0, did, 0);
|
3637
|
-
#line
|
3652
|
+
#line 2884 "informix.ec"
|
3638
3653
|
}
|
3639
3654
|
if (SQLCODE < 0)
|
3640
3655
|
raise_ifx_extended();
|
@@ -3650,11 +3665,11 @@ inscur_put(int argc, VALUE *argv, VALUE self)
|
|
3650
3665
|
/*
|
3651
3666
|
* EXEC SQL put :cid using descriptor input;
|
3652
3667
|
*/
|
3653
|
-
#line
|
3668
|
+
#line 2896 "informix.ec"
|
3654
3669
|
{
|
3655
|
-
#line
|
3670
|
+
#line 2896 "informix.ec"
|
3656
3671
|
sqli_curs_put(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), input, (char *)0);
|
3657
|
-
#line
|
3672
|
+
#line 2896 "informix.ec"
|
3658
3673
|
}
|
3659
3674
|
clean_input_slots(c);
|
3660
3675
|
if (SQLCODE < 0)
|
@@ -3679,13 +3694,13 @@ inscur_flush(VALUE self)
|
|
3679
3694
|
/*
|
3680
3695
|
* EXEC SQL begin declare section;
|
3681
3696
|
*/
|
3682
|
-
#line
|
3683
|
-
#line
|
3697
|
+
#line 2917 "informix.ec"
|
3698
|
+
#line 2918 "informix.ec"
|
3684
3699
|
char *cid, *did;
|
3685
3700
|
/*
|
3686
3701
|
* EXEC SQL end declare section;
|
3687
3702
|
*/
|
3688
|
-
#line
|
3703
|
+
#line 2919 "informix.ec"
|
3689
3704
|
|
3690
3705
|
|
3691
3706
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -3696,11 +3711,11 @@ inscur_flush(VALUE self)
|
|
3696
3711
|
/*
|
3697
3712
|
* EXEC SQL set connection :did;
|
3698
3713
|
*/
|
3699
|
-
#line
|
3714
|
+
#line 2926 "informix.ec"
|
3700
3715
|
{
|
3701
|
-
#line
|
3716
|
+
#line 2926 "informix.ec"
|
3702
3717
|
sqli_connect_set(0, did, 0);
|
3703
|
-
#line
|
3718
|
+
#line 2926 "informix.ec"
|
3704
3719
|
}
|
3705
3720
|
if (SQLCODE < 0)
|
3706
3721
|
raise_ifx_extended();
|
@@ -3709,11 +3724,11 @@ inscur_flush(VALUE self)
|
|
3709
3724
|
/*
|
3710
3725
|
* EXEC SQL flush :cid;
|
3711
3726
|
*/
|
3712
|
-
#line
|
3727
|
+
#line 2931 "informix.ec"
|
3713
3728
|
{
|
3714
|
-
#line
|
3729
|
+
#line 2931 "informix.ec"
|
3715
3730
|
sqli_curs_flush(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256));
|
3716
|
-
#line
|
3731
|
+
#line 2931 "informix.ec"
|
3717
3732
|
}
|
3718
3733
|
return self;
|
3719
3734
|
}
|
@@ -3733,14 +3748,14 @@ scrollcur_entry(VALUE self, VALUE index, VALUE type, int bang)
|
|
3733
3748
|
/*
|
3734
3749
|
* EXEC SQL begin declare section;
|
3735
3750
|
*/
|
3736
|
-
#line
|
3737
|
-
#line
|
3751
|
+
#line 2947 "informix.ec"
|
3752
|
+
#line 2948 "informix.ec"
|
3738
3753
|
char *cid, *did;
|
3739
3754
|
long pos;
|
3740
3755
|
/*
|
3741
3756
|
* EXEC SQL end declare section;
|
3742
3757
|
*/
|
3743
|
-
#line
|
3758
|
+
#line 2950 "informix.ec"
|
3744
3759
|
|
3745
3760
|
|
3746
3761
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -3751,11 +3766,11 @@ long pos;
|
|
3751
3766
|
/*
|
3752
3767
|
* EXEC SQL set connection :did;
|
3753
3768
|
*/
|
3754
|
-
#line
|
3769
|
+
#line 2957 "informix.ec"
|
3755
3770
|
{
|
3756
|
-
#line
|
3771
|
+
#line 2957 "informix.ec"
|
3757
3772
|
sqli_connect_set(0, did, 0);
|
3758
|
-
#line
|
3773
|
+
#line 2957 "informix.ec"
|
3759
3774
|
}
|
3760
3775
|
if (SQLCODE < 0)
|
3761
3776
|
return Qnil;
|
@@ -3767,60 +3782,60 @@ long pos;
|
|
3767
3782
|
/*
|
3768
3783
|
* EXEC SQL fetch current :cid using descriptor output;
|
3769
3784
|
*/
|
3770
|
-
#line
|
3785
|
+
#line 2965 "informix.ec"
|
3771
3786
|
{
|
3772
|
-
#line
|
3787
|
+
#line 2965 "informix.ec"
|
3773
3788
|
static _FetchSpec _FS0 = { 0, 5, 0 };
|
3774
3789
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, output, (char *)0, &_FS0);
|
3775
|
-
#line
|
3790
|
+
#line 2965 "informix.ec"
|
3776
3791
|
}
|
3777
3792
|
else if ((pos = NUM2LONG(index) + 1) > 0)
|
3778
3793
|
/*
|
3779
3794
|
* EXEC SQL fetch absolute :pos :cid using descriptor output;
|
3780
3795
|
*/
|
3781
|
-
#line
|
3796
|
+
#line 2967 "informix.ec"
|
3782
3797
|
{
|
3783
|
-
#line
|
3798
|
+
#line 2967 "informix.ec"
|
3784
3799
|
static ifx_sqlvar_t _sqibind[] =
|
3785
3800
|
{
|
3786
3801
|
{ 103, sizeof(pos), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
3787
|
-
#line
|
3802
|
+
#line 2967 "informix.ec"
|
3788
3803
|
};
|
3789
3804
|
static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
|
3790
3805
|
static _FetchSpec _FS1 = { 0, 6, 0 };
|
3791
|
-
#line
|
3806
|
+
#line 2967 "informix.ec"
|
3792
3807
|
_sqibind[0].sqldata = (char *) &pos;
|
3793
3808
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), &_SD0, output, (char *)0, &_FS1);
|
3794
|
-
#line
|
3809
|
+
#line 2967 "informix.ec"
|
3795
3810
|
}
|
3796
3811
|
else {
|
3797
3812
|
/*
|
3798
3813
|
* EXEC SQL fetch last :cid;
|
3799
3814
|
*/
|
3800
|
-
#line
|
3815
|
+
#line 2969 "informix.ec"
|
3801
3816
|
{
|
3802
|
-
#line
|
3817
|
+
#line 2969 "informix.ec"
|
3803
3818
|
static _FetchSpec _FS0 = { 0, 4, 0 };
|
3804
3819
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, (ifx_sqlda_t *)0, (char *)0, &_FS0);
|
3805
|
-
#line
|
3820
|
+
#line 2969 "informix.ec"
|
3806
3821
|
}
|
3807
3822
|
/*
|
3808
3823
|
* EXEC SQL fetch relative :pos :cid using descriptor output;
|
3809
3824
|
*/
|
3810
|
-
#line
|
3825
|
+
#line 2970 "informix.ec"
|
3811
3826
|
{
|
3812
|
-
#line
|
3827
|
+
#line 2970 "informix.ec"
|
3813
3828
|
static ifx_sqlvar_t _sqibind[] =
|
3814
3829
|
{
|
3815
3830
|
{ 103, sizeof(pos), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
3816
|
-
#line
|
3831
|
+
#line 2970 "informix.ec"
|
3817
3832
|
};
|
3818
3833
|
static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
|
3819
3834
|
static _FetchSpec _FS1 = { 0, 7, 0 };
|
3820
|
-
#line
|
3835
|
+
#line 2970 "informix.ec"
|
3821
3836
|
_sqibind[0].sqldata = (char *) &pos;
|
3822
3837
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), &_SD0, output, (char *)0, &_FS1);
|
3823
|
-
#line
|
3838
|
+
#line 2970 "informix.ec"
|
3824
3839
|
}
|
3825
3840
|
}
|
3826
3841
|
|
@@ -3845,13 +3860,13 @@ scrollcur_subseq(VALUE self, VALUE start, VALUE length, VALUE type)
|
|
3845
3860
|
/*
|
3846
3861
|
* EXEC SQL begin declare section;
|
3847
3862
|
*/
|
3848
|
-
#line
|
3849
|
-
#line
|
3863
|
+
#line 2991 "informix.ec"
|
3864
|
+
#line 2992 "informix.ec"
|
3850
3865
|
long pos;
|
3851
3866
|
/*
|
3852
3867
|
* EXEC SQL end declare section;
|
3853
3868
|
*/
|
3854
|
-
#line
|
3869
|
+
#line 2993 "informix.ec"
|
3855
3870
|
|
3856
3871
|
|
3857
3872
|
first = scrollcur_entry(self, start, type, 0);
|
@@ -3983,14 +3998,14 @@ scrollcur_rel(int argc, VALUE *argv, VALUE self, int dir, VALUE type, int bang)
|
|
3983
3998
|
/*
|
3984
3999
|
* EXEC SQL begin declare section;
|
3985
4000
|
*/
|
3986
|
-
#line
|
3987
|
-
#line
|
4001
|
+
#line 3121 "informix.ec"
|
4002
|
+
#line 3122 "informix.ec"
|
3988
4003
|
char *cid, *did;
|
3989
4004
|
long pos;
|
3990
4005
|
/*
|
3991
4006
|
* EXEC SQL end declare section;
|
3992
4007
|
*/
|
3993
|
-
#line
|
4008
|
+
#line 3124 "informix.ec"
|
3994
4009
|
|
3995
4010
|
|
3996
4011
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -4001,11 +4016,11 @@ long pos;
|
|
4001
4016
|
/*
|
4002
4017
|
* EXEC SQL set connection :did;
|
4003
4018
|
*/
|
4004
|
-
#line
|
4019
|
+
#line 3131 "informix.ec"
|
4005
4020
|
{
|
4006
|
-
#line
|
4021
|
+
#line 3131 "informix.ec"
|
4007
4022
|
sqli_connect_set(0, did, 0);
|
4008
|
-
#line
|
4023
|
+
#line 3131 "informix.ec"
|
4009
4024
|
}
|
4010
4025
|
if (SQLCODE < 0)
|
4011
4026
|
return Qnil;
|
@@ -4018,20 +4033,20 @@ long pos;
|
|
4018
4033
|
/*
|
4019
4034
|
* EXEC SQL fetch relative :pos :cid using descriptor output;
|
4020
4035
|
*/
|
4021
|
-
#line
|
4036
|
+
#line 3140 "informix.ec"
|
4022
4037
|
{
|
4023
|
-
#line
|
4038
|
+
#line 3140 "informix.ec"
|
4024
4039
|
static ifx_sqlvar_t _sqibind[] =
|
4025
4040
|
{
|
4026
4041
|
{ 103, sizeof(pos), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
4027
|
-
#line
|
4042
|
+
#line 3140 "informix.ec"
|
4028
4043
|
};
|
4029
4044
|
static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
|
4030
4045
|
static _FetchSpec _FS1 = { 0, 7, 0 };
|
4031
|
-
#line
|
4046
|
+
#line 3140 "informix.ec"
|
4032
4047
|
_sqibind[0].sqldata = (char *) &pos;
|
4033
4048
|
sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), &_SD0, output, (char *)0, &_FS1);
|
4034
|
-
#line
|
4049
|
+
#line 3140 "informix.ec"
|
4035
4050
|
}
|
4036
4051
|
|
4037
4052
|
if (SQLCODE == SQLNOTFOUND)
|
@@ -4331,13 +4346,13 @@ cursor_close_or_free(cursor_t *c, short op)
|
|
4331
4346
|
/*
|
4332
4347
|
* EXEC SQL begin declare section;
|
4333
4348
|
*/
|
4334
|
-
#line
|
4335
|
-
#line
|
4349
|
+
#line 3436 "informix.ec"
|
4350
|
+
#line 3437 "informix.ec"
|
4336
4351
|
char *cid, *sid, *did;
|
4337
4352
|
/*
|
4338
4353
|
* EXEC SQL end declare section;
|
4339
4354
|
*/
|
4340
|
-
#line
|
4355
|
+
#line 3438 "informix.ec"
|
4341
4356
|
|
4342
4357
|
|
4343
4358
|
if (op == 1 && !c->is_open)
|
@@ -4355,11 +4370,11 @@ cursor_close_or_free(cursor_t *c, short op)
|
|
4355
4370
|
/*
|
4356
4371
|
* EXEC SQL set connection :did;
|
4357
4372
|
*/
|
4358
|
-
#line
|
4373
|
+
#line 3452 "informix.ec"
|
4359
4374
|
{
|
4360
|
-
#line
|
4375
|
+
#line 3452 "informix.ec"
|
4361
4376
|
sqli_connect_set(0, did, 0);
|
4362
|
-
#line
|
4377
|
+
#line 3452 "informix.ec"
|
4363
4378
|
}
|
4364
4379
|
if (SQLCODE < 0)
|
4365
4380
|
return;
|
@@ -4368,11 +4383,11 @@ cursor_close_or_free(cursor_t *c, short op)
|
|
4368
4383
|
/*
|
4369
4384
|
* EXEC SQL close :cid;
|
4370
4385
|
*/
|
4371
|
-
#line
|
4386
|
+
#line 3457 "informix.ec"
|
4372
4387
|
{
|
4373
|
-
#line
|
4388
|
+
#line 3457 "informix.ec"
|
4374
4389
|
sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256));
|
4375
|
-
#line
|
4390
|
+
#line 3457 "informix.ec"
|
4376
4391
|
}
|
4377
4392
|
|
4378
4393
|
if (op == 2) {
|
@@ -4380,20 +4395,20 @@ cursor_close_or_free(cursor_t *c, short op)
|
|
4380
4395
|
/*
|
4381
4396
|
* EXEC SQL free :cid;
|
4382
4397
|
*/
|
4383
|
-
#line
|
4398
|
+
#line 3461 "informix.ec"
|
4384
4399
|
{
|
4385
|
-
#line
|
4400
|
+
#line 3461 "informix.ec"
|
4386
4401
|
sqli_curs_free(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 258));
|
4387
|
-
#line
|
4402
|
+
#line 3461 "informix.ec"
|
4388
4403
|
}
|
4389
4404
|
/*
|
4390
4405
|
* EXEC SQL free :sid;
|
4391
4406
|
*/
|
4392
|
-
#line
|
4407
|
+
#line 3461 "informix.ec"
|
4393
4408
|
{
|
4394
|
-
#line
|
4409
|
+
#line 3461 "informix.ec"
|
4395
4410
|
sqli_curs_free(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 258));
|
4396
|
-
#line
|
4411
|
+
#line 3461 "informix.ec"
|
4397
4412
|
}
|
4398
4413
|
}
|
4399
4414
|
}
|
@@ -4437,14 +4452,14 @@ cursor_initialize(int argc, VALUE *argv, VALUE self)
|
|
4437
4452
|
/*
|
4438
4453
|
* EXEC SQL begin declare section;
|
4439
4454
|
*/
|
4440
|
-
#line
|
4441
|
-
#line
|
4455
|
+
#line 3501 "informix.ec"
|
4456
|
+
#line 3502 "informix.ec"
|
4442
4457
|
char *c_query;
|
4443
4458
|
char *cid, *sid, *did;
|
4444
4459
|
/*
|
4445
4460
|
* EXEC SQL end declare section;
|
4446
4461
|
*/
|
4447
|
-
#line
|
4462
|
+
#line 3504 "informix.ec"
|
4448
4463
|
|
4449
4464
|
|
4450
4465
|
rb_scan_args(argc, argv, "21", &db, &query, &options);
|
@@ -4453,11 +4468,11 @@ cursor_initialize(int argc, VALUE *argv, VALUE self)
|
|
4453
4468
|
/*
|
4454
4469
|
* EXEC SQL set connection :did;
|
4455
4470
|
*/
|
4456
|
-
#line
|
4471
|
+
#line 3509 "informix.ec"
|
4457
4472
|
{
|
4458
|
-
#line
|
4473
|
+
#line 3509 "informix.ec"
|
4459
4474
|
sqli_connect_set(0, did, 0);
|
4460
|
-
#line
|
4475
|
+
#line 3509 "informix.ec"
|
4461
4476
|
}
|
4462
4477
|
if (SQLCODE < 0)
|
4463
4478
|
raise_ifx_extended();
|
@@ -4480,11 +4495,11 @@ cursor_initialize(int argc, VALUE *argv, VALUE self)
|
|
4480
4495
|
/*
|
4481
4496
|
* EXEC SQL prepare :sid from :c_query;
|
4482
4497
|
*/
|
4483
|
-
#line
|
4498
|
+
#line 3528 "informix.ec"
|
4484
4499
|
{
|
4485
|
-
#line
|
4500
|
+
#line 3528 "informix.ec"
|
4486
4501
|
sqli_prep(ESQLINTVERSION, sid, c_query,(ifx_literal_t *)0, (ifx_namelist_t *)0, -1, 0, 0 );
|
4487
|
-
#line
|
4502
|
+
#line 3528 "informix.ec"
|
4488
4503
|
}
|
4489
4504
|
if (SQLCODE < 0)
|
4490
4505
|
raise_ifx_extended();
|
@@ -4493,41 +4508,41 @@ cursor_initialize(int argc, VALUE *argv, VALUE self)
|
|
4493
4508
|
/*
|
4494
4509
|
* EXEC SQL declare :cid scroll cursor with hold for :sid;
|
4495
4510
|
*/
|
4496
|
-
#line
|
4511
|
+
#line 3533 "informix.ec"
|
4497
4512
|
{
|
4498
|
-
#line
|
4513
|
+
#line 3533 "informix.ec"
|
4499
4514
|
sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqli_curs_locate(ESQLINTVERSION, sid, 1), 4128, 0);
|
4500
|
-
#line
|
4515
|
+
#line 3533 "informix.ec"
|
4501
4516
|
}
|
4502
4517
|
else if (RTEST(hold))
|
4503
4518
|
/*
|
4504
4519
|
* EXEC SQL declare :cid cursor with hold for :sid;
|
4505
4520
|
*/
|
4506
|
-
#line
|
4521
|
+
#line 3535 "informix.ec"
|
4507
4522
|
{
|
4508
|
-
#line
|
4523
|
+
#line 3535 "informix.ec"
|
4509
4524
|
sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqli_curs_locate(ESQLINTVERSION, sid, 1), 4096, 0);
|
4510
|
-
#line
|
4525
|
+
#line 3535 "informix.ec"
|
4511
4526
|
}
|
4512
4527
|
else if (RTEST(scroll))
|
4513
4528
|
/*
|
4514
4529
|
* EXEC SQL declare :cid scroll cursor for :sid;
|
4515
4530
|
*/
|
4516
|
-
#line
|
4531
|
+
#line 3537 "informix.ec"
|
4517
4532
|
{
|
4518
|
-
#line
|
4533
|
+
#line 3537 "informix.ec"
|
4519
4534
|
sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqli_curs_locate(ESQLINTVERSION, sid, 1), 32, 0);
|
4520
|
-
#line
|
4535
|
+
#line 3537 "informix.ec"
|
4521
4536
|
}
|
4522
4537
|
else
|
4523
4538
|
/*
|
4524
4539
|
* EXEC SQL declare :cid cursor for :sid;
|
4525
4540
|
*/
|
4526
|
-
#line
|
4541
|
+
#line 3539 "informix.ec"
|
4527
4542
|
{
|
4528
|
-
#line
|
4543
|
+
#line 3539 "informix.ec"
|
4529
4544
|
sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 0), cid, sqli_curs_locate(ESQLINTVERSION, sid, 1), 0, 0);
|
4530
|
-
#line
|
4545
|
+
#line 3539 "informix.ec"
|
4531
4546
|
}
|
4532
4547
|
|
4533
4548
|
if (SQLCODE < 0)
|
@@ -4537,11 +4552,11 @@ cursor_initialize(int argc, VALUE *argv, VALUE self)
|
|
4537
4552
|
/*
|
4538
4553
|
* EXEC SQL describe :sid into output;
|
4539
4554
|
*/
|
4540
|
-
#line
|
4555
|
+
#line 3545 "informix.ec"
|
4541
4556
|
{
|
4542
|
-
#line
|
4557
|
+
#line 3545 "informix.ec"
|
4543
4558
|
sqli_describe_stmt(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, sid, 257), &output, 0);
|
4544
|
-
#line
|
4559
|
+
#line 3545 "informix.ec"
|
4545
4560
|
}
|
4546
4561
|
c->daOutput = output;
|
4547
4562
|
|
@@ -4669,13 +4684,13 @@ cursor_open(int argc, VALUE *argv, VALUE self)
|
|
4669
4684
|
/*
|
4670
4685
|
* EXEC SQL begin declare section;
|
4671
4686
|
*/
|
4672
|
-
#line
|
4673
|
-
#line
|
4687
|
+
#line 3669 "informix.ec"
|
4688
|
+
#line 3670 "informix.ec"
|
4674
4689
|
char *cid, *did;
|
4675
4690
|
/*
|
4676
4691
|
* EXEC SQL end declare section;
|
4677
4692
|
*/
|
4678
|
-
#line
|
4693
|
+
#line 3671 "informix.ec"
|
4679
4694
|
|
4680
4695
|
|
4681
4696
|
Data_Get_Struct(self, cursor_t, c);
|
@@ -4687,11 +4702,11 @@ cursor_open(int argc, VALUE *argv, VALUE self)
|
|
4687
4702
|
/*
|
4688
4703
|
* EXEC SQL set connection :did;
|
4689
4704
|
*/
|
4690
|
-
#line
|
4705
|
+
#line 3679 "informix.ec"
|
4691
4706
|
{
|
4692
|
-
#line
|
4707
|
+
#line 3679 "informix.ec"
|
4693
4708
|
sqli_connect_set(0, did, 0);
|
4694
|
-
#line
|
4709
|
+
#line 3679 "informix.ec"
|
4695
4710
|
}
|
4696
4711
|
if (SQLCODE < 0)
|
4697
4712
|
raise_ifx_extended();
|
@@ -4710,11 +4725,11 @@ cursor_open(int argc, VALUE *argv, VALUE self)
|
|
4710
4725
|
* EXEC SQL open :cid using descriptor input
|
4711
4726
|
* with reoptimization;
|
4712
4727
|
*/
|
4713
|
-
#line
|
4728
|
+
#line 3693 "informix.ec"
|
4714
4729
|
{
|
4715
|
-
#line
|
4730
|
+
#line 3694 "informix.ec"
|
4716
4731
|
sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), input, (char *)0, (struct value *)0, 1, 1);
|
4717
|
-
#line
|
4732
|
+
#line 3694 "informix.ec"
|
4718
4733
|
}
|
4719
4734
|
clean_input_slots(c);
|
4720
4735
|
}
|
@@ -4722,22 +4737,22 @@ cursor_open(int argc, VALUE *argv, VALUE self)
|
|
4722
4737
|
/*
|
4723
4738
|
* EXEC SQL open :cid with reoptimization;
|
4724
4739
|
*/
|
4725
|
-
#line
|
4740
|
+
#line 3698 "informix.ec"
|
4726
4741
|
{
|
4727
|
-
#line
|
4742
|
+
#line 3698 "informix.ec"
|
4728
4743
|
sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0, 1);
|
4729
|
-
#line
|
4744
|
+
#line 3698 "informix.ec"
|
4730
4745
|
}
|
4731
4746
|
}
|
4732
4747
|
else
|
4733
4748
|
/*
|
4734
4749
|
* EXEC SQL open :cid;
|
4735
4750
|
*/
|
4736
|
-
#line
|
4751
|
+
#line 3701 "informix.ec"
|
4737
4752
|
{
|
4738
|
-
#line
|
4753
|
+
#line 3701 "informix.ec"
|
4739
4754
|
sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, cid, 256), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0, 0);
|
4740
|
-
#line
|
4755
|
+
#line 3701 "informix.ec"
|
4741
4756
|
}
|
4742
4757
|
|
4743
4758
|
if (SQLCODE < 0)
|
@@ -5003,4 +5018,4 @@ void Init_informix(void)
|
|
5003
5018
|
rbifx_except_init(rb_mInformix, &esyms);
|
5004
5019
|
}
|
5005
5020
|
|
5006
|
-
#line
|
5021
|
+
#line 3964 "informix.ec"
|
data/informix.ec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: informix.ec,v 1.
|
1
|
+
/* $Id: informix.ec,v 1.12 2007/10/14 00:18:50 santana Exp $ */
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2006-2007, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
4
4
|
* All rights reserved.
|
@@ -28,7 +28,7 @@
|
|
28
28
|
* POSSIBILITY OF SUCH DAMAGE.
|
29
29
|
*/
|
30
30
|
|
31
|
-
static const char rcsid[] = "$Id: informix.ec,v 1.
|
31
|
+
static const char rcsid[] = "$Id: informix.ec,v 1.12 2007/10/14 00:18:50 santana Exp $";
|
32
32
|
|
33
33
|
#include "ruby.h"
|
34
34
|
#include "ifx_except.h"
|
@@ -1775,7 +1775,7 @@ rb_informix_connect(int argc, VALUE *argv, VALUE self)
|
|
1775
1775
|
*/
|
1776
1776
|
static VALUE rb_informix_version(void)
|
1777
1777
|
{
|
1778
|
-
static const char * const ver = "0.6.
|
1778
|
+
static const char * const ver = "0.6.1";
|
1779
1779
|
static VALUE driver_version;
|
1780
1780
|
|
1781
1781
|
if (driver_version == 0)
|
@@ -2144,22 +2144,30 @@ rb_database_columns(VALUE self, VALUE tablename)
|
|
2144
2144
|
result = rb_ary_new();
|
2145
2145
|
|
2146
2146
|
cid = did + IDSIZE;
|
2147
|
+
|
2147
2148
|
if (!*cid) {
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2149
|
+
EXEC SQL begin declare section;
|
2150
|
+
char sid[IDSIZE];
|
2151
|
+
EXEC SQL end declare section;
|
2152
|
+
|
2153
|
+
snprintf(sid, IDSIZE, "COLS%lX", self);
|
2154
|
+
snprintf(cid, IDSIZE, "COLC%lX", self);
|
2155
|
+
|
2156
|
+
EXEC SQL prepare :sid from
|
2157
|
+
'select colname, coltype, collength, extended_id,
|
2151
2158
|
type, default, c.colno
|
2152
2159
|
from syscolumns c, outer sysdefaults d
|
2153
|
-
where c.tabid =
|
2160
|
+
where c.tabid = ? and c.tabid = d.tabid
|
2154
2161
|
and c.colno = d.colno
|
2155
|
-
order by c.colno;
|
2162
|
+
order by c.colno';
|
2163
|
+
EXEC SQL declare :cid cursor for :sid;
|
2156
2164
|
if (SQLCODE < 0) {
|
2157
2165
|
cid[0] = 0;
|
2158
2166
|
raise_ifx_extended();
|
2159
2167
|
}
|
2160
2168
|
}
|
2161
2169
|
|
2162
|
-
EXEC SQL open :cid;
|
2170
|
+
EXEC SQL open :cid using :tabid;
|
2163
2171
|
if (SQLCODE < 0)
|
2164
2172
|
raise_ifx_extended();
|
2165
2173
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-informix
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.6.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.6.1
|
7
|
+
date: 2007-10-13 00:00:00 -05:00
|
8
8
|
summary: Informix driver for Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|