Can Autosys Job exec a Stored procedure with dynamic parameters - stored-procedures

Can Autosys jobs execute a stored procedure with dynamic parameters

Yes. You will most likely need to create a shell script that takes the parameters, authenticates to your database, calls the stored proc, and passes it the parameters. Then script your jil to execute the shell script with the desired parameters.

Related

Can I run an external file in a Snowflake stored procedure?

if I have an R script that generates a table and I wanted to insert that into an existing datatable in Snowflake every day, could I automate that using a stored procedure?
Is there some functionality that could run my R script for me within the procedure? Could a javascript procedure do so?
If you want to run R scripts from Snowflake, the best you can set up is an external function:
https://docs.snowflake.com/en/sql-reference/external-functions-introduction.html
Basically set up a web server (or so) that can run the R script, and then you can tell Snowflake to call that server on a schedule with a task:
https://docs.snowflake.com/en/user-guide/tasks.html

Active Choice Parameters are not available in env when using Execute Shell as a build step

I'm using Active Choice Parameters successfully to define parameters with options that change dynamically, reacting to other parameters values, with custom HTML etc.
Unfortunately, the values of these parameters are not available at job builds as env-vars, while regular parameters do.
If I print env within the Execute Shell build step, I see all regular parameters and their values, but not the "active" ones.
How can I make these active parameters so that they would be available as environment variables in a shell execution?
I'm using Jenkins v2.278
When using Active Parameters with custom HTML inputs, in order for the value to be passed to the builds, the input must contain the following HTML attribute: name="value", e.g. <input name="value" />

Jenkins allow comma separated values to be passed one by one to generate job dsl

I have a seed job which takes in a parameter say project and invokes a "Process Job DSL" to create the generated jobs.
However, I need to do the same for multiple projects.
Wondering, if there is a way in Jenkins for me to provide the list and it iterates through each of those choices and create its job.
I looked into Extended Choice Parameter but that too passes all the parameters at once.
I am interested in a way that it iterates through the loop.
I recently wrote a python client that wraps python-jenkins to do just this. The caller supplies the dsl file and the url to the jenkins server. The python client then calls the seed job, passing the dsl file as the argument. The seed job is just:
node {
stage('create-job') {
jobDsl failOnMissingPlugin: true, scriptText: params.jobDsl
}
}
To turn it into a loop, you would just iterate over the list of projects and invoke the client for each project.

JMeter: more than nine parameters from Jenkins

I am trying to pass more than nine parameters from Jenkins to JMeter4.0.
As I was reading, I found out that JMeter does not accept more than 9 parameters. As a workaround, I want to pass all the parameters as a string and split it in JMeter BeanShell.
java -jar -Xms512m -Xmx2048m C:\JMeter4\bin\ApacheJMeter.jar -Jjmeter.save.saveservice.output_format=csv -Jjenkinsparams="%Timetorun%,%Users%" -n -t %JMeterPath%\bin\tests\tests.jmx -l %WORKSPACE%\Results.csv
The tests run on a Windows machine. From this call I have
jenkinsparams = "300,2"
I use a BeanShell PreProcessor like this:
String line = "${__P(jenkinsparams)}";
String[] words = line.split(",");
vars.put("timetorun",words[0]);
vars.put("users",words[1]);
log.info(words[1]);
log.info(users);
I tried few log.info to check the values. For words[1] I have the correct value sent from Jenkins: 2. For the users the value displayed is: void.
I am trying to use it for Number of Threads as: ${__P(users,1)}.
What am I doing wrong? The values clearly arrive from Jenkins but I have a problem passing it to my variable. Thank you
You don't have a script variable named users, so you should either log words[0]:
log.info(words[0]);
Or you can log the value of JMeter variable called users:
log.info(vars.get("users"));
Or you can assign words[0] to variable called users:
String users = words[0];
log.info(users);
Also you are saving it as variable, not property, so you can retrieve it elsewhere in script as
${users}
The syntax __P refers to property, so if you want to use it as property, you need to change how you are saving it:
props.put("users", words[1]);
If you do that, ${__P(users,1)} should work
Now, if you want to use this value as number of threads, then you need to do this:
Have Setup thread group with 1 thread, and your script
In the script you must save users as property, otherwise it won't pass between threads
Next thread group then can use it as number of threads
As long as your command line fits into 8191 characters it should not be a problem to pass as many arguments to JMeter as you want, here is an evidence from Debug Sampler and View Results Tree listener combination
So keep calm and pass as many parameters as needed via -J command line arguments.
Be aware that starting from JMeter version 3.1 users are recommended to use JSR223 Test Elements and Groovy language instead of Beanshell so going forward please consider switching to Groovy.

Is there any way in Netezza Stored Procedure to put output into file

Is there any way in Netezza Stored Procedure to put output into a file? By output I mean statements from Notice statement in Netezza. Also we can't use any shell or other script because the SP is being invoked via a tool which cannot execute shell scripts but only make DB calls.
There are multiple ways to write these values to a file -
1) Write UDX which can put your statements to disk
2) Every raise notice statement gets log in "/nz/kit/log/pg.log" file, so you need to write a bash which runs with cron or similar tool and extract required information for you.

Resources