Passing concurrent parameter to OS script
I have a printer driver that calls an OS script and I want to pass a parameter value to that script from a concurrent program that uses that driver via a specific style.
Is there anyway to reference the concurrent parameter? I'm already passing the filename to the script via $PROFILES$.FILENAME. Is there a similar reference to a parameter value that I could use?
Any help would be much appreciated.
Thanks,
Todd
Hi Todd
I thinh this will only get the concurrent request id what he wants is to send the send the parameter to it.. Will it work.. I am not sure.. Just put my views thats all..
Sunil
Similar Messages
-
How to pass a parameter into RMAN script
Hello,
I have the following rman script :
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\ora_df%t_s%s_s%p';
This script called configure.rman is launch by a .bat script with the following command:
rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman
How can I pass a parameter into rman script, I want to pass an additional directory like this:
rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman v_dir_name
And use it in rman script:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\$v_dir_name\ora_df%t_s%s_s%p';
Is it a way to do this?
Regards,
ElodieOne option would be to create a file called backup.bat with the following:
echo run {
echo CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
echo CONFIGURE CONTROLFILE AUTOBACKUP OFF;
echo CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\%1\ora_df%t_s%s_s%p';
echo } ) | rman target sys/sys12@orcl102and then call the script as:
c:\> backup.bat backup_directory_name -
How pass a parameter with forward slash to plsql script
Hi,
I am trying pass a parameter to plsql script from command line using sqlplus, and the parameter is a file directory and has '/'. Seems the system couldn't recognize the value.
here is my code in DECLARE:
l_FileDir VARCHAR2(200) := &&FileDir ;
I pass value '/usr/tmp' (with the single quote in the string)
Can someone tell me how I do it?
Thanks,
Kate
Edited by: user12100435 on Feb 25, 2010 8:31 AMuser12100435 wrote:
I think you are right. The issue is not file-separator character issue. because the exact same script run in another envoironment. And it's not file directory or permission issue because if I use hardcoded value, the code works fine.
The error message is invalid File directory.
Here is the related part of the code.
-- open file handler
IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
UTL_FILE.FCLOSE(l_FileHandler);
ELSE
l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
filename => l_FileName,
open_mode => 'W',
max_linesize => 32767 );
END IF;Ok, based on your input so far, I have cooked up a simple testcase.
Make sure you are doing something similar to this -
test@XE>
test@XE> -- show the contents of the anonymous PL/SQL script
test@XE> -- You are probably passing two parameters - the file location and the file name
test@XE> --
test@XE> ! cat test5.sql
DECLARE
l_FileHandler UTL_FILE.FILE_TYPE;
l_FileDir VARCHAR2(200) := '&1' ;
l_FileName VARCHAR2(200) := '&2' ;
BEGIN
-- open file handler
IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
UTL_FILE.FCLOSE(l_FileHandler);
ELSE
l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
filename => l_FileName,
open_mode => 'W',
max_linesize => 32767 );
UTL_FILE.PUT_LINE(file => l_FileHandler, buffer => 'Hello, World!');
UTL_FILE.FCLOSE(file => l_FileHandler);
END IF;
END;
test@XE>
test@XE> -- execute it
test@XE> @test5.sql '/usr/tmp' 'first.txt'
old 3: l_FileDir VARCHAR2(200) := '&1' ;
new 3: l_FileDir VARCHAR2(200) := '/usr/tmp' ;
old 4: l_FileName VARCHAR2(200) := '&2' ;
new 4: l_FileName VARCHAR2(200) := 'first.txt' ;
DECLARE
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at line 10
test@XE>
test@XE> -- Create a directory object that points to "/usr/tmp"
test@XE> create directory log_dir as '/usr/tmp';
Directory created.
test@XE>
test@XE> -- now invoke the script
test@XE> -- Note - I pass the value "LOG_DIR" in uppercase. That's the name of my directory object.
test@XE> --
test@XE> @test5.sql 'LOG_DIR' 'first.txt'
old 3: l_FileDir VARCHAR2(200) := '&1' ;
new 3: l_FileDir VARCHAR2(200) := 'LOG_DIR' ;
old 4: l_FileName VARCHAR2(200) := '&2' ;
new 4: l_FileName VARCHAR2(200) := 'first.txt' ;
PL/SQL procedure successfully completed.
test@XE>
test@XE> -- Since my Oracle client is on the same machine as the Oracle server, I can check
test@XE> -- this file "/usr/tmp/first.txt" quite easily
test@XE>
test@XE> ! cat /usr/tmp/first.txt
Hello, World!
test@XE>
test@XE> isotope -
Error while passing parameter(quoted string parameter ) to sql script
Hi all,
I have a master script insert_attribute_single.sql which takes 6 parameter. when i am using in sql prompt
SQL>@@INSERT_ATTRIBUTE_SINGLE.SQL 'LEED PROJECT START DATE' 7 'N' 27265185 '7'22'008' NULL;
then it is giving error for the 5th parameter. and i need to pass 5th parameter '7'22'008' in this.
in the master script it is giving error - ORA-06550 here.
dbms_output.put_line('Processing attribute : &1 Project : &4 Char value : &5 Numeric Value : &6 ' ) ;
can you please help me to resolve this with single quotes in string.
Thanks in advance.
regards
shyam~Here is my sql file:
declare
a_Var VARCHAR2(10) := '&1';
begin
dbms_output.put_line(a_var||','||'&2');
end;
/Here is how I am calling the sql file with parameter values containing quotes in itself:
SQL> @@d:\a.sql '12''''23''''23' '123'
old 2: a_Var VARCHAR2(10) := '&1';
new 2: a_Var VARCHAR2(10) := '12''23''23';
old 4: dbms_output.put_line(a_var||','||'&2');
new 4: dbms_output.put_line(a_var||','||'123');
12'23'23,123
PL/SQL procedure successfully completed.
SQL> -
How to pass IN parameter as BOOLEAN for concurrent program in Apps(Environ)
hi all
i am using a standard package procedure,where in which i need to pass some parameters to a procedure,
some of the parameters there are BOOLEAN type ,can anybody help me to know , How to pass IN parameter as BOOLEAN for concurrent program in Apps(Environ)Already answered this on the SQL forum (How to give IN parameter as BOOLEAN in a concurrent program.
-
Passing Time Parameter to a SQL Script
I am trying to create an SSIS package that will extract data from a non BPC database to load into BPC. I am calling the package from DM prompting for the time parameter. However, I am having problems passing the parameter to the SQL script. I am using OLEDB Data source task using the SQL command - Using the following scrip where the '?'' is the prompt for the BPC time parameter. Any suggestions on how to resolve would be greatly appreciated.
SELECT
CASE
WHEN LEN(GLAccountNumber)=10
THEN LEFT(GLAccountNumber,6)
ELSE GLAccountNumber
END AS ACCOUNT ,
'F_CLO' AS ACCTDETAIL ,
'ACTUAL' AS CATEGORY ,
RTRIM(CompanyCode) AS COMPANY ,
RTRIM(CompanyDepartment) AS COSTCENTER ,
'FM' AS DATASRC ,
'NON_INTERCO' AS INTERCO ,
'NOMAT' AS MATERIALS ,
'NOPC' AS PROFITCTR ,
'LC' AS RPTCURRENCY ,
CAST(YearNumber AS CHAR(4)) + '.' + MonthAbbreviation AS [TIME] ,
SUM(TransactionAmount) AS SIGNEDDAA
FROM dbo.GLTransactionDimension a WITH (nolock)
JOIN dbo.GLTransactionFacts b WITH (nolock)
ON a.GLTransactionDimensionKey = b.GLTransactionDimensionKey
JOIN dbo.DateDimension c WITH (nolock)
ON b.EntryDateDimensionKey = c.DateDimensionKey
WHERE EntryDateDimensionKey LIKE
CASE
WHEN RIGHT(?,3)='APR' THEN '200904%'
WHEN RIGHT(?,3)='MAY' THEN '200905%'
END
AND RowType = 'T'
GROUP BY CompanyCode ,
DepartmentCode ,
CompanyDepartment ,
GLAccountNumber ,
YearNumber ,
MonthAbbreviation
ORDER BY CompanyCode ,
DepartmentCode ,
GLAccountNumber ,
YearNumber ,
MonthAbbreviationHi Steven,
Use SQL task without parameter
Into DM package into Modify script Build a variable where you will build the entire sql string and of course you will be able to pass also the variable.
After that you will call into Modify scrip something like:
TASK( Yourtask, SQL, "the entire SQL with parameter")
Regards
Sorin -
Passing a parameter to an 'Expect' script
Hi,
Does anyone know how to pass a parameter from a regular Linux shell script to an expect script.
I'm using the standard $1 but the expect script gives me an error.
How does Expect want us to pass parameters to it?
My call to the script and the script are below.
expect -f /home/fhs_clientdata/ftpget/fhs_ftpput_exehfc_expect.sh $FILE_NAME_SOURCEthe Expect script:
spawn sftp [email protected]
set PASSWORD "AbCd46%Z"
expect "password:"
send "$PASSWORD\n"
expect "sftp>" {
send "cd inbound\n"
expect "sftp>"
send "put $1\n"
expect "sftp>"
send "bye\n"
send_user "Done\n"
exit
} "Permission denied, please try again." {
send_user "There was error with th permissions"
exit
}You may need to read the input parameters first, e.g.:
set file [lindex $argv 0]
Then: send "put $file\r"
There is a good example at http://en.wikipedia.org/wiki/Expect -
How to get the parameter from Java Script into the Parameter crystal Report
Hi All,
Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
FYI.
Java script sends the right parameter value.There is no issue in java script.
This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
Please clarify? -
How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable
Hi,
I have been tasked with making a complex package more generic.
To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
So to help articulate my question further I have create a package and database as follows; -
USE [KWPlay]
GO
/****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblTest](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Description] [nvarchar](50) NULL,
CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
I populated this table with a single record.
I unit tested the SQL within SSMS as follows;
SELECT * FROM dbo.tblTest
Result; -
ID
Description
1
Happy
DECLARE @myParam NVARCHAR(100)
SET @myParam = 'Sad'
UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
SELECT * FROM dbo.tblTest
Result; -
ID
Description
1
Sad
Within the package I created two variables as follows; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
Name: strStatus
Scope: Package
Data Type: String
Value: Happy
I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
However when I run the above package I get the following error; -
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
"Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.
The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
errors.
SSIS package "Package.dtsx" finished: Failure.
I also tried; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
However I received the error; -
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
Kind Regards,
Kieran.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/Tried; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
and; -
Result; -
SSIS package "Package.dtsx" starting.
SSIS package "Package.dtsx" finished: Success.
Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/ -
Can we pass paramters in the partition script
Can we pass parameters in the partition script in Essbase. Where the parameters are read by a windows batch file which is executed in windows environment.
Our Business requirement, the business will key in the parameters ie(Month and Year) in a partition script dynamically.
We are scheduling the partition script through Windows Batch file.
So is it possible to create a parameter file in windows and pass these parameters to windows batch file.It should be dynamically mapped with partition Script.If possible,can anyone provide sample script to show how it works.Thank You Wills. The requirement is the users want to change the mappings in the partition script, but users are not having any access to the EAS. They want the mappings to be dynamically changed in the partition script on adhoc basis.
Admin can change the values to the substituion variables, but the requirement is users wants to change the mappings.
So they asked for the parameter file. -
Can I pass a parameter to a mapping without using a process flow?
I have to load data from multiple countries at different times. Rather than creating an individual mapping for each country, I want to create 1 mapping and pass the country code as a parameter to the mapping. I tried to use an input parameter in the mapping and add a custom parameter to the sqlplus_exec_template hoping the custom parameter would pass to the mapping input parameter but it's not working. No data loads.
When I add a default value to the input parameter, the data loads but this isn't the solution I need. The value of the parameter will vary depending on the country so I can't use defaults. Since the mappings load automatically, I need the script to be able to pass the parameter in.
I'm trying to avoid going through a process flow because that just seems like overkill for what I need to do. I just want to load all the data where country code = 'X'. Is this even possible?o.k. I tried everything to see which would be the best scenario.
Zeppo - I can't use your solution because ".main", I believe, applies to an older version of OWB. We have 10g. I know in 3.1 ".main" applies because I still have mappings from that version. Doesn't apply to 10g.
Sutirtha - I set the property for the prompt but it still didn't work.
MccM - Yes, the premapping process works perfectly. Only thing is that I have to come up with so many different scenarios in the If then else logic. Giving me a migraine ...
.... so ....
I punked out and created a table that stores all of the load times by country code. In the joiner, I linked the table's country code to the country code in my view and only retrieved data where the table's load hour equals the sysdate hour. Now all I have to do is change an entry in the working table if I need to reschedule a load.
It's cluggy but it works ... and I met me goal of only using 1 mapping.
Thanks to all of you for providing your input. Much appreciated. -
Pass output parameter from mapping to external process in a Process Flow
In Process flow, how do we pass an Output parameter from a mapping (generated by a post mapping operator) into an external process (shell script)?
I have a mapping that generates an output parameter and I would like to pass this parameter to an external process (a shell script) with a process flow. Is this possible?Hi Norman,
Unfortunately in the current release, you cannot do this. What you can do, is store the value into a table and read it in the external process, or write it into a file and read it from there. The next release will support passing output parameters from one activity to the next.
Thanks,
Mark. -
How to send file as a parameter to php script
Hi,
Can any body help me to send the file as a parameter to php script. I am using the HttpURLConnection method.
ThankString msg= "name=" + strName + "&surname=" + strSurname;
byte[] msgAsBytes = msg.getBytes();
I am able to pass the string to the php script as
URLConnection con = url.openConnection();
((HttpURLConnection) con).setRequestMethod("POST");
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
OutputStream oStream = con.getOutputStream();
oStream.write(msgAsBytes);
oStream.flush();and in php, i store into the global variable and it work fine
if(isset($_POST['name' ]&&isset($_POST[' surname'])it works fine for me. But problem is with the file. How can I send the file to php. Please help me. Thanks -
Parameter to shell script using Runtime.exec(string)
Hi all, ( Speciall hi to dheeraj tak )
Briefly : How do i pass an arguement to a non - java executible being called using Runtime.exec.
In detail : i am using Runtime.exec to call a shell script : The code is as follows:
String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh"};
try {
Runtime rt = Runtime.getRuntime();
Process child = rt.exec(callAndArgs);
This works properly & calls the shell script which in turn invokes some other executible (c file).
$HOME/midi/test/build/bin/<C-EXECUTIBLE>
Here i am specifying the name (say hello.exe ) . So far so good.
I want to make this happen dynamiclaly. so i need to pass the name of the executible as a parameter to the script.
To pass a parameter i hav to change the string to :-
String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh <C-EXECUTIBLE HERE>"};
and the script to
$HOME/midi/test/build/bin/$1 --- where $1 refers to argument 1. (C-EXECUTIBLE AGAIN).
This is giving an IO - Execption. Plz help
Code will be very helpful.
Thanx in advancesome 1 plz tell me the difference :-
This is the documentation of Runtime.exec that i found :-
1> exec
public Process exec(String command) throws IOException
Executes the specified string command in a separate process.
The command argument is parsed into tokens and then executed as a command in a separate process. This method has exactly the same effect as exec(command, null).
Parameters:
command - a specified system command
Complete refernce says : Process (String progName) ----- Executes a program specified by programname as a seperate process.
2> exec
public Process exec(String cmdarray[]) throws IOException
Executes the specified command and arguments in a separate process.
The command specified by the tokens in cmdarray is executed as a command in a separate process. This has exactly the same effect as exec(cmdarray, null).
Parameters:
cmdarray - array containing the command to call and its arguments.
Complete reference says : Process exec(String comLineArray[]) ---- Executes the command line specified bythe string in comLineArray as a seperate process.
This means that there is provision 4 command line arguments...
how do u use it then???????????????????????????? -
Passing parameters from plugin to script
I need to pass some parameters from a plugin to a script. I have tried this method:
PMString engineName("myengine");
PMString scriptString("C:/Program Files/Adobe/Adobe InDesign CS4 Debug/Scripts/IterateFolder.jsx");
IDFile scriptFile;
scriptFile.SetString(scriptString);
PMString value("c:/windows");
ScriptData param1;
param1.SetPMString(valor);
ScriptIDValuePair argument1(0, param1);
ScriptRecordData arguments;
arguments.push_back(argument1);
ScriptData result;
PMString errorString;
ScriptData scriptFileData(scriptFile);
int32 errorCode=Utils<IExtendScriptUtils>()->RunScriptInEngine( engineName, scriptFileData, arguments, result, errorString);
The problem is that I don´t really kwno how can I get the parameter in my script. I suppose it must be something like app.scriptArgs.getValue(), but i don´t really know.
Thanks,
AlvaroYou may see scriptArgs object of application
app.scriptArgs
getValue()
Lookign for more detail in object module viewer .
This is a sample on my hand now!
( Code start )
#target indesignserver_myid2
// active all master page items
app.scriptArgs.set( "inputFile" , "/E/indesign/m000/math_2up.indd" );
app.consoleout(" ");
app.consoleout(".................................Script Running...................................");
// get parameters
if( app.scriptArgs.isDefined( "inputFile" ) ){
var inputFile = app.scriptArgs.getValue( "inputFile" );
if( checkFileExists( inputFile ) ){
var inDoc = app.open( new File ( inputFile ) );
activeObjs();
inDoc.save();
inDoc.close();
app.consoleout( inputFile + " Activation page items OK! " );
else{
app.consoleout( "InDesign document does not exists. " + inputFile );
else{
app.consoleout(" No requirement parameters. ");
app.consoleout(" ==============Script End==================");
app.consoleout(" ");
( Code end )
Maybe you are looking for
-
Absolute FASTEST way to transfer files btw 2 computers?
I've set up a network btw 2 airport-enabled laptops--one w/AirPort Extreme, the other w/old-school AirPort. It's taking about 2 hours to transfer 1.5 gb from 1 to the other, using the network... Is there a faster method than this? Thanks! David
-
We are experiencing an issue where we or a client provides us with a video that is a .wmv video, exported from After Effects 5 and it adds almost a second of data less video. What I mean by data less is the video renders out as WMV, 30FPS, 24 Bitrate
-
The "IowaCollegeAid.gov" web site for filling out an application for financial Aid comes up with a window stating their web site will not work properly with my Firefox Ver 12 and it only supports ver 8 or 9. I tried to use Version 12 anyway but it ap
-
Photoshop CC very slow to open after Win 8.1 upgrade
Hi guys. I was wondering can you help me. I have tried extensive google searches with no real conclusive answer. I recently upgraded from Win 8 to 8.1. Since the upgrade Photoshop CC is very slow to open. It can take 1-2 minutes to boot up fully. Li
-
Handing off a call from the iPhone to the Mac using Continuity?
Why can't I hand off a call from my iPhone to my mac using continuity? Am I missing something? Does't seem to allow me to do this, just the other way around. Any suggestions?