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 Advance
Hi,
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
Similar Messages
-
Passing multi-value parameter in stored procedure ssrs
I have customer parameter which is a drop down list in my report and I have set it to "allow multiple values". This is an SSRS report.
How do I pass multiple values to my stored procedure?
RJHi ,
Create a Table valued function in SQL Functions as below
Step 1
CREATE FUNCTION [dbo].[FnSplit]
@List nvarchar(2000),
@SplitOn nvarchar(5)
RETURNS @RtnValue table
Id int identity(1,1),
Value nvarchar(100)
AS
BEGIN
While (Charindex(@SplitOn,@List)>0)
Begin
Insert Into @RtnValue (value)
Select
Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1)))
Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List))
End
Insert Into @RtnValue (Value)
Select Value = ltrim(rtrim(@List))
Return
END
Step 2 in your store procedure change the parameter where condition something like below
ALTER PROCEDURE [dbo].[SomeSP]
-- Add the parameters for the stored procedure here
@CostCentre NVARCHAR(255)
SELECT
[ProjectCode],[ProjectName],[ProjectManager],SUM([Hours]) AS [Hours MTD]FROM dbo.Rpt_NRMA_CATS NC
INNER JOIN PeriodID P ON NC.PeriodID=P.PeriodID
WHERE
([CostCentre]) collate database_default IN(SELECT Value FROM dbo.FnSplit(@CostCentre,','))
END
I hope this will help you.
Dasari -
Passing variable values to the navigation block
Hi WAD Experts,
I have a requirement regarding passing variable values to the navigation block. User requirement is first give the selections on the selection screen and then after executign output should display in browser. In the output page we have a navigation block. So when user gives selections those selections should also populate in the navigation block. Your help will be appreciated.
Prasad.Hi,
if your variable is 'Changeable at Query Navigation' the chosen values will appear in the Navigationblock.
Variables which are 'Not Changeable at Query Navigation'
will not appear.
You can set this Property when you create a Variable.
Kind Regards,
Alican Polat -
Application inside an application and using URL parameter to pass variable values
hello
My requirement is to create a design studio dashboard that will have 2 applications and I should be able to pass variable values from application 1 to application 2. All this should happen in 1 dashboard application. I have tried using open document functionality
Application1.openNewWindow(URL link to application 2) . It doesn't meet my requirement as I am required to login to the other application in a new window.
Is it possible to add 2 applications in one dashboard.
thanks,
BhatHi Bhat,
I don't know if it is possible to open it in the same Page. But you can try using the Opendoc Parameter which allows you to enable you to pass the credentials you have used in the current Dashboard.
A useful link,
https://help.sap.com/businessobject/product_guides/boexir4/en/xi4_opendocument_en.pdf
Regards,
Fazith Ali Z -
APEX - accepting OUT variable values from PL/SQL Stored Procedure
I have created a page (Form) which is accepting values text fields.
In the Page Processing section under Processing, I am passing the values to a PL/SQL Stored Procedure, which acts like an API. The procedure contains code to validate the entered data and finally insert the data into the base tables. The procedure also contains OUT variables in the parameter that would return status of processing and any error messages.
Now, my question is, how can I make the page accept these OUT variables from the procedure. What I wish to do is, to capture these messages/processing status from the procedure in the page. For example, if there is a error in the data and the procedure is sending this message in the OUT variable, I need this to be displayed on the page as an error message.
Is this possible in APEX?
Regards,
Santhosh JoseHi VC,
I just tried putting the string directly instead of the variable. Its still not giving me the expected results.
HOWEVER, I think the reason was because of the EXCEPTION block in my code. I have an EXCEPTION block to handle exceptions. I commented the WHEN OTHERS section and now the error message is coming on the page.
So what I have done now is as follows: At the point at which the error is expected, I am raising a handled exception. And within the exception handling, I am giving RAISE_APPLICATION_ERROR.
WHEN ex_main_error*
THEN*
p_status := 2;*
p_msg := 'ERROR Stage: '||lc_err_stage||' ERROR Message: '||lc_err_msg;*
RAISE_APPLICATION_ERROR (-20001, p_msg);*
This is working now! Which is very good news. Thanks once again for your help!
Regards,
Santhosh Jose -
Get value from PL/SQL procedure to shell variable
Hello,
I have one little problem. I want to run plsql procedure from shell program and then I want to fill a shell variable with return value of plsql procedure or function. But I don't want to pass this value to some file and then read it.
Thank'suser9357436 wrote:
Hello,
I have one little problem. I want to run plsql procedure from shell program and then I want to fill a shell variable with return value of plsql procedure or function. But I don't want to pass this value to some file and then read it.
Thank'sLike below?
bcm@bcm-laptop:~$ cat day.sh
set X
var1=$1
SQLPLUS="sqlplus -s"
LOGON="user1/user1 "
day=`$SQLPLUS $LOGON <<EOF
set heading off
set feedback off
set verify off
select 'Have a nice day!' from dual where dummy ='$var1';
exit;
EOF`
echo $day
bcm@bcm-laptop:~$ ./day.sh
Have a nice day!
bcm@bcm-laptop:~$ -
How to replace variable value of a sql query dynamically
Hi all,
Trying to execute sql queries present in Oracle table and the query it self contains the ODI variable #EMP_NO.
At the run time we thought of passing the variable values.
table contains query like
update table <table name> set <column name>= 5000 where emp_no = #EMP_NO
We need to execute the sql query using a ODI procedure, to pick the sql query from table we use another variable #varSQLID and in the command on source tab wrote like
select sql_query varSQL from emp_sql where query_id=#varSQLID
Command on target
#varSQL
when ever I tried to execute I am getting error please let me know what changes are required .
The question is whether it's possible to replace the variable value present in the above sql ?
regards,
Palash ChatterjeeThanks Siddhartha,
Actually we have been doing the same, means half of the query has been kept in the table and rest is being added in the " command on source " tab of the procedure .
But the problem is , the "where" condition is not same for all SQL queries,
to provide 27 different sqls queries for 27 packages we have to create 27 procedures (as "where" condition may take other column values along with "EMPNO" for the JOIN condition ) .
Any suggestion of keeing SQL along with the variable and storing it in the table may resolve our problem and work of 27 procedures can be performed by a single procedure .
regards,
Palash Chatterjee -
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. -
Get variable values from a stored procedure
I am using SQL 2008R2 and I want to replace a view inside a stored procedure with a new stored procedure to return multiple variable values. Currently I am using the code below to get values for 4 different variables. I would rather get the 4 variables
from a stored procedure (which returns all of these 4 values and more) but not sure how to do so. Below is the code for getting the 4 variable values in my current sp.
DECLARE @TotalCarb real;
DECLARE @TotalPro real;
DECLARE @TotalFat real;
DECLARE @TotalLiquid real;
SELECT @TotalCarb = ISNULL(TotCarb,0),
@TotalPro = ISNULL(TotPro,0),
@TotalFat = ISNULL(TotFat,0),
@TotalLiquid = ISNULL(TotLiq,0)
FROM dbo.vw_ActualFoodTotals
WHERE (MealID = @MealID);You can replace the view with inline table valued user-defined function:
http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
See example: SQL create INLINE table-valued function like a parametrized view
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Using UDT's for passing rows to a PL/SQL procedure
I'm trying to get a list of rows into a procedure...
With ODP 11 - I thought that I would simply need to create a UDT of an object (i.e. user_id, first_name, last_name) and - then type which is a collection of that object.
Then - using that object type collection as a parameter in my procedure - pass the numerous rows from .NET in.
I've found a examples with varray's, nested varrays etc... but - nothing straight forward with passing a collection of rows.
Does anyone know of any online examples that illustrate this?
Thanks for your help!Hi,
A BLOB variable is just a pointer to binary data and you are passing a text string to your procedure which is why you have the error. So to write a blob into a table in a procedure you need something like this:
CREATE OR REPLACE PROCEDURE testone(
V_TEXT IN VARCHAR2
AS
V_SIGIMG BLOB;
BEGIN
insert into sin_image values(empty_blob())
returning blobcol into V_SIGIMG;
-- then copy the text as binary data, this does not convert the text to binary data
DBMS_LOB.WRITE(V_SIGIMG,1,LENGTH(V_TEXT),v_TEXT);
commit;
END;
/However, if you want to upload images into the table it is easier to use the Apex functionality to upload the image into the APEX_APPLICATION_FILES table then move the blob into your table using an INSERT or UPDATE.
Rod West -
Passing Dynamic Values to a Stored Procedure
I have a stored procedure to create a Table. How to I pass a
value to the procedure to name the Table. This SP works except the
name of the table is @newcomm not the value I am trying to pass in.
What is the proper syntax to make this happen.
CREATE PROCEDURE [dbo].[sp_newcommenttbl]
@newcomm varchar (50)
AS
BEGIN
CREATE TABLE [dbo].[@newcomm] (
[configid] [int] IDENTITY (1, 1) NOT NULL ,
[email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[adminemail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[erroremail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[toCommentFormEmail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dsn] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[gmdsn] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[dbusername] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbpassword] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath2] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath3] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[urlactivate] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[urlresetpassword] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[initialized] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename1] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename2] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename3] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename4] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename5] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename6] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename7] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename8] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename9] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename10] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[pageheader] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
END
GO
<cfstoredproc procedure="sp_newcommenttbl"
datasource="xxxxx" returncode="no">
<cfprocparam type="in" maxlength="50"
cfsqltype="cf_sql_varchar" value="pighg3">
</cfstoredproc>When I create the procedure I don't get an error. I get an
error when I call it.
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect
syntax near the keyword 'ON'.
ColdFusion cannot determine the line of the template that
caused this error. This is often caused by an error in the
exception handling subsystem.
Here is the call.
<cfstoredproc procedure="sp_newcommenttbl"
datasource="pisecurity" returncode="no">
<cfprocparam type="in" maxlength="50"
cfsqltype="cf_sql_varchar" value="pighg3" variable="newcomm">
</cfstoredproc>
Here is the syntax for the SP.
CREATE PROCEDURE [dbo].[sp_newcommenttbl]
@newcomm varchar (50)
AS
BEGIN
EXEC('CREATE TABLE [dbo].['+@newcomm+'] (
[configid] [int] IDENTITY (1, 1) NOT NULL ,
[email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[adminemail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[erroremail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[toCommentFormEmail] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dsn] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[gmdsn] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[dbusername] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbpassword] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath2] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[acfcpath3] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[urlactivate] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[urlresetpassword] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[initialized] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename1] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename2] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename3] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename4] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename5] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename6] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename7] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename8] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename9] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[dbtablename10] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[pageheader] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
ON [PRIMARY]')
END
GO -
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. -
URGENT!!passing variables to ref-cursor stored procedures
I have build forms6 block base ona stored procedures with ref
cursor.
But....it's impossible to pass variables from block.item to
in-out parameter of ref cursor..to make a where clause for
example!!
I've tried all..but nothing happens..
Can someone help me?
Thanks..
nullManish Wadhwa (guest) wrote:
: Gigi (guest) wrote:
: : I have build forms6 block base ona stored procedures with ref
: : cursor.
: : But....it's impossible to pass variables from block.item to
: : in-out parameter of ref cursor..to make a where clause for
: : example!!
: : I've tried all..but nothing happens..
: : Can someone help me?
: : Thanks..
: >>
: It is not possible to send values as parameter to the stored
: procedure because, oracle uses the trigger query-procedure for
: calling the stored procedure and it does not entertain any
: changes to that trigger. This is a problem with block based on
: stored procedure, we have also tried it with table of records
: instead of ref cursor, but doesn't work.
: Manish
Thanks Manish..
i was afraid about that..
But ..i ask to myself(retoric question..) it's possible the
development oracle team build a "black box" like a stored
procedure with ref o table of records who permit to select
million of records in few second( i selected 5 million of records
in 2 seconds..) and cannot permit to passing variables to these
cursor.. every end users production forms must be working in
this way..I don't understand..
Gigi
null -
Passing multiple values to a stored procedure
Hi All,
I have a stored procedure which displays a chart. The header of this procedure is:
create or replace procedure chart ( p_period IN VARCHAR2) is
When calling this procedure with something like the folloeing:
<PARAM NAME=movie VALUE="/i/charts.swf?library_path=/i/charts_library&xml_source=ohsinit.chart?p_period=MONTH">
everything works OK.
Now, I would like to replace p_period=MONTH with a value coming from an ITEM on the page, so something like:
<PARAM NAME=movie VALUE="/i/charts.swf?library_path=/i/charts_library&xml_source=ohsinit.chart?p_period=:P13_PERIOD">
However, the above doesn't work.
Can anyone give me the correct syntax please?
Also what would be the syntax for passing more than one value? ie:
source=ohsinit.chart?p_period=:P13_PERIOD,p_start=:P13_START_DATE ?
Regards,
Pawel.Hi Denes,
I am not sure I understand your post...
What I am trying to do here is to pass 3 values namely
P13_PERIOD (VARCHAR2),
P13_START_DATE (DATE),
P13_END_DATE (DATE)
into a stored procedure which displays the graph.
So far I managed to get it working using:
<PARAM NAME=movie VALUE="/i/charts.swf?library_path=/i/charts_library&xml_source=ohsinit.chart?p_period=&P13_PERIOD.">
However when I try to put in:
<PARAM NAME=movie VALUE="/i/charts.swf?library_path=/i/charts_library&xml_source=ohsinit.chart?p_period=&P13_PERIOD.,p_start=&P13_START_DATE.">
I get the graph blank (but not the orange timeout message... if you are familiar with XML/SWG graphs.) -
Passing table data to pl sql procedure oaf
Hi All,
I have a requirement where i have to pass table data to plsql procedure.
In the first page i select the REQUISITION and click on RETURN button and it will take me to the next page.
and in the Next page i will click on APPLY button.
When i click on APPLY, it will call the procedure and will give input to the procedure whatever has been selected when i have selected requisition.
Please help. Please tell me the approach how to get this task done. A sample code will work.
Hope the requirement is clear.
Thanks in Advance.Hi Chinmay,
Refer below code for Your Requirement.
//Code For Quering Data
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
String Query = "SELECT organization_id FROM hr_operating_units WHERE organization_id = fnd_global.org_id";
PreparedStatement stmt = conn.prepareStatement(Query);
resultset=stmt.executeQuery();
while (resultset.next())
orgId = (String)resultset.getString("ORGANIZATION_ID").toString();
conn.commit();
catch(Exception e)
e.printStackTrace();
//Code for Pass Resulted column to Procedure Input for delete Particular Record
Execute parameterized PL SQL procedure from OAF page
Let us try to call PL/SQL package from OAF page. We will try to remove selected line from Database.
Package Spec
CREATE OR REPLACE PACKAGE APPS.genpack_pkg
AS
PROCEDURE roll_delete_proc (orgId IN VARCHAR2);
END genpack_pkg;
Package Body
CREATE OR REPLACE PACKAGE BODY APPS.genpack_pkg
AS
PROCEDURE roll_delete_proc (orgId IN VARCHAR2)
AS
BEGIN
DELETE FROM pklist_roll_details_temp
WHERE roll_line_id = orgId;
COMMIT;
END roll_delete_proc;
END genpack_pkg;
//in Controller PFR
import java.sql.CallableStatement;
if (pageContext.getParameter("ActionsButton") != null)
String val = pageContext.getParameter("ActionsChoice");
if ("DELLN".equals(val))
CallableStatement cstmt = null;
for (OAViewRowImpl row = (OAViewRowImpl)tempvo.first(); row != null; row = (OAViewRowImpl)tempvo.next()) {
if ((row.getAttribute("Selectflag") == null) ||
(!row.getAttribute("Selectflag").toString().equals("Y"))) continue;
try {
int rollid = Integer.parseInt((String)row.getAttribute("orgId"));
Connection conn = am.getOADBTransaction().getJdbcConnection();
if (rollid == 1)
temphm.put(row.getAttribute("orgId").toString(), row.getAttribute("PoNumber").orgId());
tempvo.removeCurrentRow();
else
try
StringBuilder sb = new StringBuilder();
sb.append(rollid);
String strI = sb.toString();
System.out.println("Inside else in delete");
cstmt = conn.prepareCall("{call GENPACK_PKG.tpc_roll_delete_proc(?)}");
cstmt.setString(1, strI);
System.out.println("Oracle Callable Statment Execution Init for Delete");
cstmt.execute();
catch (SQLException e) {
throw new OAException(e.toString(), (byte)0);
}tempvo.removeCurrentRow();
catch (OAException e) {
throw new OAException("No row selected", (byte)3);
Thanks,
Dilip
Maybe you are looking for
-
Skipping an approver for particular requisition items - purchase requisitio
In our purchase requisition approval heirarchy we want to skip one approver if it is a fixed asset , is it possible to conditionally forward documents, it has to happen automatically without user forwarding skipping the particular approver.
-
TDMS functions much slower in CVI 2010
Hello everyone. Today I noticed that at least some TDMS functions are much slower in CVI 2010 compared to CVI 2009 SP1 and prior. I have created and attached a simple sample project that creates a TDMS file with about 3000 file level properties and t
-
Calling a Business process without using RMI nor WS.
For efficience reasons we are interested in calling business processes from java classes deployed in the same server that WLI but without using RMI calls. In the documentation it's said that you are able to call Business Processes via WebServices, or
-
Hi, I am wondering if there is a solution to automate the creation of an Acrobat form... the scenario is..: I export a PDF from Filemaker with a checkbox... This PDFfile can be opened in Acrobat and with the tool <<form-->create from current document
-
How to count the values to identify the record instead of previous record
Hi friends i have to identify the record, my table is like this, S means sale, from 56 -> 8 sale, and 48 is new, now i have to update the 8 as ->S in table2 i dont no how to do coding for this, and i have inserted a column as is_identify default as N