Using Sybase IQ 12.5,
When I try to insert the result of a stored proc into a table like this:
INSERT mytable (column1, column2, column3)
SELECT column1, column2, column3
FROM (myproc('AAA'))
I get the following:
ASA Error -1001042: Table, 'mytable', is not accessible in this context.
The Sybase website has no further explanation
Problem was caused by my target table having a check constraint.
Here's an example to recreate the problem:
create table mytable (column1 int,
column2 int,
column3 int CHECK (column3 in (1,2,3)));
create procedure myproc( parm varchar(10))
result ( column1 int, column2 int, column3 int)
begin
select 1,2,3;
end;
INSERT mytable (column1, column2, column3)
SELECT column1, column2, column3
FROM (myproc('AAA'));