How to pass parameter into sql block?

example code
@script.sql a b c d
Inside script
DECLARE
cursor cur is select col1 from table where col1 in ('a','b','c','d','e');
BEGIN
END;
Not sure 1) The the total number of parameters will be passed at run time
2) Not sure of case, could be lower upper or both....
Please help...

do you have different queries which are defined to use different numbers of parameters, OR (more likely) sometimes you just want to pass less parameters?
sqlplus / @file1 "a" "b" "" "" ""
now I only passed 2 "real" params, and 3 blanks. that way, sqlplus still has the values of &3 - &5 defined, and everything works fine. you'lll need either single or double quotes (or perhaps single quotes within double quotes) depending on your os, version, etc.

Similar Messages

  • How to pass parameter into a source variable of a invoke activity

    I'm an new BPELer, I created a invoke activity to submit Oracle Appplications concurrent program, but I don't know how to pass parameter into source variable.
    BTW, I have created the mapper file (.xsl) file.
    could anyone tell me how to do that?
    Thanks,
    Victor

    Hi.
    How you start application? I think you send message to webservice(BPEL process is webservice too). So construct message with variable and value.
    But I created only processes where input value doesn't matter. I haven't use mapper yet too.

  • How to pass parameter into transaction iview ?

    Hi experts,
    I want to know "how to pass parameter into transaction iview ".
    Regards,
    Krishna Balaji T

    Hi Krishna,
    Not sure if this can help you.
    1) Passing a parameter to a transaction iview (I saw a resolved suggestion)
    Passing a parameter to a transaction iview
    2) Passing a parameter from the portal to R3 (helpful info for you)
    Passing a parameter from the portal to R3
    3) Create SAP Transaction iView using SAPGUI for Windows (Great Blog and info about TA Iview)
    Create SAP Transaction iView using SAPGUI for Windows
    Please check the following link for Transaction Iviews
    http://help.sap.com/saphelp_nw2004s/helpdata/en/02/f9e1ac7da0ee4587d79e8de7584966/frameset.htm
    Just some info: Portal is basically what the end user can see. What he can do, is still maintain in the backend system. If there are parameters setup already for the user in the backend system (in SU01), then those parameters should still valid for the transaction that the parameters are linked to.
    Hope that helps and award points for helpful suggestions.
    Ray

  • How to pass parameter into extract function (for XMLTYPE)

    I have a table PROBLEMXML with XMLTYPE field xml_column. In this column there are several deffinitions for the problem. There is no max amount of deffinitions and it can be no definition at all. I need to return all definitions for every problem as a string wirh definitions separated by ";".
    Query
    SELECT extract(prob.Def,'/Definitions/Definition[1]/@var') || ';'|| extract(prob.Def,'/Definitions/Definition[2]/@var')
    FROM PROBLEMXML j ,
    XMLTABLE (
    '/problem'
    PASSING j.xml_column
    COLUMNS probid VARCHAR (31) PATH '/problem/@id',
    Def XMLTYPE PATH '/problem/Definitions') prob
    where PROBLEM_ID =1;
    returns exactly what I want a;m.
    But
    declare
    my_var varchar2(2000) :=null;
    n1 number;
    n2 number;
    begin
    n1:=1;
    n2:=2;
    SELECT extract(prob.Def,'/Definitions/Definition[n1]/@var') || '|'|| extract(prob.Def,'/Definitions/Definition[n2]/@var') into my_var
    FROM ETL_PROBLEMXML_STG_T j ,
    XMLTABLE (
    '/problem'
    PASSING j.xml_column
    COLUMNS probid VARCHAR (31) PATH '/problem/@id',
    Def XMLTYPE PATH '/problem/Definitions') prob
    where PROBLEM_ID =1;
    dbms_output.put_line(my_var);
    end;
    returns NULL.
    Is there is a way to pass parameter into extract function?

    I need to return all definitions for every problem as a string wirh definitions separated by ";".In XQuery, there's the handy function "string-join" for that.
    For example :
    SQL> WITH etl_problemxml_stg_t AS (
      2   SELECT 1 problem_id,
      3  xmltype('<problem id="1">
      4   <Definitions>
      5    <Definition var="var1"></Definition>
      6    <Definition var="var2"></Definition>
      7    <Definition var="var3"></Definition>
      8   </Definitions>
      9  </problem>') xml_column
    10   FROM dual
    11  )
    12  SELECT j.problem_id,
    13         prob.probid,
    14         prob.def
    15  FROM etl_problemxml_stg_t j,
    16       XMLTable(
    17        'for $i in /problem
    18         return element r
    19         {
    20          $i/@id,
    21          element d { string-join($i/Definitions/Definition/@var, ";") }
    22         }'
    23        passing j.xml_column
    24        columns
    25         probid varchar2(30)  path '@id',
    26         def    varchar2(100) path 'd'
    27       ) prob
    28  ;
    PROBLEM_ID PROBID               DEF
             1 1                    var1;var2;var3

  • Passing parameter into SQL statement in Crystal Reports

    Hi all,
    I would like to call Crystal Reports in JSP. I can handle it well now. But I hope to let user input their selection criteria before printing out the report. I know how to get the parameter value in JSP, but I really dunno how to pass these parameter values into the SQL statement in Crystal Report. Actually, is it possible to do so?
    If anyone has idea, please tell me. Thx Thx!
    Regards,
    Betty

    Dear Sir,
    I want to use Crystal Report as a web base using JSP. But, I am getting how to call .rpt file in .jsp file & passing of parameter.
    If you have any idea, please reply as early as possible
    Thanking U.
    My userid = [email protected]
    Regds
    Pankaj..

  • How to pass parameter into cursor for loop ?

    Hi Experts,
    I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below How to achieve this?
    for j in 1 .. l_bom_components_tbl.COUNT LOOP
    Thanks

    Maybe i failed to describe in detail,so here i go:
    I have two for loops:
    for i in 1 .. l_bom_header_tbl.COUNT LOOP --1st For Loop
    V_bom_header_tbl.organization_code :='DSC';
    V_bom_header_tbl.assembly_item_name:= l_bom_header_tbl(i).assembly_item_name ;
    k:=1;
    I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below: How to achieve this?
    for j in 1 .. l_bom_components_tbl.COUNT LOOP *2nd For Loop*
    v_bom_components_tbl(k).Assembly_Item_name := l_bom_header_tbl(i).assembly_item_name ;
    k := k + 1;
    end LOOP;
    end loop;
    end;
    I want to pass a paramter into second for loop in such a way that it accepts from the first for loop
    for j in 1 .. l_bom_components_tbl.COUNT LOOP -2nd loop
    Edited by: ILovePlSql on Mar 22, 2010 12:25 PM

  • How to pass parameter in sql developer for debubing record type

    DECLARE
      IB_BP_BANK_ACCOUNT_BUF PL/SQL RECORD;  ---record type
      IP_BP_ID NUMBER;
      IOP_ACC_SEQ_NO NUMBER;
      OP_ERROR VARCHAR2(200);
    BEGIN
      IB_BP_BANK_ACCOUNT_BUF := NULL;
      IP_BP_ID := NULL;
      IOP_ACC_SEQ_NO := NULL;
      ORAGTW11.MAINTAIN_BP_BANK(
        IB_BP_BANK_ACCOUNT_BUF => IB_BP_BANK_ACCOUNT_BUF,
        IP_BP_ID => IP_BP_ID,
        IOP_ACC_SEQ_NO => IOP_ACC_SEQ_NO,
        OP_ERROR => OP_ERROR
      /* Legacy output:
    DBMS_OUTPUT.PUT_LINE('IOP_ACC_SEQ_NO = ' || IOP_ACC_SEQ_NO);
      :IOP_ACC_SEQ_NO := IOP_ACC_SEQ_NO;
      /* Legacy output:
    DBMS_OUTPUT.PUT_LINE('OP_ERROR = ' || OP_ERROR);
      :OP_ERROR := OP_ERROR;
    END;

    Something like this:
    Assuming you have a procedure like this:
    CREATE OR REPLACE PROCEDURE abc (p_emp emp%ROWTYPE)
    IS
    BEGIN
       DBMS_OUTPUT.put_line (p_emp.empno);
    END;
    Then you have to call it from a PL/SQL Block in this way i.e.:
    DECLARE
      v_emp emp%ROWTYPE;
    BEGIN
      SELECT *
        INTO v_emp
        FROM emp
       WHERE ROWNUM<=1;
       abc(v_emp);
    END;
    Regards.
    Al

  • How to pass parameter into remote system

    i'm doing a small testing on remote connection where i need to remotely login to another NT machine by using JAVA code. therefore i need to send over the ctrl-Alt-Del command by using ASCII code as well as the username and password to login to the remote NT machine. My problem is after my JAVA code start up the VNC connection, the ASCII code and parameter passing was executed before the VNC window popup therefore the parameters are not received by the remote end.

    Hi oling,
    i am really not sure how u can invoke or rather pass parameters to a Remote System thru Java, where no Java server is running.
    which Java Api do u use to connect to remote System. How will the remote System understand the serialised bytes transferred thru ur program.
    The Bottomline is i am confused how will the connection haapen after all!!!!!!!!!!!!!!!!!!!!!
    can u please explain this or rather pass me the Code...
    Thanks in advance,
    Manja

  • Passing Parameter in SQL

    How to Passing parameter in SQL.For Example,Table name=&From_Clause.It will asking table name at runtime.How to assign table name based on user.

    Hi,
    796776 wrote:
    It will returm error.what problem in this
    Select * From Emp a,
    (SELECT CASE
    WHEN USER = :UserType
    THEN 'scott.Dept'
    ELSE 'scott.order'
    END AS b
    FROM dual)
    Where a.DeptNo= b.DeptNo &WhereClauseIt's hard to guess, from an example like this with so many errors, exactly what you're trying to do.
    Please post a description of the problem, including CREATE TABLE and INSERT statments for any tables you need (unless you can state the problem using commonly available tables, such as those in the data dictionary or the scott schema), a few values of a parameter (or examples of different user names, if USER acts like a parameter) and the results you want from the same data for each value.
    For example
    "In addition to the scott.dept table, I have a table called my_dept: CREATE TABLE my_dept ...
    which has this data: INSERT INTO my_dept ...
    I need a script such that, when user scott runs it, the results are ...
    but when any other user runs it, the results are ..
    As you can see, the difference is ..."
    Table names must be explicitly given when a SQL statement is compiled. That's why I usggested a preliminary query; so by the time you compiled the main query, the table name would be known and could be passed in a substitution variable.
    If you really want to do it in one query, you can do a UNION of two queries, one of which returns nothing because of the parameter. It's not very efficient.

  • How to pass parameter to pl/sql block

    Hi,
    I am getting following error when trying to create staging table from shell script by passing parameter.
    SQL*Loader-941: Error during describe of table T1_1DAY_STG
    ORA-04043: object T1_1DAY_STG does not existThis is PL/SQL block being called inside shell script
    begin
    execute immediate 'create table t1_&1._stg as select * from t1_rpt_tmt';
    endShell Script Call
    load_data_to_oracle()
    for i in 1DAY 7DAY 15DAY
    do
    ${ORACLE_HOME}/bin/sqlplus ${ORACLE_USER}/${ORACLE_PASSWD}@${ORACLE_SID} << EOF > ${TMP_LOG_FILE} 2>&1
    set serveroutput on
    @${CREATE_STAGE_SQL} "$i"
    COMMIT;
    QUIT;
    EOF
    ########Main#######
    load_data_to_oraclethanks
    sandy

    i dont understand why you want run it from shell script. you can write procedure like this :
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE mytestProc(p_in VARCHAR2) AS
      2  begin
      3    FOR i IN (select REGEXP_SUBSTR(p_in,'[^,]+',1,ROWNUM) tblName
      4                from dual
      5                CONNECT BY INSTR(p_in, ',', 1, level - 1) > 0)
      6    LOOP
      7      execute immediate 'create table t1_'||i.tblname||'_stg as select * from myt2';
      8    END LOOP;
      9  end;
    10  /
    Procedure createdand run it
    SQL> exec mytestProc('1day,7day,15day');
    PL/SQL procedure successfully completed
    SQL> select * from t1_15day_stg
      2  union all
      3  select * from t1_1day_stg
      4  union all
      5  select * from t1_7day_stg;
    T                  N
    SQL>
    SQL> drop table t1_15day_stg;
    Table dropped
    SQL> drop table t1_1day_stg;
    Table dropped
    SQL> drop table t1_7day_stg;
    Table dropped
    SQL> purge table t1_15day_stg;
    Done
    SQL> purge table t1_1day_stg;
    Done
    SQL> purge table t1_7day_stg;
    Done
    SQL>

  • How to pass parameter to the Query String of the Named Queries'SQL

    Firstly to say sorry,I'm a beginner and my English is very little.
    Now I want to know
    How to pass parameter to the Query String of the Named Queries'SQL in the Map editor.
    Thanks.

    benzi,
    Not sure if this is on target for your question, but see #5 in the link below for some web screencasts that show how to pass an input text form field value to the bind variable of a view object. If you're looking for something different, maybe provide some more details such as what you are trying to accomplish and what technology stack you are using - for example, ADF BC, JSF, etc.
    http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html
    Also see section 5.9 and chapter 18 in the developer's guide.
    thanks

  • Pass parameter to another block

    I try to pass parameter to another block. but i have error message.
    error:PL/SQL: ORA-00904: "C1DATA_REF"."c": invalid identifier.
    Would you help me?
    ___________________________+++my code+++
    CREATE OR REPLACE PROCEDURE GETID
    (a IN TEST.COUNTRY%TYPE,
    b IN TEST.STATE%TYPE) AS
    V_ID TEST2.c%TYPE;
    CURSOR C1_DATA IS
    SELECT a,b,c FROM TESTSURVEYUNITS WHERE COUNTRY=a
    AND STATE=b ;
    BEGIN
    BEGIN
    FOR C1DATA_REF IN C1_DATA LOOP
    DBMS_OUTPUT.PUT_LINE ('SVU_ID IS:' || C1DATA_REF.c);
    END LOOP;
    END;
    BEGIN
    SELECT e,f,g,c FROM TEST2 WHERE SVU_ID=C1DATA_REF.c;
    DBMS_OUTPUT.PUT_LINE('PART 2'||C1DATA_REF.c||C1DATA_REF.e);
    END;
    END;

    Here it is reformatted. The SELECT statement in the second block won't work because there is no INTO clause and also because the cursor for loop in the previous block is out of scope. The loop has fetched all of its rows and has completed. What are you trying to do with the second select statement?
    CREATE OR REPLACE
    PROCEDURE GETID (a IN TEST.COUNTRY%TYPE
                    ,b IN TEST.STATE%TYPE) AS
    V_ID TEST2.c%TYPE;
    CURSOR C1_DATA IS
    SELECT a,b,c
    FROM   TESTSURVEYUNITS
    WHERE  COUNTRY=a
    AND    STATE=b ;
    BEGIN
       BEGIN
          FOR C1DATA_REF IN C1_DATA LOOP
             DBMS_OUTPUT.PUT_LINE ('SVU_ID IS:' || C1DATA_REF.c);
          END LOOP;
       END;
       BEGIN
          SELECT e,f,g,c
          FROM   TEST2
          WHERE  SVU_ID=C1DATA_REF.c;
          DBMS_OUTPUT.PUT_LINE('PART 2'||C1DATA_REF.c||C1DATA_REF.e);
       END;
    END;

  • How to Pass parameter to Custom Scheduler dynamically

    hi ,
    I am new to OIM.
    Need your help in passing parameters dynamically to Custom Scheduler.
    I have created Custom Scheduler by extending Task Support.
    I have registered the plugin through API , using PlatformService.registerPlugin() method.
    As I need to send the parameter(s) to this CustomScheduler, I have defined them in Metadata (CustomScheduleTask.xml) file as below and got it imported into DB
    through weblogicImportMetadata.sh script by providing the path of the file.
    <scheduledTasks xmlns="http://xmlns.oracle.com/oim/scheduler">
    <task>
    <name>CustomScheduleTask</name>
    <class>org.schedule.custom.task.CustomScheduleTask</class>
    <description>Fetch details of the given user_id</description>
    <retry>5</retry>
    <parameters>
    <string-param required="true" helpText="Login Name">Login Name</string-param>
    </parameters>
    </task>
    </scheduledTasks>
    Iam able to import this plugin as well as register the plugin successfully. Now I have defined a job to which this Custom SchedulerTask is mapped.
    Now in order to run this job(schedule task) I need to provide Login name( or id) which needs to be send as a parameter for the scheduler to get executed.
    But while defining the job with this Schedule Task on OIM console, I was not able to define or pass parameter to this job. hence parameter is null in
    CustomSchedule 's execute method .
    Kindly help me how to pass parameter dynamically while running the scheduler from OIM console so that the execute method would be able to receive it.
    Thank you in Advance.
    Regards,
    Kumar

    Hi,
    When you have created the schedule job for your custom schedule task, you should see your Login Name textfield in the schedule task. If not, then there verify your schedule task xml.
    In your schedule class code, add:
    public void execute(HashMap arg0) {
              final String METHOD_NAME = "execute :: ";
              logger.debug(CLASS_NAME + METHOD_NAME + "Entering Method - execute");
              try {
                   String LoginName = arg0.get("Login Name");
    Regards,
    Sunny

  • How to pass parameter /1BCDWB/DOCPARAMS from webdynpro?

    Hi Experts,
    We create a wdp view and indert an adobe form into it. And this form has an interface based on XML schema.
    Now we want to translate this form into multi-language, and in wdp side, we will display diffenent language version of form for different regions.
    I found that there is a paramater /1BCDWB/DOCPARAMS-LANGU, and it seems can control the language version in processing.
    But I donot know how to pass parameter /1BCDWB/DOCPARAMS from wdp to adobe form.
    Its my 1st to use adobe form and wdp, i really have no way out. Any advice will be Appreciated.
    Thank you.
    Richard

    @sahai: Hey no , I am using very very simple example without any query or complex statement. I just have 2 radio buttons in VIEW1. On clicking the radio button, the naviagtion to view2 is done and the value of selected radio button is passed as a parameter in the plug.
    In the view2 , i just have a caption in my layout where i am displaying the parameter value by setting the attribute.THe warning i get is in view2. Here is the code. Apart from this there is no coding in view2.
    METHOD HANDLEPLUG_IN_V2 .
        DATA:
          NODE_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_NODE,
          ELEM_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_ELEMENT,
          STRU_CAPT_MSG                       TYPE IF_VIEW2=>ELEMENT_CAPT_MSG ,
          ITEM_MSG                            LIKE STRU_CAPT_MSG-MSG.
    *   navigate from <CONTEXT> to <CAPT_MSG> via lead selection
        NODE_CAPT_MSG = WD_CONTEXT->GET_CHILD_NODE( NAME = `CAPT_MSG` ).
    *   get single attribute
        NODE_CAPT_MSG->SET_ATTRIBUTE(
          EXPORTING
            NAME =  `MSG`
            VALUE = PAR_1 ).
    ENDMETHOD.

  • Putting Parameter into SQL Expression or convert to formula Basic or Crystal

    Post Author: yoschua
    CA Forum: Formula
    Hello,In my old report I got something like thisSELECT MIN(cast("ParDyn"."ParVal" as integer))FROM "result".ParDyn WHERE "ParDyn"."ParNo" = (SELECT Max("Piece"."ParDynNo")                          FROM "result"."Piece"                           WHERE "Piece"."RequestNo" = XPARAM1 And "Piece"."PieceNo" = XPARAM2)      And "ParDyn"."ParIdent" = 'Trace.Assignment'  This report are viewed from VB component - at old VB they read SQL from report, input XPARAM1 and XPARAM2 and put it into report again and the show report.Because now I want to make my aplication I convert this report to use it not only at this old aplication, but with CR Viewer too.I see I can not insert Parameter into SQL Statement, so I need to use Basic or Crystal Formula.I try to make something like this : minimum({ParDyn.ParVal})and {ParDyn.ParNo} = 0of cource zero should be exchange with next statement, but this not working.What I would like to get is only one record, I do not want get whale table into CR engine and then evaluate becouse this report must work on slow connection, so I need take from database only records witch I need. Can someone help me, or show how to insert into formula value as parameter taked from another table dynamicly ?? Best Regards Bartłomiej Jóźwiak 

    Ok,
    The only way I found to get the maximum status date of an employee with the date entered in parameter was to litteraly put each employee ID, and Status Date in the Detail section.
    Then in the select expert create the parameter date.
    Then I created a running total field that counts the employees and resets on change of employee sorted by status date.
    Then I created a formula that gets all the first occurences of this running total field and if the running total field equals 1, a new formula field shows 1 and if not (2 and more), it shows 0.
    But I can't find the way to give me the total that I need for each group sections.
    It's ok if the SQL expression field does not work, but I need to find a way to get the max date.
    Thank's for your help for the SQL Expression field.
    Steph

Maybe you are looking for

  • Premier Elements 7 - confusion over mixing video formats

    Hi I have been using a DV camcorder (SD quality) for some time, originally recording in 4:3 format, and more recently in 16:9 format (as we bought a wide screen telly). I have just treated myself to a new AVCHD Panasonic video recorder recording High

  • 3 Months 800 minutes UIndia subscription not activ...

    Ihaveprevious Subscription ended on April1st and due to some payment issues it was not renewed automatically. Now I subcribed for a new subscription today and it is not active yet. Its still showing my renewal date as 25th April but my subscriptin en

  • Entitlement Attributes data population in OIA

    Hi, We would like to know how to import Entitlement attributes present in the OIM and target resources into OIA. We assume that when we import the accounts present in the OIM the corresponding entitlement values are populated into the Attributes tabl

  • Help with updating software

    Hi fellas! Please hlp me with this problem.. everytime I want to update any app a message pop up saying that "I had no permission to write in the Library/Caches carpet"..Why!?!?!?!?!

  • Problem i starting Apache web server

    # service httpd start Got message like :-------------------------- Redirecting to /bin/systemctl start  httpd.service Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details. on checkig log file ::  -------