Skip to Content
0
Jan 30, 2014 at 02:48 PM

Changing an internal table in an SQLScript Procedure

1247 Views

Hi,

I'm trying to add rows to a table variable in an SQLScript Procedure, but this gives me syntax errors, so maybe it is not possible.What I'm trying to do is similar to this:

tab = SELECT col1, col2, col3 FROM aTable;

INSERT INTO :tab (col1, col2, col3) VALUES ('1', '2', '3');

But the INSERT line results in an error:

Syntax error: 'tab' is incorrect or misplaced

Any ideas on how to get it to work?

I have got a version of the procedure running by using the new ARRAY feature from SP6, but it is rather slow (I have potentially a lot of rows to process); this is why I'd like to do it differently.

I was also thinking about creating an actual table temporarily and working on that, but that seems to be a lot of effort.

Regards,

Daniel.