Passing input parameter to User Defined Procedures in ODI
Hi
I have to develop a procedure with an update query as follows
Update Rec_Count set status as 'Y' where TableName = 'Name of the table'
Here the 'name of the table' should be sent as input parameter while executing the package and this has 9 values.
Kindly help me resolve this issue.
Thanks
Hi,
Create a variable
eg :- VarName
and your query should be
Update Rec_Count set status as 'Y' where TableName = '#VarName'
Steps in package:
step 1 :-
refresh the variable ,
or assign the variable while executing the package.
Step 2
Your procedure
This will take the variable value dynamically while executing
Regards,
Rathish
Edited by: Rathish on Aug 18, 2009 3:38 PM
Similar Messages
-
Pass a datarow as input parameter in a stored procedure
Hi everyone!
I wonder if anyone know how to pass a datarow (better if tipized like "tablenameRow") as input parameter for a stored procedure.
links or suggestions are welcome! (i'm newbie in .net programming, so if you can post some code i'll be really grateful!)
Thank you!Hi,
YES!! its possible you can pass a datarow to a SP from your Dot net application.
Here below i'm going to give you an example for Desktop Application.
For Passing a datarow as Input Parameters, your SP need to support for all these parameters.
I mean, if a data row has 03 Columns. Then your procedure should be able to take 03 arguments/parameters.
--Adjust code according to your need.
--Its for C# Desktop application.
--Visual Studio Professional, Framework (2.0)
//Setting connections.
OracleConnection con=new OracleConnection("Data Source=orcl9i; user id=scott; password=tiger");
OracleComand cmd=new OracleCommand(con);
cmd.Type=CommandType.StoredProcedure; //you are useing SP
cmd.Text="my_stored_procedure"; //Mention SP name.
--if DataRow has Three columns. You need three parameters.
OracleParameter p1=new OracleParameter ();//By default parameters are input parameters.
OracleParameter p2=new OracleParameter ();
OracleParameter p3=new OracleParameter ();
//We assume that Datarow already has data in it.
p1.ParametersName="sp_var1 ";
p1.OracleDbType=OracleDbType.Varchar;
p1.Value=tablenameRow[1]; //Here DataRow object's Column1 is input.
p2.ParametersName="sp_var2 ";
p2.OracleDbType=OracleDbType.Varchar;
p2.Value=tablenameRow[2]; //Here DataRow object's Column2 is input.
p3.ParametersName="sp_var3 ";
p3.OracleDbType=OracleDbType.Varchar;
p3.Value=tablenameRow[3]; //Here DataRow object's Column3 is input.
cmd.OracleParameter.Add(p1); //Add parameters.
cmd.OracleParameter.Add(p2); //Add parameters.
cmd.OracleParameter.Add(p3); //Add parameters.
cmd.ExecuteNonQuery(); //Execute Procedure here.
Feel free to ask if still found problem.
.... -
CANT execute query with parameter on user defined tables using query genera
Dear All,
I have problem when executing query with parameter on user defined tables using query generator.
It seems SBO cannot accept parameter to query user defined tables.
I've tried these:
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
I try to pass the value directly without using parameter and It works
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
This one works
SELECT * FROM RDOC T0 WHERE T0.width =[%0] --- this SUCCESS
and this one works too
SELECT * FROM RDOC T0 WHERE T0.width = 595 --- this SUCCESS
Is there anyone can help me ....???
Thanks,
AlfaI generated this code using query wizard ....
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = (N'2' )
and replaced the (N'2' ) with [%0]
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = [%0]
and It worked ......
Thanks 4 all ..... -
Set Null as Default for input parameter to a stored procedure
hi ,
How can we set default values as NULL to an input parameter in a stored Procedure.
create or replace procedure emp_proc ( p_test_input in varchar2
p_emp_id in number,
p_emp_name in varchar2,
p_manager_id in number )
as
begin
if ( upper ( p_test_input ) = 'I' )
then
insert into emp
values ( p_emp_id ,p_emp_name ,p_Manager_id,sysdate );
elsif ( upper ( p_test_input ) = 'D' )
then
delete from emp
where emp_id = p_emp_id;
else
dbms_output.put_line
( 'Please input ''A'' for ADD or ''D'' Delete EMPLOYEE'
end if;
end;As Shown above if i want to do only delete operation
i want to call this procedure like without passing extra parameters .
EXECUTE emp_proc('D',1010);Edited by: Rede on May 28, 2010 12:21 PM
Edited by: Rede on May 28, 2010 12:22 PMcreate or replace procedure emp_proc ( p_test_input in varchar2,
p_emp_id in number,
p_emp_name in varchar2 default null,
p_manager_id in number default null ) -
How to pass the parameter of a stored procedure to iReport
Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
In the Report Query, i tried
1. sp_storedprocedure ' value'
2. sp_storedprocedure +''''+$P{parameter}+''''+
3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank youFor M$ SQL server I find that it only works when U use the fully qualified name...
e.g. catalod.dbo.my_procedure_name 'variable'
My full query in the Report Query window is something like this:
EXEC arc.dbo.jasper_Invoice 1000
Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
CREATE PROC jasper_MyProc (@my_rec_id integer) AS
SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
...to wrap your SELECT statement, then call the PROC
Edited by: Sylinsr on Apr 22, 2008 4:23 PM -
How to Pass multiple parameter into single store procedure
How to Pass multiple parameter into single store procedure
like a one to many relationship.
it is possible then reply me immediatlyyou mean like this .....
CREATE OR REPLACE procedure display_me(in_param in varchar2,in_default in varchar2 := 'Default') is
BEGIN
DBMS_OUTPUT.put_line ('Values is .....'||in_param || '....'||in_default);
END display_me;
CREATE OR REPLACE procedure display_me_2 as
cnt integer :=0;
BEGIN
For c1_rec In (SELECT empno,deptno FROM test_emp) Loop
display_me(in_param => c1_rec.empno);
cnt := cnt+1;
end loop;
DBMS_OUTPUT.put_line('Total record count is ....'||cnt);
END display_me_2;
SQL > exec display_me_2
Values is .....9999....Default
Values is .....4567....Default
Values is .....2345....Default
Values is .....7369....Default
Values is .....7499....Default
Values is .....7521....Default
Values is .....7566....Default
Values is .....7654....Default
Values is .....7698....Default
Values is .....7782....Default
Values is .....7788....Default
Values is .....7839....Default
Values is .....7844....Default
Values is .....7876....Default
Values is .....7900....Default
Values is .....7902....Default
Values is .....7934....Default
Values is .....1234....Default
Total record count is ....18 -
Passing input parameter to a oData service
Hi,
I am trying to develop a simple application using sapui5 and data comes from OData service. I am trying to pass input parameter to OData service in sapui5 Application.
how i do it ...
please help me..............................I too have a such requirement, any help ?
Thanks. -
Calling PL/SQL user defined functions from ODI Constraints
Hi All,
We are trying to call user defined PL/SQL functions from ODI. We are able to call them from ODI's User functions. But when we are trying to call them from ODI Constraints under Models, it is throwing an error 'ORA-00920 invalid relational operator'. Kindly let me know if anyone has faced the same issue and got the resolution for the same. Thanks in Advance.
Regards,
Abhishek SharmaHi Ace,
Thanks for the response, the same error was coming in operator also.
I am able to call PL?SQL user defined functions from ODI Constraints. We have to first call ODI User functions from the ODI constraints as we cant call PL/SQL function (compiled in database) directly.
From the ODI User functions, we can then call the PL/SQL functions.
Please reach out to me if you need further details reg this. -
Hi Friends ,
What is User Defined Flags in ODI like UD1, UD2, UD3, UD4, UD5, UD6, UD7, UD8, UD9, UD10
and how we can use this in Interface level....This are used for modification of KM and generaly used in option to perform some modified action defined on the sellected columns
-
Can I pass an array as an input parameter for a stored procedure on SQL Server 2000
I am trying to pass an array to a stored procedure residing on my SQL Server 2000 database server. Is this even possible? If it is possible, what is the syntax for this?
Any help would be greatly appreciated.
ThanksI have passed arrays to and from a database using SQL and ActiveX, including to and from stored procedures, but I cannot recall the precise method used to do so. If memory serves, everything is in the form of a string. You need to do a lot of parsing and 'unparsing' to get this data into your stored procedure.
You are left with a couple of options to get your data to the stored procedure. I recommend using SQL in LabVIEW wherever possible as it saves the amount of external code calls (and believe me, calling ActiveX procedures developed by someone else in Visual Basic is NOT much fun at all...). You can either send the array and other data to the stored procedure (you will find the syntax in the SQL references in LabVIEW help under SQL), or you can send
the array to the database, and have the database then act upon the array.
I strongly recommend making routines (subVIs) to handle these operations.
Sorry I don't have the syntax, I don't have SQL installed on this machine. If you can't find the syntax in the help, please post here again.
-Mike Du'Lyea -
Pass Input Parameter With Blank To SSIS Get Strange Result
Hi! I stuck for a while when executing SSIS from stored procedure with input parameter. My input value is not consistent with output one. If I pass value with blank , SSIS seems gets second part. For example , if I pass "CALL FROM SP", SSIS get
"FROM" only.
I use Execute SQL Task to store input parameter. Here is the SSIS snapshot.
And here is the sp snippet
DECLARE @Path VARCHAR(200),
@Cmd VARCHAR(4000),
@ReturnCode INT,
@QUERY_STRING VARCHAR(70),
@BATCH_NO VARCHAR(14)
SELECT @Path = 'xxxxxx'
SELECT @QUERY_STRING = 'CALL FROM SP'
--BatchNo = YYYYMMDDHHMMSS
SELECT @BATCH_NO = CONVERT(VARCHAR(10),GETDATE(),112) + REPLACE(CONVERT(VARCHAR(8),GETDATE(),108),':','')
SELECT @Cmd = 'DTexec /FILE "' + @Path + 'Package1.dtsx" /MAXCONCURRENT 1 /CHECKPOINTING OFF /REPORTING EW ' + '/Decrypt ALCM '
+ ' /SET \Package.Variables[User::BATCH_NO].Properties[Value];' + @BATCH_NO
+ ' /SET \Package.Variables[User::QUERY_STRING].Properties[Value];' + @QUERY_STRING
My test are
input parameter
write to TESTTB correctly ?
any error?
execute SSIS in design mode
CALL FROM SSIS
YES
execute SSIS by sp
CALL FROM SP
NO
Option "FROM" is not valid.
execute SSIS by sp
CALL_FROM_SP
YES
Anyone could give me some hint ?
Thank you so much!!Hi Nick,
It occurs because an argument of the DTExec commands must be enclosed in quotation marks if it contains a space. From the dtexe (SSIS Tool): Syntax Rules section of the
dtexec Utility (SSIS Tool) document, we can see:
All options must start with a slash (/) or a minus sign (-). The options that are shown here start with a slash (/), but the minus sign (-) can be substituted.
An argument must be enclosed in quotation marks if it contains a space. If the argument is not enclosed in quotation marks, the argument cannot contain white space.
Doubled quotation marks within quoted strings represent escaped single quotation marks.
Options and arguments are not case-sensitive, except for passwords.
So, you need to make the value of the variable @QUERY_STRING within double quotes in the value of the variable @Cmd or remove the space within the @QUERY_STRING value.
Regards,
Mike Yin
TechNet Community Support -
Declaring input parameter for flag in procedure!!!!!
hi,
can anyone tell how to declare the flag i,e true or false as an input parameter in the procedure.
here is the code wat i have
create or replace procedure test
cur_out out sys_refcursor
as
begin
open cur_out for
select field1
from Test
where REPORTING_FLG = 'y' --(here i want the user to select 'Y' or 'N' )
ORDER BY field1;
end TEST;
In the where condition i want the user to select the 'y' or 'N'. So i have to give input parameter i guess. So could anyone let me know how to give input parameter for flag.
Urgent PLZ!!!
Thank u in Advance.May be this way:
Create or Replace procedure test (cur_out out sys_refcursor,flg in varchar2)
as
begin
open cur_out for select field1 from Test
where REPORTING_FLG = flg
ORDER BY field1;
end TEST;
We can only pass Input parameters! -
I have a SAP BAPI (Y_GET_APPR_LIST), which takes an import paramter (USER) and returns a structure. I have created the MBO (GetApprList)
I have also generated a CREATE operation (setGetList) with the same input and out parameters.
I have generated the code for BlackBerry, imported the code into Eclipse.
My question is how do I pass the the input parameter and get the result set back in Eclipse.
GetApprList obj = new GetApprList();
obj.setGetListUSER("XXXXXX");Hi please make sure you have done these steps before generating the code.
1.create the sync parameter and map that sync parameter to the your list field.
2. Please link this sync parameter to the load parameter(this is your input parameter ).
3. Generate your code.
in the generation code you can find the yourListSyncParameter Class.
Now in your blackberry application before calling the appDB.synchronize() method.
YourListSynchronizationParameters synParm=YourList.getSynchronizationParameters();
synParm.setSyncValue("value");
synParm.save();
appDB.synchronize("syncGroup");
Regards,
Ram -
How to pass input parameter (parameterized mapping) to java mapping program
Hello
I have a question about the parameterized mapping with Java (PI 7.1).
In the operation mapping (using Java-class) I defined a inputer parameter (string). I think I am supposed to retrieved the value using:
arg0.getInputParameters().getString("myInputParameterName");
where arg0 is the TransformationInput object.
However I am not able to get the value, I got runtime exception saying the inputer parameter doesn't exit.
Then I figured out maybe I need to bind the OM input parameter to Java mapping parameter, just like in case of message mapping, you need to bind OM parameter to MM parameter. However there is no way to define input parameter for the java mapping program.
Anybody has done java mapping with parameterized mapping?
Anybody can give any hint for this?
Thanks
JaysonInputParameters params = container.getInputParameters();
DynamicConfiguration conf = (DynamicConfiguration) params.getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Edited by: Anand on Dec 10, 2008 4:13 PM -
Multiple input arguments in User defined funcions
Hi Experts,
I have a file to proxy sceanrio.Have to do one to one mapping of all the corresponding fields except 3 fields. for eg
1) - <Services>
<DisplayValue>Tax>Business Tax</DisplayValue>
</Services>
Sender Receiver
===== ========
Tax Functions
under the services tag the "Tax" is one of the sender's field .I need to map this "Tag" to the receiver field called as "function".My question is: can we do wz some user defined functions or we have to use java functions.If we use Java,what way we can implement in PI 7.1 because,i guess we can not use the multiple input arguments.
2) similarly,
- <LineOfBusiness>
<DisplayValue>Consumer Markets>Retail</DisplayValue>
</LineOfBusiness>
Sender Receiver
===== ========
Retail Sector
Retail is one of the sender field.it should be mapped wz another field "Sector" at receiver side.how to pick up the retail field and map it to the receiver side.Is there any user define function for this or we have to write java code if we have to go for Java,how it will be implemented in PI 7.1
3) similarly,
- <GeographicLocation>
<DisplayValue>Americas>North America>Null>United States & Virgin Isl.>United States,US,USA,United States of America</DisplayValue>
</GeographicLocation>
Sender Receiver
===== ========
Americas Region
North America Sub region
Null Area
UnitedStates,US,USA,United States of America Territory
As u all can see,the above corresponding sender fields should be mapped to Receiver fields.It all has coem under one line in XML.How to pick it up and map 1 to 1 at the receiver side bcoz receiver wants it as a separate fields.Is there any user define function for this or we have to write java code if we have to go for Java,how it will be implemented in PI 7.1
Experts,please help me out as this is a live scenario.
Thanks in Advance
VeeruHi,
here is the partial structure.pls have a look.
<Services>
<DisplayValue>Tax>Business Tax</DisplayValue>
</Services>
- <LineOfBusiness>
<DisplayValue>Consumer Markets>Retail</DisplayValue>
</LineOfBusiness>
- <GeographicLocation>
<DisplayValue>Americas>North America>Null>United States & Virgin Isl.>United States,US,USA,United States of America</DisplayValue>
</GeographicLocation>
I have to do mapping b/w tax and some receiver field and it is a 1 to 1 mapping.how to extract teh field "tax" from that beause there is also a field name "business tax ".
same with the field name "Retail" .
and also with the field names Americas>North America>Null>United States & Virgin Isl.>United States,US,USA,United States of America
I have to extract one-one field and map to corresponding single fields at the receiver side.
Have i presented properly.
Please help me out.
Thanks
Veeru
Maybe you are looking for
-
I want to review content in a backup from a previous iOS device to decide whether to delete the backup from iCloud. I'm most concerned about keeping photos I took on the previous phone. Ideally, I would consolidate the photos to my current device and
-
I am trying to set up the Orchestrator Connector for Service Manager, when running the test, I get the error <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2> <h3>You do not have permission to view this directory or page us
-
Convert multiple layers into separate smart objects
I have multiple layers in a document that I want to make into separate smart objects. If I select them and choose "convert to smart object" in the Layers Panel fly out, it flattens the layers into 1 smart object. Can it be done, or do I need to make
-
AAA user cache flush not working after 10.1.4.2 patch
After we applied the OAM 10.1.4.2 patch to our test and QA environments, user cache flushes don't appear to work on the Access server. This is the case for both automatic flushes via the Identity server, and manual flushes from the Access server cons
-
Macbook will not turn on or charge!!! HELP!!!
I have had this Macbook for only three months. Lastnight I turned it on and it all of a sudden said something about a HUB device is drawing to much power and is deactivating. I had nothing but my power adapter hooked up to it. Then it shut off. And n