How to create a procedure in XSJS dynamically in hana - sap

i have created an application in which i m calling xsjs file from the browser and in that xsjs file i am calling a normal sql procedure.In that procedure after some validations i m calling R procedure. My requirement is to create that R procedure in the user schema when the user call the xsjs file.And call statement for that R procedure should be updated in sql procedure.So basically everytime a user calls xsjs file the R procedure should be dropped and created again in the user schema.I am using SAP hana studio latest version.

If you want to execute dynamic SQL in SAP HANA, you can use EXECUTE IMMEDIATE SQL command that will work in read and write procedures. You can build SQL query to create a new procedure in xsjs, send this query to a read and write procedure in which you have to use EXECUTE IMMEDIATE QUERY to get your procedure created and same can be done for deletion as well.

Related

Can I execute a stored procedure every month automatically without creating a job?

I do not have access to SQL Server Agent and would like to execute a stored procedure monthly from SQL Server Management Studio 14. I am trying to insert the syntax for a stored procedure that will ensure it will be executed anytime I log into the client.
How would I do this?

Getting fields from SQL Server Stored Procedure

I'm trying to build a transformation in Kettle that gets FIELDS from a SQL Server Stored Procedure and inserts it in a MySql table.
The problem is that I can't find a way to get stored procedure "fields". I understand that Call DB Procedure task expects in/out params, and that's not my case, so I'm trying to use "Execute SQL Statements" with the following SQL:
exec credisfera.dbo.sp_insere_parcelas #dt_ref = '2016-05-03'
Is there a way to achieve this?
Simply put the exec statement in a Table input step. Upon execution (or "Output fields...", PDI will get the metadata from the JDBC driver.

Execute Stored Procedure on every month-end

I have written a stored procedure where data with-in a particular data range will be extracted and dump into a temp table. I want this procedure to be called by running a .bat file and prompt user to input From and To dates. Any approach I can use?
Is it important which user executed that procedure ? If it is not you can create scheduled Sql Server agent job.

Execute a stored procedure using SQL Server 2008 in SSIS

I want to execute a stored procedure using a SSIS package.
The output that generates from this stored procedure will also a script, so I want to execute that script output too. Can I schedule this SSIS package using SQL Server Agent?
You can execute a stored procedure in an Execute SQL Task in SSIS and send the output to a variable. You can then read the content of that variable in a second Execute SQL Task.
And yes, you can schedule the package to execute via a SQL Server Agent job. See this link for details.
Cheers -

Create Stored Procedure in Access 2007

Is it possible to create an Stored Procedure in Access 2007? If it is, how can i do it?
Thanks
You could save queries with parameters that works much like a SP.
You can created stored procedures in Access. I use Access 2007. I'm not sure of the capability in Access 2003. I've created stored procedures using the following process:
Create a query that performs the action you wish to take (Create(MakeTable), Read(Select), Update, Delete). Setup parameters if used. This query is for use as a template. You don't need to keep.
Switch query to SQL View and copy the query.
Use Cntl-G to switch over to Visual Basic. Use either the immediate window or create a subroutine using Insert | Procedure.
Paste your query and setup the following syntax to create the stored procedure.
CurrentProject.Connection.Execute "CREATE PROC sp_storedProcedureName (parm1 Text, parm2 Integer, whatever other parms & datatypes) AS sqlStatementFromQueryGoesHere;"
Run from immediate window or procedure. It should run clean if no errors.
Then go back to the Navagation pane and refresh (the stored proc won't show originally without refresh). Once refreshed, you have your stored proc showing in the queries category