Unix Technical Forum

connect && rename && connect

This is a discussion on connect && rename && connect within the Informix forums, part of the Database Server Software category; --> Why am I getting an SQLCODE == -425, ISAM error == -107? I haven't found anything in the online ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-05-2008, 06:53 AM
Gerardo Santana
 
Posts: n/a
Default connect && rename && connect

Why am I getting an SQLCODE == -425, ISAM error == -107?
I haven't found anything in the online documentation about making an
implicit connection when renaming a database.
onstat -u doesn't reveal any other connection different from anydb.

$ uname -a
SunOS since 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440

$ esql -V
IBM Informix CSDK Version 3.00, IBM Informix-ESQL Version 3.00.UC2
Software Serial Number AAA#B000000

$ onparams -V
IBM Informix Dynamic Server Version 11.10.UC1 Software Serial
Number AAA#B000000

$ cat rename_and_connect.ec
#include <stdio.h>

#define psqlcode(msg) do \
{ \
printf("%d: %s %d\n", __LINE__, msg, SQLCODE);
fflush(stdout); \
} while(0)

int main(void)
{
EXEC SQL connect to 'anydb'; psqlcode("connected to anydb?");
EXEC SQL execute immediate 'rename database test to test2';
psqlcode("test renamed to test2?");
printf("connname == %s\n", ifx_getcur_conn_name());
EXEC SQL connect to 'test2'; psqlcode("connected to test2?");
printf("connname == %s\n", ifx_getcur_conn_name());
}

$ esql rename_and_connect.ec -o x && ./x
11: connected to anydb? 0
12: test renamed to test2? 0
connname == anydb
15: connected to test2? -425
connname == anydb

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-07-2008, 11:19 AM
Radhika Gadde
 
Posts: n/a
Default Re: connect && rename && connect

can you try by adding the "EXEC SQL disconnect current" before connecting to
test2

Thanks,
Radhika.


On 5/4/08, Gerardo Santana <gerardo.santana@gmail.com> wrote:
>
> Why am I getting an SQLCODE == -425, ISAM error == -107?
> I haven't found anything in the online documentation about making an
> implicit connection when renaming a database.
> onstat -u doesn't reveal any other connection different from anydb.
>
> $ uname -a
> SunOS since 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440
>
> $ esql -V
> IBM Informix CSDK Version 3.00, IBM Informix-ESQL Version 3.00.UC2
> Software Serial Number AAA#B000000
>
> $ onparams -V
> IBM Informix Dynamic Server Version 11.10.UC1 Software Serial
> Number AAA#B000000
>
> $ cat rename_and_connect.ec
> #include <stdio.h>
>
> #define psqlcode(msg) do \
> { \
> printf("%d: %s %d\n", __LINE__, msg, SQLCODE);
> fflush(stdout); \
> } while(0)
>
> int main(void)
> {
> EXEC SQL connect to 'anydb'; psqlcode("connected to anydb?");
> EXEC SQL execute immediate 'rename database test to test2';
> psqlcode("test renamed to test2?");
> printf("connname == %s\n", ifx_getcur_conn_name());
> EXEC SQL connect to 'test2'; psqlcode("connected to test2?");
> printf("connname == %s\n", ifx_getcur_conn_name());
> }
>
> $ esql rename_and_connect.ec -o x && ./x
> 11: connected to anydb? 0
> 12: test renamed to test2? 0
> connname == anydb
> 15: connected to test2? -425
> connname == anydb
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-07-2008, 11:19 AM
=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=
 
Posts: n/a
Default Re: connect && rename && connect

Thanks Radhika, but that doesn't fix the problem.

I don't want to disconnect my current connection and I don't want to
switch to a connection to the server (but I will have to!).

I will report the bug, as soon as I know how to do it.

Thanks Jonathan.

On 5/6/08, Radhika Gadde <radhika.gadde1@gmail.com> wrote:
> can you try by adding the "EXEC SQL disconnect current" before connecting to
> test2
>
> Thanks,
> Radhika.
>
>
> On 5/4/08, Gerardo Santana <gerardo.santana@gmail.com> wrote:
> >
> > Why am I getting an SQLCODE == -425, ISAM error == -107?
> > I haven't found anything in the online documentation about making an
> > implicit connection when renaming a database.
> > onstat -u doesn't reveal any other connection different from anydb.
> >
> > $ uname -a
> > SunOS since 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440
> >
> > $ esql -V
> > IBM Informix CSDK Version 3.00, IBM Informix-ESQL Version 3.00.UC2
> > Software Serial Number AAA#B000000
> >
> > $ onparams -V
> > IBM Informix Dynamic Server Version 11.10.UC1 Software Serial
> > Number AAA#B000000
> >
> > $ cat rename_and_connect.ec
> > #include <stdio.h>
> >
> > #define psqlcode(msg) do \
> > { \
> > printf("%d: %s %d\n", __LINE__, msg, SQLCODE);
> > fflush(stdout); \
> > } while(0)
> >
> > int main(void)
> > {
> > EXEC SQL connect to 'anydb'; psqlcode("connected to anydb?");
> > EXEC SQL execute immediate 'rename database test to test2';
> > psqlcode("test renamed to test2?");
> > printf("connname == %s\n", ifx_getcur_conn_name());
> > EXEC SQL connect to 'test2'; psqlcode("connected to test2?");
> > printf("connname == %s\n", ifx_getcur_conn_name());
> > }
> >
> > $ esql rename_and_connect.ec -o x && ./x
> > 11: connected to anydb? 0
> > 12: test renamed to test2? 0
> > connname == anydb
> > 15: connected to test2? -425
> > connname == anydb
> >
> > _______________________________________________
> > Informix-list mailing list
> > Informix-list@iiug.org
> > http://www.iiug.org/mailman/listinfo/informix-list
> >

>



--
Gerardo Santana
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com