IN values in a PL/SQL procedure
Hi Experts,
Please can someone help me with this procedure ? I am trying to write this procedure that I can use to grant privileges dynamically to roles based on the argument.
I am getting the errors while creating it as it fails to assign the values in the CASE statement based on the IN arguments.
CREATE OR REPLACE PROCEDURE GENERATE_GRANTS (OWNNAME IN VARCHAR2, ROLENAME IN VARCHAR2, OP_TYPE VARCHAR2)
AS
SQL_STATEMENT VARCHAR2 (200);
err_code number(10);
err_msg VARCHAR2(200);
OBJTYPES VARCHAR2(200);
BEGIN
CASE OP_TYPE
WHEN 'READ' THEN OBJTYPES := ( 'TABLE', 'VIEW');
WHEN 'READWRITE' THEN OBJTYPES := ( 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'PACKAGE','FUNCTION' );
END CASE;
FOR ITEM IN (SELECT (
decode(
object_type,
'TABLE','GRANT SELECT, INSERT, UPDATE, DELETE ON '|| OWNNAME ||'.',
'VIEW','GRANT SELECT ON '|| OWNNAME ||'.',
'SEQUENCE','GRANT SELECT ON '|| OWNNAME ||'.',
'PROCEDURE','GRANT EXECUTE ON '|| OWNNAME ||'.',
'PACKAGE','GRANT EXECUTE ON '|| OWNNAME ||'.',
'FUNCTION','GRANT EXECUTE ON'|| OWNNAME ||'.' )||object_name||' TO '||ROLENAME
) as GRANT_SQL
FROM dba_objects
WHERE OWNER = OWNNAME
AND OBJECT_TYPE IN OBJTYPES
ORDER BY OBJECT_TYPE)
LOOP
SQL_STATEMENT := ITEM.GRANT_SQL;
BEGIN
EXECUTE IMMEDIATE SQL_STATEMENT;
EXCEPTION
WHEN OTHERS
THEN -- handles all other errors
err_code := SQLCODE;
err_msg := substr(SQLERRM, 1, 200);
DBMS_OUTPUT.PUT_LINE (SQL_STATEMENT);
DBMS_OUTPUT.PUT_LINE (err_code || ' ' || err_msg);
END;
END LOOP;
END;
/
a) Your CASE statement has wrong syntax.
b) In order to use OBJECTTYPES the way you wanted would require dynamic SQL.
Use this instead:
CREATE OR REPLACE
PROCEDURE GENERATE_GRANTS(
OWNNAME IN VARCHAR2,
ROLENAME IN VARCHAR2,
OP_TYPE VARCHAR2
AS
BEGIN
FOR ITEM IN (
SELECT decode(
object_type,
'TABLE','GRANT SELECT, INSERT, UPDATE, DELETE ON '|| OWNNAME ||'.',
'VIEW','GRANT SELECT ON '|| OWNNAME ||'.',
'SEQUENCE','GRANT SELECT ON '|| OWNNAME ||'.',
'PROCEDURE','GRANT EXECUTE ON '|| OWNNAME ||'.',
'PACKAGE','GRANT EXECUTE ON '|| OWNNAME ||'.',
'FUNCTION','GRANT EXECUTE ON'|| OWNNAME ||'.'
) || object_name || ' TO '||ROLENAME AS GRANT_SQL
FROM dba_objects
WHERE OWNER = OWNNAME
AND 1 = CASE
WHEN OP_TYPE = 'READ' AND OBJECT_TYPE IN ('TABLE','VIEW') THEN 1
WHEN OP_TYPE = 'READWRITE' AND OBJECT_TYPE IN ('TABLE','VIEW','SEQUENCE','PROCEDURE','PACKAGE','FUNCTION') THEN 1
END
ORDER BY OBJECT_TYPE
LOOP
BEGIN
EXECUTE IMMEDIATE ITEM.GRANT_SQL;
EXCEPTION
WHEN OTHERS
THEN -- handles all other errors
DBMS_OUTPUT.PUT_LINE (ITEM.GRANT_SQL);
DBMS_OUTPUT.PUT_LINE (SQLCODE || ' ' || substr(SQLERRM, 1, 200));
END;
END LOOP;
END;
/SY.
Similar Messages
-
Unable to capture the parameter values from a PL/SQL procedure
hi.
i'm trying to capture the parameter values of a PL/SQL procedure by calling inside a anonymous block but i'm getting a "reference to uninitialized collection error" ORA-06531.
Please help me regarding.
i'm using following block for calling the procedure.
declare
err_cd varchar2(1000);
err_txt VARCHAR2(5000);
no_of_recs number;
out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
cntr_var number:=0;
begin
rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
dbms_output.put_line('The error is ' ||err_cd);
dbms_output.put_line('The error is ' ||err_txt);
dbms_output.put_line('The cntr is ' ||cntr_var);
for incr in 1 .. OUT_SIGN_TAB.count
loop
cntr_var := cntr_var + 1 ;
Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN_TAB(incr).txn_type||','||OUT_SIGN_TAB(incr).objid);
end loop;
end;
Error is thrown on "for incr in 1 .. OUT_SIGN_TAB.count" this line
Following is some related information.
the 3rd parameter of the procedure is a out parameter. it is a type of a PL/SQL table (SEARCH_SIGN_TAB_TYPE) which is available in database as follows.
TYPE "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
TYPE "SEARCH_SIGN_TYPE" AS OBJECT
(ref_no VARCHAR2(22),
ciref_no VARCHAR2(352),
ac_no VARCHAR2(22),
txn_type VARCHAR2(301),
objid VARCHAR2(1024))............We don't have your rt843pq procedure, but when commenting that line out, everything works:
SQL> create TYPE "SEARCH_SIGN_TYPE" AS OBJECT
2 (ref_no VARCHAR2(22),
3 ciref_no VARCHAR2(352),
4 ac_no VARCHAR2(22),
5 txn_type VARCHAR2(301),
6 objid VARCHAR2(1024))
7 /
Type is aangemaakt.
SQL> create type "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
2 /
Type is aangemaakt.
SQL> declare
2 err_cd varchar2(1000);
3 err_txt VARCHAR2(5000);
4 no_of_recs number;
5 out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
6 cntr_var number:=0;
7 begin
8 -- rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
9 dbms_output.put_line('The error is ' ||err_cd);
10 dbms_output.put_line('The error is ' ||err_txt);
11 dbms_output.put_line('The cntr is ' ||cntr_var);
12 for incr in 1 .. OUT_SIGN_TAB.count
13 loop
14 cntr_var := cntr_var + 1 ;
15 Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN
TAB(incr).txntype||','||OUT_SIGN_TAB(incr).objid);
16 end loop;
17 end;
18 /
The error is
The error is
The cntr is 0
PL/SQL-procedure is geslaagd.Regards,
Rob. -
How to accept user values into a pl/sql procedure or function on every execution
As we accept user values on every execution in a C or a java program, is it possible to do so with a pl/sql procedure or a funtion without using parameters?
I cannot use parameters because it is required to be interactive while accepting the user-values like,
Please enter your date of birth in 'dd/mm/yyyy' format:It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
In either case, you can not go back to the PLSQL routine.
In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine. -
Parsing Through the Multi Selection Values in a PL/SQL Procedure
Greetings,
This should be an easy one for one of you PL/SQL experts. I'm not, so I am unsure how to code this up.
I have a Multi Selection page item and am passing the value of it to a PL/SQL routine as a parameter. I am able to use the value if I only pass my procedure one value, so I have it working. Just not with multi-values I need the code in the procedure to loop through the values. How do I code that up? The procedure is relatively short and is included below. p_cell is the multi-value parameter.
Oh yes... You probably need to know this. The values are coming in like this - 1-3:2-3:3-3:5:6
Also, the values are the x-y coordinates of a grid I have over an image on the page. The routine removes certain cells (1-3, etc.) from the grid. The grid is created using HTML, so I have to remove lines of HTML to remove a cell from the grid. Just in case that is helpful.
Thx, Tony
= = = = = = =
create or replace
procedure qcis_remove_grid_cell(p_id IN NUMBER,p_cell IN VARCHAR2) as
v_position number;
v_position_from_end number;
v_line_start number;
v_line_end number;
v_length number;
v_html clob;
BEGIN
BEGIN
select imagemap_html into v_html from qcis_im_template_draft
where header_id = p_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_html := NULL;
END;
v_length := length(v_html);
v_position := INSTR(v_html,'alt="'||p_cell||'"');
v_position_from_end := (v_length - v_position) * -1;
v_line_start := INSTR(v_html,'<area shape',v_position_from_end) - 1;
v_line_end := INSTR(v_html,'/>',v_position) +2;
v_html := substr(v_html,1,v_line_start) || substr(v_html,v_line_end);
UPDATE qcis_im_template_draft SET imagemap_html = v_html WHERE header_id = p_id ;
END qcis_remove_grid_cell;
Edited by: cloaked on Nov 1, 2011 8:01 AMNot sure I understood your need, but it sounded like you need to unscramble a string into a set of rows. If so, I would give you 2 ideas:
1. STRING_TO_TABLE function: http://www.sloug.org/i/doc/api073.htm
2. Other ways (Regular expression or XML): http://apex-at-work.blogspot.com/2011/05/two-ways-using-string-to-table-in-apex.html -
How to get the OUT value of a PL/SQL procedure?
that is to say, I want to get a number form a procedure which code is familiar to:
create or replace procedure get_salary(
name in varchar2,
id in varchar2,
salary out number
In java code, How to get the value of salary?
PLZYou'll want something like this:
CallableStatement stmt;
Connection conn;
<< Create connection to database >>
stmt = conn.prepareCall( "{call get_salary( ?, ?, ? )}" );
stmt.setString( 1, someName );
stmt.setString( 2, someID );
stmt.registerOutParameter( 3, java.sql.Types.INTEGER );
stmt.executeUpdate();
int outSalary = stmt.getInt( 3 );Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Validate a value against table validation value set within PL/SQL
Hi,
I am trying to import price list lines along with Pricing attribute values.
I have to validate the uploaded values against the pricing attribute value set, before I import them into base tables.
Value set defined is of type table validation.
I wanted to know if there are any public APIs that can be used to validate the value against the Value set values within my PL/SQL procedure
Also please point me to documentation that lists various public PL/SQL APIs
Regards,
MrutyunjayYou can find functions and procedure for Value sets in packages FND_FLEX_VAL_API or FND_FLEX_VAL_UTIL.
Example : get_table_vset_select gives you the select statement of your value set. Executing this statement will allow you to validate your values. -
Calling shell script from sql procedure
Hi gurus
Is it possible
1)to call a shell script from sql procedure
2)that shell script has to return one value
3)and again sql procedure(calling shell script) has to capture the return value.
please help me to write this scriptYou may NOT have EXECUTE privilege/ permissions on the DBMS_PIPE package. Check with your DBA.
Using DBMS_PIPE may not be that simple to implement. Just making a call to DBMS_PIPE procedure will not do anything. It will NOT trigger anything on the UNIX side.
. You will also need to :
1. Write a job (ie CRON) at UNIX side which will keep read the incoming pipe for new messages, Unpack the message and get the command to be executed at the UNIX side -- There will be a lot of work involved here + DBA presence/activity is also required.
As Justin has pointed out, try and use HOST command which is very simple or try and use Java.
Shailender Mehta -
Passing variable values to pl/sql procedures
Hi,
I wanted to log the step name and message into a table whenever a particular step/interface failed in the ODI package.
Ex:PKG1
A----OK--->B----OK-->C--OK-->LOG SUCCESS status into table. All steps are sequenced.
when not OK
A----KO--->B----KO-->C--KO-->LOG failed status into table with step and message.
I have created 4 variables in ODI and used these vairables in to pass values in pl/sql procedure scenario.
I have drag and drop procedure scenario and given values to every variable...thing is for i want to get the step name dynamically for the procedure scenario's variable i am directly passing
v_int_step=odiRef.getPrevStepLog("STEP_NAME").
I dont want drag and drop procedure for each KO and then pass values to v_int_step=A or B or C .
My scenario command look like this for KO
OdiStartScen "-SCEN_NAME=PROC_LOGEXE_STATUS" "-SCEN_VERSION=-1" "-LOG_LEVEL=3" "-SYNC_MODE=1" "-SESSION_NAME=PROC_CSA_LOGEXE_STATUS_CS_BRANCHES" "-FLEXCUBE_OFSAA.v_execution_status=E" "-project1.v_scen_int_name=A" "-project1.v_batch_id=PKG_GLOBAL_MNT_HANDOFF" "-project1.v_step_name=odiRef.getPrevStepLog("STEP_NAME")"
I am getting following error
oracle.odi.oditools.OdiToolInvalidParameterException: Error while setting parameters on tool
at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:607)
at com.sunopsis.dwg.function.SnpsFunctionBase.getSunopsisApi(SnpsFunctionBase.java:480)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:1340)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2785)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Invalid parameter
at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:599)
... 15 more
Please help me ,
Thanks In AdvanceHi,
Mistakes i found in the script,
1. You need to pass the variables with the "-<YOUR PROJECT CODE>.VARIABLE NAME" which i suppose would be in UPPER CASE.
2. You need to pass OdiPrevStepLog with <%=%> enclosed. So your script will looks like,
OdiStartScen "-SCEN_NAME=PROC_LOGEXE_STATUS" "-SCEN_VERSION=-1" "-LOG_LEVEL=3" "-SYNC_MODE=1" "-SESSION_NAME=PROC_CSA_LOGEXE_STATUS_CS_BRANCHES" "-FLEXCUBE_OFSAA.v_execution_status=E" "-PROJECT1.v_scen_int_name=A" "-PROJECT1.v_batch_id=PKG_GLOBAL_MNT_HANDOFF" "-PROJECT1.v_step_name=<%=odiRef.getPrevStepLog( "STEP_NAME" )%>"
Thanks,
Guru -
How to pass values to select clause in PL/SQL procedure
Am relatively new to PL/SQL programming and ran into the following issue...
Table
EMP_MASTER
ID VARCHAR2(10);
FIRSTNAME VARCHAR2(20);
DATA FOR EMP_MASTER
'1','SCOTT'
'2','TIGER'
I ran the following SQL Query
SELECT COUNT(*) FROM EMP_MASTER WHERE FIRSTNAME IN ('SCOTT','TIGER');
This select Query is working fine and we get the count = 2 as
expected. Now I want a procedure for the same fn()
CREATE OR REPLACE PROCEDURE TEST_EMP_MASTER(NAMELIST IN VARCHAR2)
IS
CNT NUMBER := 0;
BEGIN
SELECT COUNT(*) INTO CNT FROM EMP_MASTER WHERE FIRSTNAME IN (NAMELIST);
DBMS_OUTPUT.PUT_LINE('Output-->NAMELIST:'||NAMELIST||':cnt:'||cnt);
END;
Now when I test the procedure by passing just one value its working
fine. But when I want to pass multiple values, it doesnt work!
set serveroutput on;
i.e exec TEST_EMP_MASTER('SCOTT'); Works and the output is
Output--->NAMELIST:SCOTT:cnt:1
but don't get the expected output for exec TEST_EMP_MASTER('SCOTT,TIGER');
I understand that the IN modifier in the WHERE clause expects the
values as 'Value1','value2'....I tried different combination by the
passing the values with quotes '''value1'',''value2'''.....but no
successSelect e.*
From EMP_MASTER e;
ID FIRSTNAME
1 1 SCOTT
2 2 TIGER
3 3 CAT
4 4 MOUSE
SQL> create or replace procedure count_emp_master (p_namelist VARCHAR2)
2 AS
3 v_namelist VARCHAR2 (1000) := p_namelist;
4 v_name Varchar2(100);
5 v_count Number := 0;
6 p_count_emp Number := 0;
7 BEGIN
8 v_namelist := ',' || v_namelist || ',';
9
10 FOR cur IN 1 .. LENGTH (v_namelist) - LENGTH (REPLACE (v_namelist, ',', '')) - 1
11 LOOP
12 v_name := (SUBSTR (v_namelist,
13 INSTR (v_namelist, ',', 1, cur) + 1,
14 INSTR (v_namelist, ',', 1, cur + 1)
15 - INSTR (v_namelist, ',', 1, cur) - 1
16 ));
17 Select Count(1)
18 Into v_count
19 From emp_master
20 Where FIRSTNAME = v_name;
21
22 p_count_emp := p_count_emp + v_count;;
23
24 END LOOP;
25
26 dbms_output.put_line ('namelist --> '||p_namelist ||'p_count_emp -->'||p_count_emp);
27 END count_emp_master;
28 /
Procedure created
SQL> exec count_EMP_MASTER('SCOTT');
namelist --> SCOTTp_count_emp -->1
PL/SQL procedure successfully completed
SQL> exec count_EMP_MASTER('SCOTT,TIGER');
namelist --> SCOTT,TIGERp_count_emp -->2
PL/SQL procedure successfully completed
SQL> exec count_EMP_MASTER('SCOTT,TIGER,CAT');
namelist --> SCOTT,TIGER,CATp_count_emp -->3
PL/SQL procedure successfully completed
SQL> exec count_EMP_MASTER('SCOTT,TIGER,CAT,MOUSE');
namelist --> SCOTT,TIGER,CAT,MOUSEp_count_emp -->4
PL/SQL procedure successfully completed
SQL> Message was edited by:
Nicloei W -
List of values to PL/SQL procedure
I want to execute a query of the form
UPDATE myTable
SET myField = someValue
WHERE myTablePK IN (1, 3, 5, 7, 9)
Through HTML, I have a form field that is a comma-delimited list of values. I want to be able to pass this to a stored proc. What I'm not understanding is how to pass a list of values.
In other words, the form should be:
UPDATE myTable
SET myField = someValue
WHERE myTablePK IN (someList)
What data type should "someList" be? How do I pass it? The number of values in the list is variable and cannot be determined at design-time.Here is an example how to pass a list of values as an input to a stored procedure using dynamiv SQL:
TAPAS>create or replace procedure create_my_view( dept_list IN VARCHAR2)
2 authid CURRENT_USER
3 AS
4 sql_stmt VARCHAR2(1000);
5 begin
6 sql_stmt := 'create or replace view my_view as select deptno from emp where deptno in ('| | dept_list| |')';
7 execute immediate sql_stmt;
8 exception
9 when others then
10 dbms_output.put_line(SQLERRM);
11 end;
12 /
Procedure created.
TAPAS>exec create_my_view('10,20');
PL/SQL procedure successfully completed.
TAPAS>select * from my_view;
DEPTNO
10
10
10
10
10
20
20
20
20
20
20
20
20
20
14 rows selected. -
Send Datetime2 value to a SQL Procedure from Java using Hibernate
Hi All,
I Have a Procedure which takes a parameter of type datetime2.
The procedure is called from Java Hibernate.
How can I Pass datetime2 value to SQL procedure from Java?
Thanks in advance,
Shraddha GoreYou may define a global empty array in some package. Then you can do:
SQL> CREATE OR REPLACE PACKAGE pkg
AS
g_empty DBMS_SQL.varchar2_table;
END pkg;
Package created.
SQL> CREATE OR REPLACE PROCEDURE p (
p_tuids IN DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
AS
BEGIN
NULL;
END p;
Procedure created.
SQL> BEGIN
p ();
END;
PL/SQL procedure successfully completed. -
Passing value from ADF to BPEL, and to PL/SQL procedure
1. I have created BPEL which take 2 inputs and concatenate them.
2. have created a PL/SQL procedure for invoking this BPEL( working fine).
Now i need to create a simple ADF page which contain 2 text box, 2 for input and 1 for result(concatenate), this will take 2 inputs and send them into BPEL, this will invoke the BPEL process and perform the necessary concatenate function...
in addition to this, i am passing code into PL/SQL procedure ...
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://xmlns.oracle.com/OrderImportDemo">
<ns1:InputRequest>
<ns1:FirstName>abcdef</ns1:FirstName>
<ns1:LastName>aaaaaa</ns1:LastName>
</ns1:InputRequest>
</soap:Body>
</soap:Envelope>';
this code will take vaule from BPEL and run properly.
can you please help me,thanks for help, but the problem is diff.
i don't have any schema, what i want i need to create a adf page that will contain 3 tent field, 2 for input and 1 for output. when i will enter 2 input field and click on ok button, this will invoke BPEL, BPEL will take these 2 inputs and do the concat on this and send back to adf with result. -
How to get data from URL in a PL/SQL procedure
Hi!<br>
<br>
I want to pass values in APEX from a report with a link to a PL/SQL procedure through URL.
How can I make this?<br>
<br>
For example:<br>
<br>
I have a report:<br>
<br>
select<br>
id,<br>
name,<br>
akt,<br>
case<br>
when akt is NULL then '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS" name="test_link" >set< /a >'<br>
end choice<br>
from<br>
USERS;<br>
<br>
I want to pass the value "id" in the link ( named "test_link" ) . And want to use this value in a process like this:<br>
<br>
DECLARE<br>
v_user_id NUMBER(10);<br>
BEGIN<br>
--I want to read this value from the url<br>
if :REQUEST='START_PROCESS' then<br>
v_user_id := ????;<br>
<br>
...<br>
end if;<br>
END;<br>
<br>
<br>
Thanks!<br>
MartonHi,
1- Create a hidden item P27_USER_ID on page 27
2- Change your code :
SELECT ID, NAME, akt,
CASE
WHEN akt IS NULL
THEN '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS:NO::P27_USER_ID:'
|| ID
|| '" name="test_link" >set< /a >'
-- refer to f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
END choice
FROM users;
And then
DECLARE
v_user_id NUMBER (10);
BEGIN
--I want to read this value from the url
IF :request = 'START_PROCESS'
THEN
v_user_id := :p27_user_id;
--your code
END IF;
END;Hope this helps,
Grégory -
How to pass multiple parameters while calling a pl/sql procedure based serv
Hi,
I have a pl/sql procedure based service that needs to be invoked from the bpel console for testing purpose. This procedure accepts multiple input values which are of varchar2,boolean and datetime data types. How can I get the bpel console to throw a UI where I can enter these values --in other words where(which file and where) can I specify that these are the input parameters that need to be entered along with their types.
Thanks for yr help!Change the payload of the request 'Process WSDL' message type. Change the element of the payload for the RequestMessage to be 'InputParameters' from the XSD generated by the DB Adapter wizard.
Edit the payload (Element) - Choose 'Project Schema Files'. Select 'InputParameters' from the XSD.
You can also change the ResponseMessage by doing the same thing, except that you select 'OutputParameters' from the XSD. -
Execute CDC mappings from a PL/SQL procedure
Hi,
I´m using OWB 11.2.0.2 for Linux. I´ve created some CDC mappings to update cubes with changes coming from other tables and cubes (from the tables that implement those cubes with the relational option). The issues are:
- The CDC mappings run successfully from the OWB (Project Navigator - Start), but I cannot execute them from a procedure in PL/SQL with the following code:
PROCEDURE "PROC_RUNCDCMAPPINGS" IS
--inicializar variables aquí
RetVal NUMBER;
P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
-- ventana principal
BEGIN
RetVal:= BARIK.CDC_LOAD_CUBO_RECARGA.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBO_TOR.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBO_TOAE.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBO_VIAJES.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBO_TICKETINCIDENCIA.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBO_LIQMONEDERO.MAIN(P_ENV);
RetVal:= BARIK.CDC_LOAD_CUBOS_LIQTEMPORALES.MAIN(P_ENV);
COMMIT;
END;
It doesn´t report any error (the value for RetVal after execution is 0), but the cubes are not loaded with changes, and the changes stored in the J$_%tables are not consumed.
Some of the options that may impact in the mappings are:
- All the CDC are of Simple type
- There are more than one subscriber to consume the changes, as for some tables, its changes must feed more than one CDC.
- All the mappings include only one execution unit per mapping.
- The integration/load template is the default: DEFAULT_ORACLE_TARGET_CT
Other question is: As I explained, I need more than one subscriber because same updates must be consumed by different CDC mappings, to load different cubes, but I´ve not been able to assign the subscribers to only the tables associated with them, so all the subscribers are subscribed to all the changes in all the CDC tables, but as many of those subscribers never consume the changes of same tables, in the J$_% tables remains the not consumed records, and I haven´t found the way to purge those tables (other than the delete from J$_), nor to assign the tables with the subscribers (so the subscribers are only subscribed to their interested changes, that will be consumed, so the tables will be emptied after the consumption).
Any help with these problems will be greatly appreciated.
Tell me if more info is needed to clarify the situation.
Best regards,
AnaHi David,
Thank you for your reply.
These mappings are the mappings needed to update the cubes with the changes detected by the CDC system, they are located under the Mapping Templates folder and I´m using code templates for the control of the loading and the integration (the DEFAULT_ORACLE_TARGET_CT) mapping.
What I need is to execute these mappings within a PL/SQL procedure that will be invoked from different tools.
I´ve done it for regular mappings (not CDC mappings), and it works. The code is the same as for the CDC ones:
PROCEDURE "PROC_RUNLOADMAPPINGS" IS
--inicializar variables aquí
RetVal NUMBER;
P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
-- ventana principal
BEGIN
RetVal:= BARIK.LOAD_CUBO_RECARGA.MAIN(P_ENV);
RetVal:= BARIK.LOAD_CUBO_TOR.MAIN(P_ENV);
RetVal:= BARIK.LOAD_CUBO_TOAE.MAIN(P_ENV);
RetVal:= BARIK.LOAD_CUBO_VIAJES.MAIN(P_ENV);
RetVal:= BARIK.LOAD_CUBO_TICKETINCIDENCIA.MAIN(P_ENV);
COMMIT;
END;
-- End of PROC_RUNLOADMAPPINGS;
,and when I run it, the mappings are executed, but with the CDC ones it doesn´t (even when no error is reported).
I know that they are deployed in the selected agent (in my case the Default_Agent), but when I start them from the OWB, the mapping packages are created in the DB schema, so, I thought that maybe I could invoke them....so what you tell me is that the only way to invoke them is from SQL*Plus? not from a regular PL/SQL procedure?
Thank you very much,
Ana
Maybe you are looking for
-
Rman backup in noarchivelog mode
hi all, My database(ORCL) is in noarchivelog mode I am taking RMAN backup using recovery catalog(backupdb) target database(ORCL) is in mount mode I am getting following errors: RMAN> backup database; Starting backup at 01-AUG-08 RMAN-00571: =========
-
Can Acrobat 7 and 9 be installed together?
Fellow Forum Members, I just learned that Acrobat 9 does not allow viewing multiple PDF files in a single window. This really disappoints me a lot. In version 7 and 8 it was possible to do this, and now Adobe decides to mess it up in version 9. Can v
-
Hello All, I'm a nonexpert, so please excuse in advance any lack of knowledge that I probably should have. I've been heavily editing a recording of several days of jams for a long time, basically by cutting and aligning very disparate parts to form s
-
Screen/Display glitch on 2012 Macbook pro
In the past 2 months my macbook appears to be having screen 'seizures' were the display will start glitching and you can not get a clear image of whats on the screen. This happens either unexpectically when the computer isn't being touched or when th
-
I'm using Photoshop CS6 on a PC. When I tried to apply the oil pain filter, I got an error message saying "The filter you were using encountered an unknown graphics processor error that caused an unexpected exit. Check the manufacturer's website for