cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to insert values in var_out

arpitasethi
Explorer
0 Kudos

Hello Experts,

I have a script based calc view and i have two columns in the 'var_out' table.

One of these fields is the input to the view, say int_id and the other field is the ext_id, which is calculated by the logic in the script.

I try to insert these values directly to the table but I get an error - "could not find table/view var_out in the <schema that I am using>"

What am I doing worng? I tried with creating a local table and then adding values, but nothing works!

Thanks,

Arpita

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Arpita

You're not doing anything wrong. In SQLScript you just can't directly insert/upsert/delete/update data referenced by a table variable.

What you could do instead - if you really feel you need to - is to either employ the CE_UNION operator or to use temporary tables explicitly.

- Lars

arpitasethi
Explorer
0 Kudos

Hi Lars,

I want to do this -

int_id = a (which is the input)

ext_id = b (which is calculated)

Now, I want to insert these values to var_out

Even if I use CE_UNION, I would need these values as a table row.

So I created a table and then tried to do a select on it for assigning to var_out.

But I get error - DML is not allowed in read only view etc...

Thanks,

Arpita

former_member184768
Active Contributor
0 Kudos

Hi Arpita,

It would be good if you can post your code here.

Based on the assumption that your input value int_id and second value ext_id are single values, you can try something like

var_out = select :int_id, :ext_id from dummy;

Please note that this will not work if int_id and ext_id are multi value fields (like columns, tables etc). Hence your code will help understand the requirement better.

Regards,

Ravi

arpitasethi
Explorer
0 Kudos

Hi Ravi,

I was trying to test what you suggested but got some java exceptions on validation.

Now I get this error on trying to open my view -

Thanks,

Arpita

former_member184768
Active Contributor
0 Kudos

Hi Arpita,

I am very sure that single line of code wouldn't have corrupted the object. . Is there any other log information which can provide the details.

Can you please try to create another object with the code.

Regards,

Ravi

arpitasethi
Explorer
0 Kudos

Hi Ravi,

Yes, it would be my fault

Its a null pointer exception.. may be because i didn't declare 'dummy' !

I can not edit until I open the view. It is not getting copied also.

I don't have the code anywhere else, so can't try with a new object

If it helps, the message is -

java.io.IOException: com.sap.ndb.studio.sdk.resource.base.exception.ResourceException: java.io.IOException: Error loading object, refer to Repository Log for more information

com.sap.ndb.studio.sdk.resource.base.exception.ResourceException: java.io.IOException: com.sap.ndb.studio.sdk.resource.base.exception.ResourceException: java.io.IOException: Error loading object, refer to Repository Log for more information

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.getModelObject(MDResourceController.java:170)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.AbstractResourceController.validate(AbstractResourceController.java:1336)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.ResourceManager.runValidationRules(ResourceManager.java:472)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.ResourceManager.activateAll(ResourceManager.java:303)

at com.sap.ndb.studio.modeler.job.type.activate.ActivateJob.activateObjects(ActivateJob.java:116)

at com.sap.ndb.studio.modeler.job.type.activate.ActivateJob.run(ActivateJob.java:90)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: java.io.IOException: com.sap.ndb.studio.sdk.resource.base.exception.ResourceException: java.io.IOException: Error loading object, refer to Repository Log for more information

at com.sap.ndb.studio.sdk.resource.repository.core.impl.AbstractResourceController.load(AbstractResourceController.java:608)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.load(MDResourceController.java:647)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.getModelObject(MDResourceController.java:167)

... 6 more

Caused by: com.sap.ndb.studio.sdk.resource.base.exception.ResourceException: java.io.IOException: Error loading object, refer to Repository Log for more information

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.deserializeRepositoryFile(MDResourceController.java:638)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.AbstractResourceController.load(AbstractResourceController.java:601)

... 8 more

Caused by: java.io.IOException: Error loading object, refer to Repository Log for more information

at com.sap.ndb.studio.sdk.resource.base.DBRepositoryURIConverter.createInputStream(DBRepositoryURIConverter.java:130)

at com.sap.ndb.studio.sdk.resource.base.DBRepositoryURIConverter.createInputStream(DBRepositoryURIConverter.java:65)

at com.sap.ndb.studio.sdk.resource.repository.MDResource.load(MDResource.java:156)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.loadMainResource(MDResourceController.java:264)

at com.sap.ndb.studio.sdk.resource.repository.core.impl.MDResourceController.deserializeRepositoryFile(MDResourceController.java:635)

... 9 more

Thanks alot!

Arpita

former_member184768
Active Contributor
0 Kudos

Hi Arpita,

You don't need to declare dummy as it is a standard object (like dual in Oracle). Can you please try to right click on the object in the navigator pane and select "Revert to Active". Please let me know if it works.

If it is a script based Calc view, it is always good to copy the code to notepad file and paste it in the script. 🙂

Regards,

Ravi

arpitasethi
Explorer
0 Kudos

Hi Ravi,

I did not have any active version..

Still had tried reverting, and it didnt help..

Thanks,

Arpita

arpitasethi
Explorer
0 Kudos

Hi Ravi,

This seems like an issue and the concerned team is working on that.

Thanks for all the inputs!

Arpita

0 Kudos

Hi Arpita,

I'm facing the same issue.

So whether your original issue is resolved now ??

Do let me know what was the solution for that.

Regards,

Sunil

arpitasethi
Explorer
0 Kudos

Hi Sunil,

I was not able to execute the code due to system issues, but as Ravi suggested.. using

var_out = select :int_id, :ext_id from dummy;

did not give me syntax errors!

Regards,

Arpita

Answers (0)