For a certain data exchange purpose, i want to programatically make a small
database can with a few tables in it.

I have a stored procedure which creates the db can, starts it up, and
creates a server entry for it so i can use 'forward to'. (class = asodbc
links=tcpip{})

Then what i do is generate a create table statement into a variable and use
FORWARD TO to make the table on the other side:
execute immediate 'forward to ' + @canServerName + ' { ' + @sSql2 + '} ' ;

This actually works fine. The table is created and i am happy. Then i
'forward to' another statement to load the table from a disk file that has
the data of interest.

That works fine too.

The last step is i the try to "stop database xyz" (where xyz is the name).
It says it can't: there are still connected users. I look in SybCentral
and sure enough there is a connected user. If i disconnect it manually,
then i can stop it.

If i comment out the 'forward to' statements so all i do is just create the
can, start it, and then stop it, it works.

So, the "execute immediate 'forward to ' + ..." appears to be leaving some
connection. I tried adding
"execute immediate 'forward to ';"
by itself just thinking maybe it needed that to cancel, but no avail.

Any idea on why the exec imm of fwd to would hang on?