Using Process Flow variable on sqlplus activity
Hellow all,
I´m trying to use a OWB 10gR2 variable (called LAST_RUN) as an input to a Sqlplus activity.
I tried using PARAMETERS_LIST and binding the variable; created a new parameters; but i was not succesful.
The script of the SQLPLUS activity is something like:
SELECT COUNT(1) from T_ACTIVITIES WHERE LAST_UPDATE >= :LAST_RUN;
EXIT;
Where LAST_RUN is my process flow variable.
How do i call a process flow variable inside the sqlplus script?
thanks,
Hi,
I too had faced this problem earlier, it remember we passed a inut parameter to the script like @scriptname input_param1,input_param_2,input_param3 etc.
however we later had faced few other problems while implementing sql plus acctivity. so we chose to write a stored procedure having all the logic of sql activity and called it from process flow.
Similar Messages
-
Process Flow: variable checking/email parameters
I'm new to using process flows and it seems to me that I want to something very simple.
I've created a boolean variable VAR1 (default is FALSE) which I want to assign depending on warning/failure of 2 mappings (not sure if using a variable is the correct way to go).
So in my process flow, I call MAPPING1. On success, it calls MAPPING2.
To bring more into it, if MAPPING1 produces a warning or error, then through an 'assign' activity (I think it should be an assign activity), VAR1 is set to TRUE.
It returns back to process MAPPING2 (this same error handling occurs for MAPPING2).
At the end, a CHECK on VAR1 needs to be performed.
If VAR1=FALSE then end (success!).
If VAR1=TRUE then call a function to grab the audit records for the error, and send an email, then end.
My problems are
(1)what activity in the pallete should I use for CHECK (which checks whether VAR1 is true/false)?
(2)how do I read the VAR1 variable... I've been experimenting a whole load but nothing!
(3)if VAR1 is TRUE and calls the function, how does the email activity receive the output from the function? (I've managed to get email working ..hurrrahh!)
Thanks for any help... much appreciated
AnselHi,
Have you tried using conditions on your transitions?
You can have in total three different endings to your process flow, end_success(in the process flow by default), end_warning and end_error. If you also include to 'or' operators in your processflow you can use these to collect the warning transitions,and between the or operator and the end operator you can put your email activities without having to use a if statement.
Ragnar -
How to use substitution variables in sqlplus activity of process flow
I have a process flow that does nothing more than create a couple of packages that I cannot successfully deploy from OWB. A workaround, not something that I want to do, but currently there is not much time to adjust the packages so they can be deployed from OWB.
I can successfully create the packages from files that are present in a directory on the server. But the location (directory) is not the same in all cases (OTAP). So I thought to use an input parameter to the process flow (named TELLINGEN) and use that in the sqlplus activity.
I have created the parameter START_PATH with a default value.
I have added an sqlplus activity and placed the following into the PARAMETER_LIST variable of the activity:
?${Target.ConnectString}?@${TELLINGEN.START_PATH}/npl_dbug.pkg?
When I run the process flow I see the following in the output:
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Mar 18 18:10:14 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SP2-0310: unable to open file "${TELLINGEN.START_PATH}/npl_dbug.pkg"
SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release
10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
It obviously connects to sqlplus but then cannot find the file. Presumably because the variable has not been substituted.
How can I persuade the activity to substitute the variable?
Kind regards,
Eric.Have been reading around a bit and found the (a) solution:
I placed the following in PARAMETERLIST:
?${Target.ConnectString}?@${Working.RootPath}/base64.sql?
And it turns out ${Working.RootPath} is pointing to the location you can provide under the configure for the sqlplus activity in the process flow. Just as you have to provide the target destination as indicated here: Re: SQLPLUS Activity in Process Flow
From the documentation it was not immediately clear to me where Working.RootPath was pointing to. -
Manual Commit using Process Flows
Hi,
I have 2 mappings, each with commit control property set as 'Manual'. I created a process flow to run these mappings. Following the instructions in the OWB user guide, I added a single SQLPLUS activity in the process flow, and entered the following in the 'SCRIPT' parameter of the SQLPLUS activity :
DECLARE
status VARCHAR2(30);
BEGIN
SCHEDULER_TESTING.main(status);
IF status!='OK' THEN
ROLLBACK;
ELSE
ERROR_LOG_TESTING.main(status);
IF status!='OK' THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END IF;
END;
When I deploy and run this process flow, it shows the execution as successful (COMPLETE:OK) in the control center. But when I check the target tables, no records have been inserted.Also, when I check the execution job report in the repository browser, it shows the status as 'Complete:Failure' ,without displaying any error message.
There is no problem with the mappings, as executing them independantly gives the desired result.
Any idea what is going wrong?
Thanks and Regards,
AmitOK, well from the process flow perspective your script exited normally which is why it shows the sqlplus activity as having completed properly. You would need an exit variable in the script that the activity's outgoing transformation was checking to in order to have the process flow know that a failure occurred. Because whether the mappings succeed or not is not known to the process flow from this script.
But the other problem, of course, is why the script isn't running the process flows properly, but you haven't any way to determine this without doing some logging from the script.
Perhaps, as a quick and dirty testing idea you could create a table proc_log(msg varchar2(500) and amend your script to:
DECLARE
status1 VARCHAR2(30);
status2 VARCHAR2(30);
BEGIN
SCHEDULER_TESTING.main(status1);
IF status!='OK' THEN
ROLLBACK;
ELSE
ERROR_LOG_TESTING.main(status2);
IF status!='OK' THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END IF;
insert into yourSchema.proc_log('Status for scheduler_testing: '||status1);
insert into yourSchema.proc_log('Status for error_log_testing: '||status2);
commit;
EXCEPTION
when other then
rollback;
insert into yourSchema.proc_log('EXCEPTION: '||sqlerrm);
commit;
END;
just to try and see what is happening in there.
Now, to put an exit variable into your script you would need to do something like:
variable exec_return_code number;
DECLARE
-- we'll use 0 for success and 1 for failure
returncode number := 0;
status VARCHAR2(30);
BEGIN
SCHEDULER_TESTING.main(status);
IF status!='OK' THEN
returncode := 1;
ROLLBACK;
ELSE
ERROR_LOG_TESTING.main(status);
IF status!='OK' THEN
returncode := 1;
ROLLBACK;
ELSE
COMMIT;
END IF;
END IF;
:exec_return_code := returncode;
END;
exit :exec_return_code;
I haven't tried this yet, but it would be the only way I could think of to have any sort of success/failure returned from a sqlplus activity to the process flow.
Cheers,
Mike -
Process flow variable question
I have created a variable in process flow and want that variable to have a variable of
TO_CHAR(SYSDATE,'YYYYMMDD')
I put the above line in the value but it does not work. If I put the hard code value in the variable as 20090724 it works. I am using this variable in a while loop condition.
Any ideas.
ThanksFor the variable, do you have the Literal property set to false when you define the initial value?
Also is the OWF schema you are deploying the process flow to a target OWB user? It has to be in order for the variable expression to be evaluated correctly.
Cheers
David -
Problem in external process using process flow
Hi All,
I want to execute a batch file ( which is appending 2 text files ) using OWB process flow.
For this i am using external process in OWB process flow and giving the parameters for external process as below:
COMMAND --- VALUE as c:\winnt\system32\cmd.exe
PARAMETERS_LIST --- VALUE as ?c:\\fileappend.bat
when i execute the process flow....it is showing
Completion Status Completed successfully
Starting Execution BATCH_PROC
Starting Task BATCH_PROC
Starting Task BATCH_PROC:EXTERNALPROCESS
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\owb\owb\bin\win32>
C:\owb\owb\bin\win32>
WARNING: Log file truncated - see RAB for further information.
Completing Task BATCH_PROC:EXTERNALPROCESS
Completing Task BATCH_PROC
Completing Execution BATCH_PROC
But i couldn't see the result, means the files appended.
It is working when i execute the batch file through MS-DOS.
Please let me know is there any other necessary steps i need to take.
Thanks in advance
MalliHi Malli,
Because you are using an external process you do not need to specify the cmd command to perform the execution. You can just put the call to the batch file you have in the command string and that is it. Beware that the working directory is <owb home>\owb\bin\win32.
Mark. -
Passing parameters from mapping to mapping with in process flows
I am new to OWB and i would appreciate if any one can suggest me on how to solve the issue i have.
I am trying to pass a parameter from one mapping to another mapping.
ex: key need to be passed
start ----->A--->B--->C----->END
B needs to pass the key to mapping C
In B i have mapping Out put parameter and in C i have a mapping input parameter.
In process flow palatte i could see Key as OUT and in C properties i could bind it to Key .
but i try to deploy this mapping i am getting error below
PF_PKG Create Error
RPE-02040: Internal error: KEY cannot be converted to a constant value. Please correct the value. If the problem persists then please contact Oracle Support with the stack trace and details on how to reproduce it.
TEST_PFCreate INFORMATIONAL
RPE-02071: Deployment has been aborted due to a previously reported critial error.
please suggest me how to pass parameters between mappings with in a process flow.Hi
You have to use process flow variables. So the output of map A, say parameter P would bind to variable V and then the input of map B, say Q would bind to variable V. In this way you can push parameters from one activity to the other. Although the UI lets you bind B.Q to A.P, it should not, I think there is a bug reported on this.
Cheers
David -
RPE-02248 SQLPLUS activity disabled from DBA for security reasons
Hi,
that's the error message I get when I try to run a process flow containing a SQLPlus activity.
The message seems pretty clear.
Only question is: and now??
I can't find any reference to this error anywhere...
Oracle 11 on Windows Vista.
Kind regards,
CorradoChange the setting of
property.RuntimePlatform.0.NativeExecution.SQLPlus.security_constraint
from DISABLED to NATIVE_JAVA in Runtime.properties found in
<OWB_HOME>\owb\bin\admin (where the control center service is running not the client) then restart the control center service.
(Using information from metalink note 377491.1)
Regards,
Robert -
Hi,
I have a simple process flow calling other process flows with the ROUTE activity. My PF validates fine with 3 out transitions (complex expressions) and 1 Transition to End Activity. I'm trying to add new out Transition based on complex expression I'm getting the validation warning.
PF_START WarMsgKey VLD-10007: Activity ROUTE has outgoing transitions with duplicate conditions defined, thus making the process flow ambiguous.
VLD-10007: Activity ROUTE has outgoing transitions with duplicate conditions defined, thus making the process flow ambiguous. The only allowed conditions are "SUCCESS", "WARNING", "ERROR", "UNCONDITIONAL", and the transitions on any activity are always evaluated in this order , thus having duplicate transition conditions will make the flow invalidate the process flow.
I verified route transitions and all the 4 conditions are different. Does anyone has had the same problem.
Thanks
-DvvBHi Nawneet ,
Thx for ur suggestion. I can't use fork since I need to conditionally execute PFs based on my input.
I did the following to achieve the result.
Start -> Route
variable = 1 Transition to PF 1 -- End Success/Failure
Variable = 2 Transition EXECUTE pf 2 -- End Success/Failure
Variable=3 Transition execute PF 3 -- End Success/Failure
Default Transition to End Success
Default Transition to ROUTE 2
variable = 4 Transition Execute PF4 -- End Success/Failure
Default Transition from ROUTE 2 -- End Success/Failure
Thanks
-DvvB -
How to combine text with variable in process flow
Hi,
I have created a function that returns the environment that a process flow is running in, Production, Test or Development. I have been able to bind the output of the function into a variable in a process flow and bind the variable to the subject of an email activity. I'd like to go one step more and combine the value of the variable with some text to explain which step in the process flow generated the email. Is there a way to concatenate text to a variable or to add an OWB system variable? I've seen an example where the subject of the email is
"Failed mapping <mapping name>"
but I want my subject to be "PROD Failed mapping <mapping name>" where the "PROD" is from a process flow variable or function return value.
Is this possible?
Thanks
Don KeyesHi Don,
you can perform this task with ASSIGN activity.
For example, you have two variable V_ENV_TYPE (with type of environment) and V_TEXT ("Failed mapping <mapping name>"). Define additinal variable V_NEW_TEXT, bind Variable parameter of Assign activity to V_NEW_TEXT variable and define value in Assign activity as
V_ENV_TYPE || ' ' || V_TEXTRegards,
Oleg -
How to set FROM ADDRESS for EMAIL activity in Process Flow
Hi all,
Can any one tell how to set(which address) FROM ADDRESS for EMAIL activity in Process Flow?
Thanks,
SuvviDid you set what OWB guide says:
To execute a process flow with an email activity, you may need to access different host machines and ports. New security measures implemented in Oracle Database 11g Release 1 restrict access to hosts and ports. You must explicitly grant access to hosts and ports that the email activity accesses using the DBMS_NETWORK_ACL_ADMIN package.
For example, the user OWBSYS needs to send an email through the mail server mail.example.com using port 25. The DBA must perform the following steps:
1. Create an Access Control List (ACL) for the user OWBSYS using the following command:
EXECUTE DBMS_NETWORK_ACL_ADMIN.CREATE_ACL
(’acl_for_owb_cc.xml’,’ACL for Control Center’,’OWBSYS’,’CONNECT’);
The ACL has no access control effect unless it is assigned to network target.
2. Assign the Access Control List (ACL) to a network host, and optionally specify a TCP port range. Use the following command:
EXECUTE DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (’acl_for_owb_cc.xml’,’mail.example.com’,25)
3. Commit the changes made using the COMMIT command. -
How to run shell script using External Process in Process Flow?
Hi,
We can run external process using Process flow.
I would like to run shell script as external process in Process flow.
Could any one please explain it?
Thanks and regards
Gowtham Sen.HI,
As you said I tried this case. I got the following error. The script is running successfully while I tested at unix command prompt.
The error is as follows..
tarting Execution PFPS_SMPL_RUNSHELL
Starting Task PFPS_SMPL_RUNSHELL
Starting Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS
/SOURCE_FILES/CollectFiles.sh: line 1: ls: command not found
/SOURCE_FILES/CollectFiles.sh: line 1: wc: command not found
/SOURCE_FILES/CollectFiles.sh: line 1: ls: command not found
Completing Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS
Starting Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS_1
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Sep 29 22:57:39 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Completing Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS_1
Completing Task PFPS_SMPL_RUNSHELL
Completing Execution PFPS_SMPL_RUNSHELL
My scenario is---
I am trying to return a file name from one shell script. I created a external process for that. After completion of this process, I am running another script which takes that file name and trying to create a external table. The both scripts are runnning successfully. But while I am trying to run using process flow, its not coming.
And I am not getting the way to catch the output of external process and pass it as parameter as another external process.
Any suggestions are welcome.
Thanks and regards
Gowtham Sen. -
Where is a process flow's Execution details - Log section stored ?
Hi,
We're using OWB 11.2.0.1.7.
I want to know where in the database the Execution Details for a process flow is stored.
When i run a process flow with a Java Activity, or a User Defined Activity, and it halts with an Error i can inspect what went wrong in the process flow by opening the job in the Control Center client.
I doubleclick on the name of the job in the Control Center, the Job Details window opens.
I click on the first node, that is the name of the Job(process flow).
Then you click on the blue I aka 'Display Details'.
That window has a tab called Log.
The Log tab shows information that Java/Userdefined activity returns.
(In my case return info from a javabased xmlparser, or exitinfo from a shell command.)
This is the only place where i can find this info unfortunately.
I want to know where this info is stored in the database. I tried the runtime audit vews such as:
select e.*, m.*, l.*
from owbsys.wb_rtv_audit_executions e
LEFT JOIN owbsys.wb_rtv_audit_messages m ON e.audit_execution_id = m.audit_execution_id
LEFT JOIN owbsys.wb_rtv_audit_message_lines l ON l.audit_message_id = m.audit_message_id
left join owbsys.wb_rtv_audit_message_params p on p.audit_message_line_id = l.audit_message_line_id
But although i can see my processflow i can not find the Log information here.
Can someone tell me where this info is stored ?
Edited by: MichaelR64 on 6-apr-2011 14:01Hi Michael
The standard output and error streams for the Java activities are stored in
-> ALL_RT_AUDIT_EXEC_FILES
Is this what you are after?
You can see the doc for it in the runtime public views section;
http://download.oracle.com/docs/cd/E11882_01/owb.112/e10584/api_2runviews.htm#i707034
The FILE_TYPE column will be set ot JavaErrorStream for example, with the information that was written to the Java std error stream, and JavaOutputStream will have the Java std output stream. This same technique is used for other activities - SQLPlus, SQLLoader, FTP.
Cheers
David -
Process Flow Parameter Binding.
The docs on using process flow parameters are a bit sparse, so I wonder if anyone else has some input.
We kick off our ETL processes by an external enterprise scheduling tool due to several remote dependencies. This tool provides us with an audit id that we want to tag all of our current rows loaded with. Now, creating input parameters on the mappings is easy, but the docs seem to indicate that a parameter passed into a process flow can only be bound to one location. Given that our process includes a few hundred mappings, this would require the input parameter be input several hunderd times with each instance bound to a single mapping. That is not a maintainable option. Similarly, any documentation on passing OUT parameters from mappings to subsequent mappings seems entirely absent, so I'm not sure if I can "daisy chain" passing this parameter along.
Which, at this point, leaves me with passing in the variable to the process flow, having the first step be a SQL call that saves this ID to a table, and then having each mapping query this table for the audit ID in a pre-mapping procedure to use to tag the rows. The Process Flow will also have to have a closing SQL script to clear the audit id out of the table.
Is this my best option? Or does anyone have a better idea?
Thanks,
MikeIn 9.2, parameters were added by way of the property sheet for the Start activity.
In 10.2 what you do is, in the Explorer portion (the top section) of the palette you select the "Start" activity. If you then look at the top bar of the Explorer portion of the palette you will note that the leftmost icon (a green plus sign over a folder) is enabled. This is the Create button which, when pressed, will create an input parameter to the process flow. This paramter may then be used as a bind variable by other activities in the process flow.
Cheers,
Mike -
Loop-Construct in Process Flow
Hi,
there are new constructs in OWB 10g Release2 in process editor.
Just try to create a process flow with one mapping and a For-Loop-Construct but it does'nt work. Is there anybody use this feature?
I don't know, what fill into initial value, next value etc.
Thanks a lot
Connyyou can have global variables in process flow.
highlight the start activity.then in bottom left panel add parameters and their type. these need to be passed runtime. these will be global variables to the processflow.
hope this helps
thanks,
kamal
Maybe you are looking for
-
Hi Gurus Would anybody please tell me what is the meaning of mapping in BW? when actually it takes place ? Appreciate your help. Kris
-
I spoke to a nice woman in Apple Support. They apparently have no fix for the messed up icon problem, meaning icons and apps don't match. Has anyone figured out their own fix?
-
i need help please !!!! i can open my applications folder on my dock but not in my finder in my finder i click on the applications and it takes me to my iphoto and i cant put anything in my applications folder either but i can take things out ??? wh
-
Hi, I have written a program that takes the email id and password from a jsp page and posts it to a servlet. The servlet had to get the parameters from the jsp and pass this values to a method called loginvalidation which inturn h
-
Final Cut Studio 7 on iMac i5 or i7 = any real performance differencies?
I'm in for an iMac i5 for use with Final Cut Studio. Footage is SD (DVCPRO50) and, soon, 720pN25 over DVCPRO HD. Will the i7 give noticeable better rendering time and overall better performance than the i5? There'll be 8 GB RAM (for a start).