Re: Help connect in aubit4gl : SOLVED

Mike Aubury <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WE9D0oYra8RPnBe+AkQKF2cT0G+mtbWM2KjMZn3azkbfA@mail.gmail.com>
You should be able to use

    CLOSE SESSION [sessionID]
eg.

CLOSE SESSION con1


Its probably best to restate what session you want as default - so follow
it with

   SET SESSION [sessionID]

with the another sessionID
eg.
SET SESSION TO con2

if you need to do more SQL...




On 13 January 2015 at 18:44, Herman Carrion L. <[email protected]>
wrote:

> Hi Mike.
> Connect to mysql: SOLVED.
> I start to migrate my code.
> In i4gl there was a disconnect statement
> This is necessary in aubit4gl?
> Thank you.
> Herman.
>
> ------------------------------
> Date: Tue, 13 Jan 2015 09:31:55 +0000
> Subject: Re: [Aubit4gl-discuss] Help connect in aubit4gl
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>
> Try it now ?
>
>
> On 12 January 2015 at 23:26, Herman Carrion L. <
> [email protected]> wrote:
>
> Hi friends.
> I try to compile from CVS and need help for this:
>
> gcc  -Wall -Wredundant-decls -Wmissing-declarations -Wmissing-prototypes
> -Wstrict-prototypes -g  -fPIC -DPIC -DSRC_TREE -DDEBUG -DHAVE_CONFIG_H
>  -I/home/aubit4glsrc/incl -I/home/aubit4glsrc  -fPIC -DPIC -g
> -I../../../../lib/libaubit4gl -I../../../../incl   -DALLOW_ZLIB  -shared
> process_pdf.o pdf_handling.o ../common/common_pdf.c pdf_barcode.o -o
> /home/aubit4glsrc/plugins-1.2_37/libLOGREPPROC_PDF.so -L../../../../lib
> -laubit4gl-1.2_37 -lpdf
> make[2]: Leaving directory `/home/aubit4glsrc/lib/liblogical/pdf/process'
> /usr/bin/make -C libsql/mysql
> make[2]: Entering directory `/home/aubit4glsrc/lib/libsql/mysql'
> gcc -I/include -I/usr/include/mysql -I../../../incl  -Wall
> -Wredundant-decls -Wmissing-declarations -Wmissing-prototypes
> -Wstrict-prototypes -g  -fPIC -DPIC -DSRC_TREE -DDEBUG -DHAVE_CONFIG_H
>  -I/home/aubit4glsrc/incl -I/home/aubit4glsrc  -fPIC -DPIC   -c -o mysql.o
> mysql.c
> mysql.c: In function 'A4GLSQLLIB_A4GLSQL_init_session_internal':
> mysql.c:200:31: error: 'SESSDB' undeclared (first use in this function)
> mysql.c:200:31: note: each undeclared identifier is reported only once for
> each function it appears in
> mysql.c: In function 'A4GLSQLLIB_A4GLSQL_set_conn_internal':
> mysql.c:235:34: error: 'SESSDB' undeclared (first use in this function)
> mysql.c: In function 'A4GLSQLLIB_A4GLSQL_init_connection_internal':
> mysql.c:614:32: error: 'SESSDB' undeclared (first use in this function)
> mysql.c: In function 'A4GL_fill_array_databases':
> mysql.c:1352:7: warning: variable 'column_count' set but not used
> [-Wunused-but-set-variable]
> mysql.c: In function 'A4GL_fill_array_tables':
> mysql.c:1404:7: warning: variable 'column_count' set but not used
> [-Wunused-but-set-variable]
> mysql.c: In function 'A4GLSQLLIB_A4GLSQL_free_prepare_internal':
> mysql.c:3112:7: warning: variable 'a' set but not used
> [-Wunused-but-set-variable]
> make[2]: *** [mysql.o] Error 1
> make[2]: Leaving directory `/home/aubit4glsrc/lib/libsql/mysql'
> make[1]: *** [/home/aubit4glsrc/plugins-1.2_37/libSQL_mysql.so] Error 2
> make[1]: Leaving directory `/home/aubit4glsrc/lib'
> make: *** [corecompile] Error 2
> root@sistemas:/home/aubit4glsrc#
>
>
> Best regards,
> Herman.
> ------------------------------
> Date: Mon, 12 Jan 2015 15:12:43 +0000
>
> Subject: Re: [Aubit4gl-discuss] Help connect in aubit4gl
> From: [email protected]
> To: [email protected]
>
> Thats not actually showing the error...
> Just that there was one.
>
> On 12 January 2015 at 14:25, Herman Carrion L. <
> [email protected]> wrote:
>
> Hi.
>
> Thank you for your quick response.
>
> I download today the CVS code and compile, then shows me the following
> errors:
> ...
> make[2]: *** [mysql.o] Error 1
> make[2]: se sale del directorio «/home/aubit4glsrc/lib/libsql/mysql»
> make[1]: *** [/home/aubit4glsrc/plugins-1.2_37/libSQL_mysql.so] Error 2
> make[1]: se sale del directorio «/home/aubit4glsrc/lib»
> make: *** [corecompile] Error 2
>
> Thanks for the advice.
>
> Herman Carrion.
> Gyuayaquil-Ecuador.
>
> ------------------------------
> Date: Fri, 9 Jan 2015 20:04:53 +0000
> Subject: Re: [Aubit4gl-discuss] Help connect in aubit4gl
> From: [email protected]
> To: [email protected]
> CC: [email protected]; [email protected]
>
> Ok, i've just added code to CVS which should allow this..
>
> You can now run things like :
> MAIN
> DEFINE lv_c1, lv_c2 INTEGER
> DEFINE lv_a INTEGER
>
> CONNECT TO test AS con1 USER "aubit4gl" USING "somepassword"
> DELETE FROM testtab
> INSERT INTO testtab VALUES("1234")
>
>
> CONNECT TO test1 AS con2 USER "aubit4gl" USING "somepassword"
>
> DELETE FROM testtab
>
> USE SESSION con1 FOR SELECT COUNT(*) INTO lv_c1 FROM testtab;
> USE SESSION con2 FOR SELECT COUNT(*) INTO lv_c2 FROM testtab;
>
> DISPLAY lv_c1
> DISPLAY lv_c2
>
>
>
> SET SESSION TO con1
> DECLARE c1 CURSOR FOR SELECT * INTO lv_a FROM testtab
> FOREACH c1
>         DISPLAY "INSERTING : ", lv_a
>         Use SESSION con2 FOR INSERT INTO testtab VALUES (lv_a)
> END FOREACH
>
> USE SESSION con1 FOR SELECT COUNT(*) INTO lv_c1 FROM testtab;
> USE SESSION con2 FOR SELECT COUNT(*) INTO lv_c2 FROM testtab;
> DISPLAY lv_c1
> DISPLAY lv_c2
>
> END MAIN
>
>
> [ Here - i have 2 databases: test & test1 - and I'm inserting into one,
> then reading that to insert into the other ]
>
> Its obviously just a first draft - so treat with caution and report any
> bugs...
> If you need a binary or source tarball - let me know and I'll get one
> together over the weekend.
>
>
> I *think* the databases will still need to be on the same machine just for
> now if you want to do it "neatly" - but, the connection just
> uses "MYSQL_SERVER" from the environment - so you should be able to set
> that using
>
> CALL aclfgl_setenv("MYSQL_SERVER","newserver")
>
> in between CONNECTs
>
>
> On 8 January 2015 at 03:46, Herman Carrion L. <[email protected]
> > wrote:
>
> Hi everyone...and happy  new year.
>
> Mi code:
>
> -----------------------------------------------------------------------------------------
>   1 DATABASE prueba
>   2 MAIN
>   3
>   4 DEFINE base1    CHAR(60)
>   5 DEFINE base2    CHAR(60)
>   6 DEFINE user1    CHAR(60)
>   7 DEFINE user2    CHAR(60)
>   8 DEFINE pass1    CHAR(60)
>   9 DEFINE pass2    CHAR(60)
>  10
>  11 LET base1="prueba" CLIPPED
>  12 LET base2="prueba_policentro" CLIPPED
>  13 LET user1="root" CLIPPED
>  14 LET user2="root" CLIPPED
>  15 LET pass1="fender" CLIPPED
>  16 LET pass2="fender" CLIPPED
>  17
>  18 CONNECT TO base1 AS con1 USER user1 USING pass1
>  19
>  20 SELECT * FROM usuarios
>  21         WHERE codigo="bodegaop"
>  22
>  23 END MAIN
>  24
>
> ------------------------------------------------------------------------------------------
>
> Compilation=Ok.
>
> Execution: ERROR.
>
> Err:Program ./k stopped at 'k.4gl', line number 20.
> Error status number -30156.
> Sessions not implemented.
>
> 4gl function call stack :
>     MAIN
>
> my database is mysql with native connection.
>
>  Thanks for the advice.
>
> Herman Carrion L.
> Guayaquil - Ecuador
> South America
>
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
>
>
>
>

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.