Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdb-ext library is not able to call specific procedures #144

Open
Arthesian opened this issue Oct 15, 2019 · 4 comments
Open

hdb-ext library is not able to call specific procedures #144

Arthesian opened this issue Oct 15, 2019 · 4 comments

Comments

@Arthesian
Copy link

I know this project is about node-hdb, but we failed to find the repository for hdb-ext.
If it's available, please let us know.

We have a procedure where input table parameters definition refer to synonyms. These synonyms are created based on tables from another HDI container service.
The procedure definition looks something like below -

"MGMT"."mgmt.access.procedures.collection::PR_UPDATE_COLLECTION_STRATEGY"(
	IT_NEW_COLL_STRAT  <refers table synonym for type definition>
	IT_OLD_COLL_STRAT <refers table synonym for type definition>,
	OT_COLL_STRAT         <refers table synonym for type definition>,
	OV_STATUS_CD     Integer,
	OT_MESSAGE    < some table type>
);

When we call the procedure from the hdb-ext library it gives us us the following error:

Error: Could not create temporary table: #mgmt.access.procedures.collection::PR_UPDATE_COLLECTION_STRATEGY_IT_NEW_COLL_STRAT_1571127570877: invalid table name: mgmt.access.synonyms::SY_SL_COLLECTION_STRATEGY

We found that when we call the procedure which expects table as parameters, hdb-ext library tries to create temporary tables using statement

'CREATE LOCAL TEMPORARY COLUMN TABLE IT_NEW_COLL_STRAT  LIKE <synonym reference from procedure table parameter definition>'

and thats where its failing because as per our understanding LIKE addition in CREATE LOCAL TEMPORARY COLUMN TABLE statement expects db table or table type.

hdb-ext should handle this scenario where procedure could be call when they are defined with parameters referring to synonyms rather than actual db tables.

@Arthesian
Copy link
Author

The below code is located in : @sap/hdbext/lib/sp/TempTable.js

Screen Shot 2019-10-16 at 10 39 13

Our proposed solution is to create the temporary tables even if the references are synonyms.

CREATE LOCAL TEMPORARY column TABLE %s AS (SELECT TOP 1 * FROM %s.%s) WITH NO DATA;

If someone could give us a reference to the original project, that would be much appreciated.

Thanks

@xtough
Copy link

xtough commented Oct 16, 2019

There is no public repository for @sap/hdbext
You should configure @SAP:registry=https://npm.sap.com in your .npmrc and install it from there.

@Arthesian
Copy link
Author

Arthesian commented Oct 16, 2019

Thank you for your response. However I'm well aware how to download and use the package. I'm posting because we are having an issue with that package....

@xtough
Copy link

xtough commented Oct 16, 2019

In that case you should open a support ticket at https://launchpad.support.sap.com/#/incident/create
Component should be BC-XS-JS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants