How to create OMPplus script with parameters
Hi all. I am trying to parameterize my OMB scripts. For now I am only able to pass one type of parameter, For example in the script below I can parameterize the mapping name. So even If I pass 3 mapping names I will import MDX files and deploy for all 3 mappings.
I want to improve this and I want to pass other parameters such as passwords and schema names also. How would I be able to do that? How can I pass different type of parameters such as schema name, password and mapping name and reference to them separately from the script?
set MAPLIST $argv
OMBCONOMBCONNECT DWPROD/DWPROD@cakir:1521:orcl USE REPOSITORY 'OWBDB_SYS'OMBCC 'MY_PROJECT'
OMBCONNECT CONTROL_CENTER
OMBCOMMIT
foreach mapName $MAPLIST {
OMBIMPORT MDL_FILE 'C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/mappings/$mapName.mdx' USE UPDATE_MODE MATCH_BY NAMES OUTPUT LOG TO 'C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/mappings/$mapName.log'
OMBCOMMIT
OMBALTER LOCATION 'XTRCT_DWEXTRACT_LOC' SET PROPERTIES (PASSWORD) VALUES ('PASSWORD')
OMBALTER ORACLE_MODULE 'XTRCT_DWEXTRACT' ADD REFERENCE LOCATION 'XTRCT_DWEXTRACT_LOC' SET AS DEFAULT
OMBALTER ORACLE_MODULE 'XTRCT_DWEXTRACT' SET PROPERTIES (DB_LOCATION) VALUES ('XTRCT_DWEXTRACT_LOC')
OMBCOMMIT
OMBALTER LOCATION 'XTRCT_DWPROD_LOC' SET PROPERTIES (PASSWORD) VALUES ('PASSWORD')
OMBALTER ORACLE_MODULE 'XTRCT_DWPROD' ADD REFERENCE LOCATION 'XTRCT_DWPROD_LOC' SET AS DEFAULT
OMBALTER ORACLE_MODULE 'XTRCT_DWPROD' SET PROPERTIES (DB_LOCATION) VALUES ('XTRCT_DWPROD_LOC')
OMBCOMMIT
OMBREGISTER LOCATION 'XTRCT_DWEXTRACT_LOC'
OMBCOMMIT
OMBREGISTER LOCATION 'XTRCT_DWPROD_LOC'
OMBCOMMIT
OMBREGISTER LOCATION 'DWEXTRACT_INPUT'
OMBCOMMIT
OMBREGISTER LOCATION 'DWEXTRACT_OUTPUT'
OMBCOMMIT
OMBCC 'XTRCT_DWEXTRACT'
foreach mapName $MAPLIST {
OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN '$mapName' ADD ACTION 'MAPPING_DEPLOY' SET PROPERTIES (OPERATION) VALUES ('CREATE') SET REFERENCE MAPPING '$mapName'
OMBDEPLOY DEPLOYMENT_ACTION_PLAN '$mapName'
OMBDROP DEPLOYMENT_ACTION_PLAN '$mapName'
OMBCOMMIT
puts "Mapping $mapName deployed"
OMBDISCONNECT
Maybe you can try putting this variable list of parameters in a text file and read the text file. You pass the path/name of the text file as a variable:
proc read_file { p_file } {
# Validate file exists
if { [ file exists $p_file ] } {
puts "File: $p_file exists"
} else {
puts "ERROR, not exists: $p_file"
return 1
# open file to read
set v_openfile [ open "$p_file" ]
set data_file [ read -nonewline $v_openfile ]
close $v_openfile
# read each line in file
set v_list_line [ split $data_file \n ]
foreach v_line $v_list_line {
Regards
ANA GH
Similar Messages
-
How to create a view with parameters; read the documentation but nothing!
Hello!
I'm new to the Oracle world but together with my coworkers we need to very quickly study Oracle to figure out whether we'll add Oracle to our list of supported databases or not.
Question: How do I create a view with parameters?
I've read the documentation but I could not find this! I found the sql syntax to create a view but no parameters whatsoever...
I have found on the web some very complicated way of doing this, but doesn't Oracle support Views with parameters?
The goal here is to return a recordset, don't forget, so,please don't speak about stored procedures unless you are going to tell me how to get a recordset out of a stored procedure! ;)
Thanks for all your help and attention!
Jorge C.You can set up a parameterized view via context as follows:
1. Set up a procedure to set your context values:
create or replace procedure p_set_context (p_context IN VARCHAR2,p_param_name IN VARCHAR2,p_value IN VARCHAR2)
as
BEGIN
sys.dbms_session.set_context(p_context,p_param_name,p_value);
END;
2. Create your context using the procedure you just created
create or replace context my_ctx using p_set_context
3. This is the test table I'll use
create table my_table(col1 number)
and populate it:
begin
for v_index in 1..10
loop
insert into my_table values(v_index);
end loop;
end;
and the view that will be parameterised
create or replace view v_my_table as select col1 from my_table where col1 between sys_context('my_ctx','start_range') and sys_context('my_ctx','end_range')
4. Now set the parameters using the procedure above.
begin
p_set_context('my_ctx','start_range','1');
p_set_context('my_ctx','end_range','5');
end;
5. Selecting from my_table will give you 1 to 10 (no surprise there :-) )
selectng from v_my_table will give you 1 to 5
You can use the context to set formats etc using the same principle. A common gotcha to watch for is trying to set the context directly using DBMS_SESSION.SET_CONTEXT instead of creating a procedure. This belongs to SYS and SYS won't have the privileges to set your context so you get an insufficient privileges result leading to much headscratching and unnecessary grants (at least that's my understanding of it).
Sorry Jorge, as you're new to Oracle I should also have pointed out for completeness sake, that you can change the parameters at any time through recalling the p_set_context, for example, following on from above, after your "select * from v_my_table" and seeing 1 to 5, you could then do
begin
p_set_context('my_ctx','start_range','3');
end;
and when you requery 'Select * from v_my_table' you will now see rows 3 to 5.
Bit of a simplistic example, but you can see how easy it is. :-)
Message was edited by:
ian512 -
How to create a function with ref_cursor as parameter in OWB 10.1
Hi,
Can any one help me how to create a function with ref_cursor as parameter in OWB 10.1.?
Its urgent. Please help me.
Thanks,
SivHi David,
Thanks for your reply.
Before going for this function, I need to create a package in transformation node in owb module.
My package is as follows,
Create or replace package 123
type xxx is RECORD ( parameters);
type yyy is RECORD (parameters);
type aaa is table of yyy;
type bbb is REF CURSOR return xxx;
type ccc is record (parameters);
type ddd is ref cursor return eee;
END;
How can I create the above kind of package manually in OWB 10.1 (Should not to import the package)
Please help me its urgent.
Thanks,
Siv -
What is the best way to run a powershell script with parameters in the Task Scheduler?
Hello,
Want to run the following from a scheduled task in the Task Scheduler on a server. What is the best approach?
.\pscript.ps1 -csvfile "\\Srv1\Share\File.txt"
Thanks for your help! SdeDotHi,
To run a powershell script with parameters in the Task Scheduler:
Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add argument (optional): -Command "& c:\scripts\test.ps1 -par1 2 -par2 3"
Hope the below two articles be helpful for you:
Schedule PowerShell Scripts that Require Input Values
https://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
How to Schedule a PowerShell Script
http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
Regards,
Yan Li
Regards, Yan Li -
How to create a node with attributes at runtime in webdynpro for ABAP?
Hi Experts,
How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
Please help!
Thanks
GopalHi
I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
Note
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
My code is like the following:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on condition
Message was edited by: gopalkrishna baliga -
How to call PDF Report with parameters in jdeveloper 10.1.3
Hi all,
how to call PDF Report with parameters in jdeveloper 10.1.3
for example I have Report name is repdept.pdf with parameter as deptno
and I want call this Report from JSP page ?
thanks
frankHi all,
how to call PDF Report with parameters in jdeveloper 10.1.3
for example I have Report name is repdept.pdf with parameter as deptno
and I want call this Report from JSP page ?
thanks
frank -
How to create excise invoice with reference thorugh credit memo
Hi All,
Please provide any solution for the following qurey:
How to create excise invoice with reference thorugh credit memoHi murali,
i am unable to understand your requirement i think there is no like this scenario requirement for any client
if any requirement is there kindly explain detail
cheers -
How to create a complaint with pre-decessor document Inovice?
Hello experts,
I need create a complaint with reference to a pre-decessor document type Invoice (apart from other types such as sales order and service order). Can someone enlighten me
1) how to create an invoice in IC Web Client and backend?
2) how to create a complaint with reference to this created invoice in IC Web client and backend?
Thanks a lot!!!Hi Easwar
Thanks a lot for answering the question.
Yes I do have CRM Billing documents. But the problem is
a) either the billing document doesn't have Transfer to Accounting status Transferred or
b) a transferred billing document, but all items have error "Unable to offset billing item 90003458 0000000060" etc.
Do you know
1) how I can make a billing document have "Transferred" status? Pressing "Transfer to Accounting" button in the billing document overview page will only set the status to "Being transferred". And it's always being tranfered.
2) What does the error "Unable to offset billing item ... "mean? How to get rid of them?
Thanks a lot! -
How to create a table with events in smartforms?
How to create a table with events view in smartforms?
It doesn't like general table with header, main area and footer.
for example:
in smartforms: LE_SHP_DELNOTE
table name is TABLEITEM(Delivery items table)Vel wrote:
I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
I'm using Oracle 10.2.0.4 version.
Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements. -
How to create shipment document with out inbound delivery document
Dear Friends
How to create shipment document with out outbound/inbound delivery document.
In my client scenario, there is no inbound delivery for normal purchases.
Just there are raising the PO to vendor, then they are doing MIGO for goods receipt.
Can we do shipment creation with reference to PO?
If it is possible, how it will be?
Please let it solve
With regards
LakshmikanthDear Sameer,
Please go to transaction VT01N here you enter Transportation planning point and shipment type then press enter.
Now system will take you to the shipment document creation screen here you click on Select deliveries or press F6 now system will take you to the select outbound deliveries screen in this screen you enter selection data then execute, now deliveries will get assigned to that shipment.
After assigning the deliveries enter the remaining data then complete the shipment finally save the shipment document.
For more information please go through this SAP help link
Note:- Shipment process need to be carry out for the deliveries before PGI.
http://help.sap.com/saphelp_47x200/helpdata/en/f5/04898047bd11d2bf750000e8a7386f/frameset.htm
I hope this will help you,
Regards,
Murali. -
How to create a view with parameter?
who can tell me hwo to create a view with
parameters just like a cursor?Hi,
This is not possible in Oracle. What u can do is create the view without the where clasue and supply the where clause at runtime.
Hope this helps...
Regards,
Ganesh R -
How to create a table with varied number of columns?
I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
Can I do it? How? Thanka a lot.Why did you create a new thread for this?
How to create a table with varied number of columns? -
How to create a table with datatype blob and insert a pdf file (ravi)
how to create a table with datatype blob and insert a pdf file,
give me the explain asap
1.create the table?
2.insert the pdffiles into tables?
3.how to view the files?
Thanks & Regards
ravikumar.k
Edited by: 895044 on Dec 5, 2011 2:55 AM895044 wrote:
how to create a table with datatype blob and insert a pdf file,
give me the explain asapPerhaps you should read...
{message:id=9360002}
especially point 2.
We're not just sitting here waiting to answer your question as quickly as possible for you. -
I need your expert opinion on how to create a map with multiple conditions.
Hello.
I need your expert opinion on how to create a map with multiple conditions.
I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
How can i create a cursors within the map?
My function creates table and cursor.
Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
I would appreciate any help / advise on this.
Thank you very muchthanks a lot for your reply - i will look into this option :-)
it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
Anyway, thank you very much for your suggestion. -
How to Create Business Partner with fix number in t-code :BP
Dear SIr,
Normally I will set number range for auto to create Business Partner. In case , If we would like to crea How to Create Business Partner with fix number in t-code :BP , howe to do?
Please kindly advise.
THnak you and best regards,
VimolDear Shobhit,
How to put the thread as you mentioned.
Best regards,
Maybe you are looking for
-
Oracle Reports - Unable to generate report with colored image in bitmap mod
Hi, I am using Oracle reports 6i. I am generating a post script[.ps] file using bitmap mode. The layout contains an image. The image is stored in oracle database which is colored image. But when the report is generated same is being generated with gr
-
Check-out originals from Content Server to File server?
Hello Experts, We have urgent requirement to check-out huge number of originals from the Content server and send to an application server (ftp server). The input data that we can use to fetch the originals are PHOIO nunber or LOIO or Original File n
-
Populating select-options in the main view
hi i have two views. main screen and view1. in main i have created a selection screen with 6 fields. view1 also has selection screen and same fields in it. when i go to view1 and click on ok button, i need to comeback to main view and populate the se
-
MediaHub reset, FTP password gone
As I was encoutering some problems with my MediaHub (could not activate external access anymore, firmware update would not work anymore) I did a full reset. After that my MediaHub updraged automatically to firmware 3.18.5, but now the options for usi
-
Getting E_ADEPT_INTERNAL error.
Recently bought a bubdle of magazines from direct2drive.com Two of them worked fine, the rest I got Error getting license Server communication problem: E_ADEPT_INTERNAL Already tried uninstall and reinstall. Aby help would be appreciated. Thanks in a