Hi All,
Using Ingres10.0 I've just discovered that an unloaddb of a distributed database in which a procedure has been registered will generate errors at the command line. Furthermore, the copy.in generated will have an erroneous PROCEDURES section containing a 'create procedure' and associated grant commands which are both illegal in a DDB.
Try this:
#! /bin/sh
NODE=`uname -n`
# I'm assuming you have an installation password defined. If not just hardcode a suitable vnode.
destroydb bowtest > /dev/null
destroydb bowtest_ddb > /dev/null
echo "Create the databases: bowtest, bowtest_ddb/star..."
createdb bowtest > /dev/null
createdb bowtest_ddb/star > /dev/null
echo "Create the procedure in the loacal database (bowtest)..."
sql bowtest << PROC
create procedure get_1 as
declare
one integer not null not default;
begin
select 1 into

ne;
end
\p\g
\q
PROC
echo "And now register the procedure in the ddb (bowtest_ddb/star)..."
sql bowtest_ddb/star << REGIT
register procedure get_1 as link
with node = '$NODE', database = 'bowtest', dbms = 'INGRES'
\p\g
\q
REGIT
echo "Now do the unloaddb bowtest_ddb/star..."
unloaddb bowtest_ddb/star