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>

Similar Messages

  • 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';
    end Shell 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

    It is probably a permission issue. Are you the owner of the table you are trying to select from in your PL/SQL block? if not, do you have select permission granted specifically?
    Here is my test:
    test > create table T_ABC (a number, b number);
    Table created.
    test > @t_abc Hello
    test > begin
    2
    3 execute immediate 'create table t1_&1._stg as select * from t_abc';
    4
    5 end;
    6 /
    old 3: execute immediate 'create table t1_&1._stg as select * from t_abc';
    new 3: execute immediate 'create table t1_Hello_stg as select * from t_abc';
    PL/SQL procedure successfully completed.
    test > desc t1_Hello_stg
    Name
    A
    B
    test > desc T_ABC
    Name
    A
    B
    test >

  • 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

  • Can we pass objects to pl/sql block

    hi,
    can we pass objects to pl/sql block.i think we can.how to pass it.help me in getting the examples of "passing objects to pl/sql block"

    What exactly do you mean ? You can pass objects like any other parameters
    into and out from procedures/functions:
    SQL> create or replace procedure get_object(myobj in out nocopy my_obj)
      2  is
      3  begin
      4   dbms_output.put_line('ID : ' || myobj.empno);
      5   dbms_output.put_line('Salary : ' || myobj.sal);
      6   dbms_output.put_line('Department : ' || myobj.deptno);
      7   myobj.sal := myobj.sal*2;
      8  end;
      9  /
    Procedure created.
    SQL> declare
      2   mo my_obj := my_obj(1,1000,10);
      3  begin
      4   get_object(mo);
      5   dbms_output.put_line('New salary : ' || mo.sal);
      6  end;
      7  /
    ID : 1
    Salary : 1000
    Department : 10
    New salary : 2000
    PL/SQL procedure successfully completed.Rgds.

  • 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 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 as http POST in pageContext.setForwardURL

    Hi,
    I need to call a third party application page in my custom OAF page. I need to pass parameter to this third party page using POST method. I am using following command to call that -
    HashMap hm = new HashMap();
    hm.put("FirstName",firstName );
    hm.put("LastName",lastName);
    hm.put("AppSignature", signature);
    pageContext.setForwardURL(hopURL,
    null, // not necessary with KEEP_MENU_CONTEXT
    OAWebBeanConstants.KEEP_MENU_CONTEXT, // no change to menu context
    null, // No need to specify since we're keeping menu context
    hm, // request parameters
    false, // retain the root application module
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // display breadcrumbs
    OAException.ERROR);
    I am passing parameter to the page using hash map table. That application is expecting the parameters in POST format and I believe using hash map table the parameters will be passed as GET format.
    We figured that out because one of the parameter we have to send is AppSignature which is 160 characters long. When third party applicatoin received that parameter they got only 151 characters, looks like they are truncated by GET method.
    Any idea how to pass parameter using POST format so that this issue could be fixed.
    Regards
    Hitesh

    Sumit,
    Thanks for your reply. I have resolved this issue by forwarding all parameters in session using pageContext.putSessionValueDirect and redirect to a jsp using pageContext.redirectImmediately.
    in jsp I read the params from session and set in the form , and then redirected to my third party application.
    Regards
    Hitesh

  • 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.

  • How to pass parameter to intro.jsp page ?

    Hi all,
    Anybody please tell me how to pass parameter to intro.jsp page.
    Is there any param name defined in <forward > syntax ?
    I have made following configuration in struts-config.xml file.
    I want to pass parameter to intro.jsp page
    <global-forwards>
              <forward name="invalidsession" path="/intro.jsp" redirect="true" />
    </global-forwards>
    please reply soon.
    Thanking you.

    Hi all,
    I have a similar kind of question..
    Iam trying to pass a string variable from JSP to servlet thro URL..
    Im using tomcat5
    COde:
    String fname=request.getParamter("filename");
    <jsp:forward page="/servlet/coreservlets.filedownload?name=" +fname />
    It is generating a unterminated tag error..Please help..

  • 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 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

  • How to pass parameter value as "where [fieldname] = [fieldvalue]" in sql query under query type in SSRS report?

    I am having trouble with passing dynamic string to sql query for executing SSRS reports.
    I am using oracle database and I want to pass where clause parameter as "where LAND_NR = 6" to my select query.
    For example: I want to execute Select * from employee :p_where.
    where p_where parameter holds value "where LAND_NR = 6"
    So it will treat as "Select * from employee where LAND_NR = 6" statement which will give me the list of records to display in my reports.
    But it's not taking correct sql command throwing an error as "SQLcommand not properly ended."
    How can I achieve this?

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • 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 from one form to another

    Hi,
    I have created a form based on a procedure . Now i want to pass a filed value from this form to another form . How can i do this.
    How can i pass a vlue from one form to another form in oracle portal.
    Thanks

    At last - I've managed to get this to work! Is this documented anywhere at all - I just guessed it based on other people's code!
    OK, to prove the example here is what I did:
    I have a form referencing the DEPT table.
    I created a item called 'Search' and of type button.
    I created a 'custom' PL/SQL block and added the following code:
    declare
    v_deptno NUMBER;
    begin
    v_deptno := p_session.get_value_as_NUMBER(
    p_block_name=> 'DEFAULT',
    p_attribute_name => 'A_DEPTNO');
    PORTAL30.wwa_app_module.set_target('http://server/pls/portal30/app_schema_name.EXAMPLE_SQL_REPORT.show?p_arg_names=_show_header&p_arg_values=YES&p_arg_names=_max_rows&p_arg_values= 25&p_arg_names=_portal_max_rows&p_arg_values=25&p_arg_names=DEPTNO&p_arg_values='&#0124; &#0124;LTRIM(TO_CHAR(v_deptno)),'CALL');
    end;
    Note: you need to reference the column with an 'A_' prefixing the columm name.
    I left the name 'DEFAULT' as it is.
    OK so I set this to a variable and now want to call a Report called EXAMPLE_SQL_REPORT which was created with the following code:
    select * from scott.emp where deptno = :deptno;
    The bind variable being the custom parameter for the report.
    I called the new report with the PORTAL30.wwa_app_module.set_target procedure and put in the full URL path (in this example) of the server and report.
    I hope this helps!
    John
    null

  • How to pass XDIM_MEMBERSET scope to SQL?

    Hi all.
    I need to run a script, based on the entries that were just entered by users, from a BPC Input Schedule.
    Basically, I need to call an SQL script from default logic.  (SQL 2008 R2), BPC 7.5 SP7.
    However, I need to also be able to pass the scope outlined by XDIM_MEMBERSET in the default logic.
    I have tried using the information from both
    How to Pass Data Manager Selections(Scope) to Stored Procedure - SAP BPC MS
    and
    SAP BPC MS: Passing Data Manager Selection (Scope) to SSIS Package
    but both of those only appear to work from user prompts (selection box), whereas I need something that works whenever a user hits SEND on an input schedule.
    Can anyone give me any pointers?
    The closest I can get so far is that there seems to be both a %SELECTION% and a %TOSELECTION% variable that appear to contain what I need, but I now need some way to send that scope to either a variable or a temporary table in SQL.
    Thanks
    Craig

    Hi Craig,
    don't use the document of Vadim if you are on MS version, script has different in NW version also in the behaviour so you can have some problem.
    Don't use *XDIM_MEMBERSET in default logic, this routine will be execute on every send data and you will force some scope also when the data has another scope.
    You can use *XDIM_FILTER and after *RUN_STORED_PROCEDURE=<your stor proc>('%CATEGORY_SET%', etc.) to run this stored procedure only in  if the dimension(s) is specified in the filter.
    e.g.
    *XDIM_FILTER ENTITY=[ENTITY].[h1]properties("IDCODE")="XXXX"
    *XDIM_FILTER CATEGORY=[CATEGORY].[H1].properties("IDCODE")="ACTUAL"
    *RUN_STORED_PROCEDURE=mySTPR([APPSET], '%TIME_SET%', [%SCOPETABLE%], [%LOGTABLE%])  (this is just an example don't know your parameter of the s.p.)
    Regards
         Roberto

Maybe you are looking for

  • Tagging text boxes so that they are read in a particular order

    HI I created a one page MSWord 2007 document that contains a screen image in the middle with numbered text boxes around it explaining the various features found in the image. The numbered boxes go clockwise around the image. How can I set this up so

  • Database copy in php/mysql with Dreamweaver 7

    I'm designing a new website/customer that I would like to duplicate an existing database and queries. Is there any easy way to do that? The working web is housed on a server running PHP and MySql. I am using Dreamweaver mx 2004 v7.0.1. If there is an

  • Error 10 Could not locate resource

    I tried to auto download the JRE using the JREInstaller and the DownloadServlet (sample in jdk 1.5) from a local server. I got the error 10 Could not locate resource. <j2se version="1.5.0*"  href="http://127.0.0.1:8080/Web-Test2/install/javaws-1_0_1-

  • Mail and Automator

    Hi all, BACKGROUND I compose some information e-mails that I distribute to a bunch of people that are all in a group/distributionlist in my Addressbook. I used to just create the e-mail, put my own e-mail address in the TO field and then add the whol

  • Graphic Frames Corrupted When Exporting to PDF

    I'm trying to figure out what is happening to random graphic frames in my InDesign document.  I'm working in a 68 page document.  I exported to PDF using the lo-res no bleed setting.  The PDF exported fine but when I went back to my InDesign doc, som