Newbie ESQL/C Question. -956 error
Posted in 1995
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration
Hello folks. After talking with Informix support (344-336 case #) and
getting nowhere, I have a simple question which should not be rocket
science. I have looked in the FAQ 1.5 as well as the ESQL/C manuals and SQL
Reference manuals. I am trying to query an Informix 4.x engine (SE). The
sqlexec version is 4.00.UE3 and the sqlinet and sqlexecd is the same
version. The isql is 4.00.UE2.
We have a valid pingable connection to the machine running the Informix
server (an Aspect CallCenter). The machine where the following ESQL/C
program is running is an A/UX box (v3.1.1). The sqlexec is v5.01.UD2. I am
aware of the unsupported nature of 5.0 inet going against a 4.0 engine. Yet
Aspect claims this configuration works just fine.
On to the problem. The following is the sample program run. My machines
name (wiseone) is both in the hosts.equiv on the server and in its hosts
file so the error has to be a side effect of another problem. The aspectdb
server name is in the client's /etc/sqlhosts file:
aspectdb sesoctcp quixote sqlexec
Also the sqlexecd is running on the Informix server over port 7000 rather
than 1525. This is denoted in both /etc/services files properly.
I think it is the fact that I have not properly logged in to the remote
server. Could someone please shed some light on this? I feel I need some
extra code before I issue the $database command but I cannot find this
documented ANYWHERE. Or am I missing a major piece? This should be in the
FAQ if there is a simple resolution.
TIA
Parms Sample ESQL program running.
Error -956 during Opening database.: Client is not in
/etc/hosts.equiv on the remote host.
------
here is demo1.ec
#include <stdio.h>
$include sqlca;
/* Uncomment the following line if the database has
transactions: */
/* $define TRANS; */
$define COMPANY_LEN 30;
char errmsg[400];
/*
err_chk() checks sqlca.sqlcode and if an error has occurred, it uses
rgetmsg() to display the message for the error number in sqlca.sqlcode.
*/
err_chk(name)
char *name;
{
if(sqlca.sqlcode != 0)
{
rgetmsg((short)sqlca.sqlcode, errmsg, sizeof(errmsg));
printf("\\n\\tError %d during %s: %s\\n",sqlca.sqlcode, name, errmsg);
exit(1);
}
}
main()
{
$char company[ COMPANY_LEN + 1 ];
printf( "Parms Sample ESQL program running.\\n\\n");
$database "//aspectdb/acc";
err_chk("Opening database.");
$declare democursor cursor for
select company
into $company
from parms;
err_chk("Declaring cursor.");
$ifdef TRANS;
$begin work;
$endif;
$open democursor;
err_chk("Opening cursor.");
for (;;)
{
$fetch democursor;
err_chk("Fetching row from cursor.");
if (sqlca.sqlcode != 0) break;
printf("%s\\n",company);
}
$close democursor;
err_chk("Closing cursor.");
$ifdef TRANS;
$commit work;
$endif;
printf("\\nProgram Over.\\n");
}
`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
`,`,`Alex Sirota,`,`,`,`,`,`,Genius is an African that dreams of snow.`,`,`
`,`,`adapple@apple.com`,`,`,`,`,`,`,`,`,`,`,``,`,`-Vladimir Nabokov,`,`,`,`
`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
`,<URL:http://atlantis.austin.apple.com/people.pages/adapple/adapple.html>`
`,`,`,`,`,`,Apple Web Server: <URL:http://www.info.apple.com/>`,`,`,`,`,`,`
`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`