on 03-02-2016 4:59 PM
The following Calculation View:
BEGIN
create local temporary table "#TEMP_TABLE"
("UserCode" NVARCHAR(30), "Counter" INT);
insert into "#TEMP_TABLE" values('1',0);
var_in = select * from "#TEMP_TABLE";
var_out = CE_AGGREGATION (:var_in, [SUM("Counter") as "Counter"], ["UserCode"]);
END;
returns the following error when I try to activate:
Message :
Repository: Encountered an error in repository runtime extension;Model inconsistency. Deploy Calculation View: SQL: transaction rolled back by an internal error: feature not supported: DDL is not supported in the READ ONLY procedure/functionnSet Schema DDL statement: set schema "DEVPL09"nType DDL: create type ....
Regards,
Dimitris
Hi Dimitris
No, as far as I know it is not possible in Calculation View.
What is your requirement ? Can you not perform that with join/union ?
I think SQL script append/insert to temporary table in ... | SCN would be something you should check.
Regards
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dimitris,
As Anindya mentioned we cannot use Temporary table. And also we cannot use insert/upsert/delete/update statements in a calculation(As system by itself would create a stored procedure of type read only).
Not sure about your requirement, but you can make use of select from dummy instead.
BEGIN
var_in = select'XYZ' as "UserCode" ,0 as "Counter" from dummy ;
var_out = CE_AGGREGATION (:var_in, [SUM("Counter") as "Counter"], ["UserCode"]);
END
If you need to insert multiple values into Temp table, then make use of UNION i.e,
BEGIN
var_in = select'XYZ' as "UserCode" ,1 as "Counter" from dummy
union
select'ABC' as "UserCode" ,0 as "Counter" from dummy
union
select'XYZ' as "UserCode" ,8 as "Counter" from dummy ;
var_out = CE_AGGREGATION (:var_in, [SUM("Counter") as "Counter"], ["UserCode"]);
END
But definitely a very bad way of modelling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dimitris,
Unfortunately you have to, calculation(script) was never intended to suffice this requirement .
Go for Stored Procedure's,if you are absolutely certain that you need Temp tables and Cursors.
FYI.., You cannot call this type of procedures from Calc view(only read only proc is possible).
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.