I-Star wierdness. Clues solicited.
Posted in 1994
Topics: Installation, Setup & Upgrades, SQL Development & Query Writing, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration
I'm completely new to the I-Star product, and I can't seem
to get it to work. There are two hosts, ONLINE_FOO and ONLINE_BAR,
and each has the following sqlhosts file in informix/etc:
ONLINE_FOO olsoctcp sipc10 foodb
ONLINE_BAR olsoctcp sipc11 bardb
and there is an sqlexecd running on each machine:
/usr2/informix/lib/sqlexecd foodb
/usr2/informix/lib/sqlexecd bardb
We use NIS, so rather than put entries in /etc/services,
'ypcat services' yields the entries:
foodb 1550/tcp
bardb 1551/tcp
As far as I can deduce from the I-Net and I-Star installation
manual, this should be sufficient to configure things. My test
program is a simple one. It opens one database, and then selects
from a remote server into a table in the open database:
$DATABASE $dbname1;
if (sqlca.sqlcode != 0)
{
fprintf(stderr, "SQL error %d opening %s\\n", sqlca.sqlcode, dbname1);
exit(1);
}
else
fprintf(stderr, "Opened %s successfully.\\n", dbname1);
sprintf(query,
"INSERT INTO star_test SELECT item FROM %s:star_test",
dbname2);
$EXECUTE IMMEDIATE $query;
if (sqlca.sqlcode != 0)
fprintf(stderr, "SQL error %d - \\n%s\\n", sqlca.sqlcode, query);
else
fprintf(stderr, "Success - %s\\n", query);
where dbname1 and dbname2 are the command line args. The table star_test
has been created in both servers. When I run this program, my output is:
Opened foo@ONLINE_FOO successfully.
SQL error -930 - INSERT INTO star_test SELECT item FROM bar@ONLINE_BAR:star_test
If I swap source and target hosts, I get
Opened bar@ONLINE_BAR successfully.
SQL error -930 - INSERT INTO star_test SELECT item FROM foo@ONLINE_FOO:star_test
Error 930 is "Cannot connect to remote host sitename"
Should this work from isql? If I run isql in the database foo@ONLINE_FOO,
and execute the query
select item from bar@ONLINE_BAR:star_testI get the error
930: Cannot connect to database server (online_bar).
This makes me suspicious of the upper-case server name.
Oddly, If I quote the db@hostname, as in
select item from 'bar@ONLINE_BAR':star_testI get a different error:
329: Database not found or no system permission.
Now if, using isql on the server ONLINE_FOO, I do
database bar@ONLINE_BAR
I also get the error
930: Cannot connect to database server (online_cmis)wherease
database 'bar@ONLINE_BAR'
succeeds (unless there was already an open database). This also
seems to indicate that the uppercase name needs to be quoted.
(Note, however, that the database statement in my ESQL program
succeeded without benefit of quotes.)
But if i then do, while isql is _in_ bar@ONLINE_BAR,
select item from 'bar@ONLINE_BAR':star_testi get the error
329: Database not found or no system permission.I get this same error when i use quotes in my ESQL program.
The somewhat happy ending to this story is that we changed the
server names to lower case: "online_foo", "online_bar".
With this change, the program succeeds when the opened
server is foo@online_foo and the remote is bar@online_bar.
However, at the moment, reversing the servers yields the error:
360: Cannot modify table or view used in subquery.
This would be the legitimate error message if I had done
insert into star_test select item from star_test
How could this succeed in one direction but fail in the other?
-Sean Burke
--
Sean Burke sean@netcom.com