ODI Procedure (passing parameter from command on source to command on target) issue.

Hi All,
I am working on ODI 11.1.1.5.
I am trying to run a select query on 'command on source' and tying to capture the output into command on target and execute the code captured.
'command on source'
select 'BEGIN ' || 'dbms_stats.gather_table_stats(ownname => ''' || pfg.table_owner || ''', tabname => ''' || pfg.table_name || '''' ||'END' ||';'  SQL_TEXT from TABLE_GROUP pfg , ALL_TABLES at
where pfg.enabled = 'Y'     and   pfg.group_name = 'TABLE_NAME'     and   pfg.table_owner = at.owner     and   pfg.table_name  = at.table_name  (forgot abt the syntax, i have removed some part of the code to make it simple)
the desired output will be:  (SQL_TEXT in the above code is to capture the output into it)
BEGIN dbms_stats.gather_table_stats(ownname => 'OWNER_NAME', tabname =>  'TABLE_NAME', estimate_percent =>  DBMS_STATS.AUTO_SAMPLE_SIZE, degree =>  DBMS_STATS.DEFAULT_DEGREE); END;
I am getting the desired result , the only problem is passing on this to 'command on target'. On "comm on target", I wanted to run this whole output (from BEGIN to END, as above) so I followed the below syntax/method of calling/executing this:
:SQL_TEXT (did not work)
#SQL_TEXT  (did not work)
Any help on this is much appreciated. thanks in advance.
Regard,Sp.

It will not work like that. you have to either store the variable value in other variable and then use that.
or
write command on source like
select pfg.table_owner SQL_TEXT1,pfg.table_name SQL_TEXT from TABLE_GROUP pfg , ALL_TABLES at
where pfg.enabled = 'Y'     and   pfg.group_name = 'TABLE_NAME'     and   pfg.table_owner = at.owner     and   pfg.table_name  = at.table_name
command on target/ technology --> oracle
BEGIN
dbms_stats.gather_table_stats(#SQL_TEXT1 || #SQL_TEXT)
END
I have not try out this before but i believe it will work.
let me know
Thanks

Similar Messages

  • Passing Parameter from Main report to SQL command-based subreport

    I am trying to cut down the run time of my reports and have recently figured out how to write SQL commands to limit the data by filtering prior to being pulled into the reports.  However, many of my reports rely on multiple sub reports, which can cause a dramatic 'drag' on the report.
    I am trying to filter the SQL command used in my sub report by passing the group parameter, which is selected by the user in the main report, to the sub report's SQL command.  Without this parameter, the sub report has to sort through a lot more data than it would with this parameter, making the run time extremely slow.
    Any suggestions on how I can accomplish this?
    Thanks for any help you can provide,
    Marlene Allen
    Crystal Reports Developer
    Crystal Reports Professional;
    Product Type: Full;
    Product Version 11.5

    Hi Marlene,
    I don't believe you can pass a CR parameter to a Command object.
    I suggest replacing all of the Command Objects with a Stored Procedure so all of the data filtering is done server side. DB servers are much more proficient at collecting the data and filtering than CR will ever be. It will also allow you to replace subreports to also speed up your report processing. All depends on your layout of course but something to look at.
    Thank you
    Don

  • How to pass parameter from 1 stored procedure to another stored procedure inside crystal report

    Hi
    I have several stored procedure in my Crystal Report. I am wondering if it is possible for me to pass a parameter to one of the stored procedure and to use the result of that stored procedure E.g. CustomerCode. To another 2 stored procedure to generate the report dynamically?
    I have 3 stored procedure
    The 1st one is used to gather information and process the calculation
    another 2 stored procedure is used for generate the graph and both of them required to take 2 parameters. The 1st stored procedure will require 1 parameter (E.G. Reference Code) and will return a set of information including the data that could be use on the other 2 stored procedures.
    After I added these 2 stored procedure, it requires me to pass 3 parameters to the report. I would like to know if I could only pass the Reference Code for stored procedure 1 and use it to retrieve the information for the other 2 parameter?
    Thanks in advance
    Chi

    Hi Chi
    To pass parameter from 1 stored procedure to another stored procedure, you will have to create sub report. In your case you will have to create 2 sub reports for 2nd and 3rd stored procedure and link those sub reports with the main report using Reference Code field in order to pass the values.
    After creating the report when you will refresh the report, it will ask 4 parameters, one parameter for main report, one for the first subreport and two for second subreport to fetch the data correctly.
    Regards
    Poonam Thorat.

  • How to pass parameter from form6i to report6i

    when i passed parameter from form6i to report6i, while previewing report the data was not displaying only fields heading was displaying, but in report6i there is a parameter form thru that it was displaying data, but thru form6i to report6i it was not. Please kindly help me and give me the some sample or example of it.
    Thanks
    Best regards
    Zaheer

    ADD_PARAMETER(pl_id,'P_SCRIPT',TEXT_PARAMETER,:b1.script);

  • Master-detail relationship - passing parameter from form to form

    Hello.
    I have a question about master detail relationship.
    In first form we have master-detail relationship.
    Example on dept, emp tables:
    We query dept (master), so we can get one or many emp (detail) records. Then we have a third table - tasks. Tasks table (detail) can have many records for one employee.
    Tasks table is in another form, which is called with call_form built_in. So we pass a parameter from master to detail - parameter empno. Because of that, we can only see tasks for one employee and can't navigate to another employee. This is normal.
    Now comes the question.
    Is it possible to call a form (with tasks table) with deptno parameter (so we can navigate through all employees with that department), but first show employee that was last used in first form?
    Example of our goal.
    Master: deptno = 20
    Detail: navigate to JONES employee
    Call new form (tasks)
    Tasks for JONES employee are first shown
    Can navigate to another employee - without requery
    Is this possible?
    If we pass deptno parameter, we can navigate through all employees - but must navigate to the employee we last used in first form.
    If we pass empno parameter to second form, we see last used employee but cannot navigate to another employee without requery.
    Hope you understand my problem.
    Thanks.

    Hi
    yes you can pass parameter from one form to another.
    In your master detail form set the trigger when-new-instance and there define the global variable like
    :GLOBAL.G_CIRCLE_ID := NULL;
    and in your task table set the trigger when-new-instance and there define the global variable like and also write this code
    :GLOBAL.G_DIVISION_ID := NULL;
    IF :GLOBAL.G_CIRCLE_ID IS NOT NULL THEN
         GO_BLOCK('DIVISION');
         SET_BLOCK_PROPERTY('DIVISION',DEFAULT_WHERE,'CIRCLE_ID ='||''''||:GLOBAL.G_CIRCLE_ID||'''');
         EXECUTE_QUERY;
    END IF;
    :GLOBAL.G_CIRCLE_ID := NULL;
    now you maintain your trigger according your need.
    Regards,

  • Problem while passing parameter from report to report.

    Hi
    I'm using forms and reports 10g, hava a problem while passing the parameter from reports to report.
    i'm using srw.set_hyperlink to call report from report.
    i have created a key value in the cgicmd.dat file called
    faccre802005-2006: report=faccre80 destype=cache desformat=pdf userid=<userid/passwd@cs> server=<servername>
    Now in the format trigger i'm using this key value
    function BTN_DEBITFormatTrigger return boolean is
    temp varchar2(5000);
    IP_ADDRESS VARCHAR2(50);
    SERVER_NAME VARCHAR2(10);
    L_ACCT_CODE VARCHAR2(14);
    begin
    SELECT MAST_INT_DESC,MAST_USER_PGM_ID INTO IP_ADDRESS,SERVER_NAME FROM MAST_INT_INFO WHERE MAST_INT_ID='VISHWA';
    temp := IP_ADDRESS||'?faccre80'||:P_FIN_YEAR||'+server='||server_name;
    temp :=temp ||'+'||'P_PREVIOUS_CODE='''||:ACCT_CODE||''''||'+'||'P_COMPANY_CODE='''||:P_COMPANY_CODE||'''';
    temp :=temp ||'+'|| 'P_FROM_DATE='''||TO_CHAR(:P_FROM_DATE,'DD-MON-RRRR')||''''||'+'|| 'P_TO_DATE='''||TO_CHAR(:P_TO_DATE,'DD-MON-RRRR')||''''||'+'||'P_TRUST_CODE='''|| :P_TRUST_CODE||'''';
    temp :=temp ||'+'|| 'P_UNIT_CODE='''||:P_UNIT_CODE||''''||'+'||' P_FIN_YEAR='''||:P_FIN_YEAR||'''';
    temp :=temp ||'+'|| 'P_LEVEL='''||:P_LEVEL||''''||'+'||'P_HEADER='''||replace(:P_HEADER,' ','%20')||''''||'+'||'P_FORMAT='''||:P_FORMAT||'''';
    SRW.Set_Hyperlink(temp);
    END;
    return (TRUE);
    end;
    Report is coming but not the expected result because parmaeters are not coming from first report to second report.
    If i dont use cgicmd file userid and password are displyed in the URL.
    Pl tell me how to pass parameter from one report to another.
    thanks and regards

    Hi
    I got the solution.
    I forgot to add %* at end of the KEY value.

  • How can I pass parameter from report to form?

    Hi :)
    Now I try to build conference room like this by using form
    and report. And i design that when users click at group report
    then i'll show page that contain questions report and add
    question form. And question form and report must receive the
    same parameter from group report.
    First Problem: is I don't know how group report send the
    same parameter to question report and add question report at the
    same time. And is it possible??? If not please suggest me what
    should I do???
    Second Problem: is I don't know how can I pass parameter from
    report to form. I don't know the way to do it.
    Please tell me!!! Please...
    I look forward to hearing from all of you.
    Thank You.

    One way is to create a link based on that form and attach that
    link with the report. Through links you can pass parameters

  • How to   Pass Parameter from BIP  to Dashboard  Report

    Hi,
    Parameter from BIP to Dashboard Report
    If I select BIP report paremeter should pass value to dashboard report
    thanks in advance.
    CHEERS ,
    Jel

    Hi Saichand,
    I hav gone through above link its passing values from Dashboard prompt to BIP report only..
    just i need like reverse (if i click on BIP report value then it should pass that value to Dashboard reports) in this this case how to pass parameter from BIP to dashboard report
    Thanks in advance
    Cheers,
    Jel

  • Hw to pass parameter from report to forms

    Dear Friends,
    I m working on Forms n Reports 6i,
    I m running report n passing parameter from the forms now the requirement is that if report run successfully it shuld give the msg otherwise give an user define error msg.
    Hw do i pass any parameter from report to form for acknowledgment.
    Thanking yours
    Chandan

    Hi Rajat,
    using run_product built in i can pass parameter from forms to reports but hw can i get some parameter value from reports to forms as mentioned earlier my post
    Thanking Yours,
    Chandan

  • Passing Parameter from URL to Web Forms - Oracle 10 Application Server

    Hi All -
    I want to pass parameter from a URL to 10g Oracle Web Forms - Oracle Application Server 10.1.2
    http://server1/forms/frmservlet?config=SATWEB_SSO&otherparams=username_sso=BABUS
    How to receive this 'username_sso' value inside my forms application ?
    Created a Parameter in the same name as URL parameter 'username_sso' in forms but didn't receive the value. I want to know how to receive the value of this parameter within forms from URL.
    Thanks - Suresh

    Try this,
    1. Create a parameter in the formsweb.cfg (say username_sso) under default section ( or you can create it in your own config section)
    2. Add the username_sso in otherparams parameter as username_sso=%username_sso%
    3. Add this username_sso parameter in your form.
    4. Run the form as
    http://<machine>:<port>.....?form=blahblah....&otherparams=username_sso=scott
    Regards,
    Arun

  • Not able to pass parameter from one fragment to another fragment in another taskFlow

    Hi,
    I'm trying to pass parameter from one fragment to another fragment and want to print the parameter value in second fragment.
    i have inputtext in first frag---
    first fragment belongs to one taskflow1 and this taskflow1 i had darg and drop to one mainPage.
    Under taskflow1 itself i drag and drop one taskflow call activity and on top of that i drag and drop another bounded taskflow as taskflow2
    under taskflow2 i have one fragment as fragment2and in that i have one outputtext field, now here i want to print the value from fragment1--inputtextfield value
    to achive this i had tried many ways but somewhere doing mistake please explain step by step.
    Thanks
    Mahesh

    In addition you need to tell us your jdev version!
    Can you elaborate on your use case a be more?
    On which event this should happen?
    In general contextual events should allow you to implement this, however, as I don't understand the use case, I find it hard to help.
    Timo

  • Passing parameter from workitem to bsp page

    Hi,
    is it possible to pass parameter from workitem to bsp page and also vice versa?

    SAP_WAPI_READ_CONTAINER function works well.but i need to pass a parameter to workitem container.
    what i am trying to do is;
    1-get data by using sap_wapi_read_container
    2-change data
    3-send changed data back to workitem
    my problem is in third step.I am using SAP_WAPI_WRITE_CONTAINER. but it doesnt work.After execution the FM return_code set to 1.
    Do u know how to set a variable in workitem?

  • Pass Parameter to IN Operator in SQL Command in OLEDB source

    Hi,
    I am trying to pass multiple values as one parameter. Eg: I need to get the employess with gender in ('M','F')
    query: select eno, ename, sal, gender from emp where gender in (?)
    Created a variable 'varGender' with the value - 'M','F'
    And passed the parameter mapping in OLEDB Source. But this is not returning any records.
    Please advise.
    Thanks.

    Hi Vaibhav,
    Thanks for your kind reply.
    I need to pass the same where condition to multiple source queries and we don't want to repeat the same condition in all queries and replace with a variable. Also the query is too big to keep it in the Variable. Please help me.
    Thanks
    Put the required filter values in a staging table and then use it in a join condition with all the other tables in all the other tasks.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Passing parameter from url to procedure

    i used to pass parameters from url to procedure like
    host:port/dads/schema.procedure(para_1, para_2, ...)
    for example
    http://localhost:7777/pls/login('UK',1,0)
    they have been working perfectly before, when i had 8i and webdb.
    but now i'm running 10g, and browser returns error page 400 when i click the above links.
    i know i can do
    host:port/dads/schema.procedure?para_1=value1&para2=value2...
    for example
    http://localhost:7777/pls/login?language=UK&section=1&timezone=0
    and this is what have been suggested in documentation of 9i and 10g
    however i have quite a few webpages written in the former syntax and they used to work with 8i and 9i.
    i don't want to change all the links in web pages, i prefer to stick with old style.
    any one has any idea? is there a switch i should take care of? i checked apache conf files (httpd, mod_plsql, dads) but didn't get it.
    ps for 10g companion, i installed http server (apache) only, no html db.
    another question is
    with brackets() in url, strings are to be quoted by ' ', but with question mark (?), single quote ' ' must not be used, is that what it has to be?
    Thanks a lot

    anyone have been using this?
    http://host:port/dads/schema.procedure(para1,para2,..)

  • Pass Parameter to OLE DB Source

    I am new to SSIS and having trouble passing parameters to OLE DB Source. I want to query data for a given date range. 
    I have two variables, variable1 of data type Date Time and the value of the variable is set by expression DATEADD("day", -1, GETDATE()). variable2 of data type Date Time and the value of the variable is set by expression DATEADD("day",
    0, GETDATE())
    Inside the OLE DB SOURCE the data access mode is set to SQL command, below is the SQL Code.
    Select Col1, col2, col3, col4, coldate where Col1 = 'abc' and  coldate between convert(varchar(10), ?, 101) and convert(varchar(10), ?, 101)
    I have mapped the parameters as
    Parameter0, User::variable1, input
    Parameter1, User::variable2, input
    When I hit preview, I get an error 
    "There was an error displaying the preview
    Additional Information:
    No Value given for one or more required parameters. (Microsoft SQL Server Native Client 11.0)"
    When I debug the task the error I get is 
    [OLE DB Source [38]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E21  Description: "Invalid character value for cast specification".
    Note: The datatype for column coldate is datetime
    Please help me resolve this issue.
    I was able to query successfully using data access mode SQL command from variable inside OLE DB Source but I was asked not to use data access mode as SQL command.
    Thank you.

    There is an issue with the value in the variable for date, this happens when the date format is incorrect,
    Please make sure the value in the date variable is dd-mm-yyyy format,
    Please see the below steps to add the variable for OLE DB source.
    Once you click on parameters , you can see the below screen, which pop's up and you can map the variable to parameter which you have declared in the query.

Maybe you are looking for

  • I have another question related to the connection and operation of FP-RLY-422

    1. I use one 25 VDC power to supply power for all the five fieldpoint modules(i.e. V and C terminals of FP-2000, FP-AI-110, FP-AO-200 and FP-RLY-422 are connected) However, as cascading power from neighboring bases or network modules defeats isolatio

  • How : Invoke asynchronous BPM process with callback within loop?

    Hi All, I'm currently using the 11g suite to create 2 BPM processes (Validate and Review). Process Validate is asynchronous and has a callback facility. I intend to invoke Validate from Review as a subprocess. My question would be, is it possible to

  • Creating 2nd library

    Hey all, this is my motivation for doing this: my wife's pics reside within the original library and I don't want to mess with it. Need to download 40 or so pics in a new space and after a week delete. This will probably involve at least 'rotating im

  • Netweaver 7.0 ABAP trial version installation failure

    Hi,       Iam trying to install SAP NetWeaver 7.0 ABAP Trial Version in my system. I have started the installation process by executing "SapGuiSetup.exe" which installed SAPGUI on my system. Then, when i executed  "maxdbtools/DBM76.exe", the followin

  • Slides in Navigator scroll too fast

    Dragging slides in Navigator to reorder my slides is nearly useless on my setup, as the slides scroll way, way too fast. Unless I have lightning quick reflexes, I find myself at the top or bottom of my presentation within a fraction of a second. Movi