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

To use trigger when calling stored procedure #44

Open
abhijaykh07 opened this issue Jan 24, 2020 · 3 comments
Open

To use trigger when calling stored procedure #44

abhijaykh07 opened this issue Jan 24, 2020 · 3 comments

Comments

@abhijaykh07
Copy link

I have a scenario where I am calling stored procedure for bulkImport. So is there any option to call trigger from stored procedure while creating document ?
In trigger there is a pre logic that needs to be executed before document.

@abhijaykh07
Copy link
Author

@mkolt Can you please suggest me solution for this issue ?

@mkolt
Copy link
Contributor

mkolt commented Jan 24, 2020

calling triggers are not supported for operations within script (from sproc, in particular). Since sproc already runs in JavaScript, just execute your pre-logic and then call getContext().getCollection().createDocument(...), adding support for triggers wouldn't add much functionality, just convenience. Does this make sense?

@mkolt mkolt closed this as completed Jan 24, 2020
@mkolt mkolt reopened this Jan 24, 2020
@abhijaykh07
Copy link
Author

calling triggers are not supported for operations within script (from sproc, in particular). Since sproc already runs in JavaScript, just execute your pre-logic and then call getContext().getCollection().createDocument(...), adding support for triggers wouldn't add much functionality, just convenience. Does this make sense?

@mkolt
yes that's the option left as of now, writing the trigger logic before create document in the same stored procedure.

I have also tried while calling from c# end, passing via PreTriggerInclude. But its giving me always an exception "one of the specified inputs is invalid". Do you have any idea for this issue ?
But stored procedure works if I don't pass PreTriggerInclude option.

image

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