connect && rename && connect
Posted in 2008
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Versions, Editions & End-of-Life
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 -aSunOS since 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440
$ esql -VIBM Informix CSDK Version 3.00, IBM Informix-ESQL Version 3.00.UC2
Software Serial Number AAA#B000000
$ onparams -VIBM 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 && ./x11: connected to anydb? 0
12: test renamed to test2? 0
connname == anydb
15: connected to test2? -425
connname == anydb
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
>