Passing variables from .bat to .sql in instance creation scripts

Hi all,
In the classical instance creation scripts numerous parameters are repeated even if they are similar. For example, the directory into which saving the different tablespaces is often the same. Also i'm looking for passing them as parameters from the .bat launching the instance creation. My first tries give the following:
-> In the .bat launching the creation:
set MY_DB_USER=sys
set MY_DB_PWD=change_on_install
set MY_DB_NAME=DragNFly
set ORACLE_SID=DragNFly
set MY_DB_CREATION_SOURCE=F:\Oracle\oradata\Instance_creation_scripts
set MY_DB_CREATION_DESTINATION=E:\Oracle_DragNFly
set MY_ORACLE_BIN=F:\oracle\bin
set MY_ORACLE_HOME=F:\oracle
mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\bdump
mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\cdump
mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SIDD%\create
mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\udump
mkdir %MY_DB_CREATION_DESTINATION%\%ORACLE_SID%
%MY_ORACLE_BIN%\oradim.exe -new -sid %ORACLE_SID% -startmode m
%MY_ORACLE_BIN%\oradim.exe -edit -sid %ORACLE_SID% -startmode a
%MY_ORACLE_BIN%\orapwd.exe file=%MY_ORACLE_HOME%\Database\PWD%MY_DB_NAME%.ora password=%MY_DB_PWD%
%MY_ORACLE_BIN%\sqlplus /nolog connect %MY_DB_USER%/%MY_DB_PWD% @%ORACLE_SID% as sysdba
%MY_ORACLE_BIN%\sqlplus /nolog @%MY_DB_CREATION_SOURCE%\StartCreation.sql
-> Then in the first sql file, fixing all the variables and calling the other ones:
DEFINE MY_DB_USER=SYS
DEFINE MY_DB_PWD=change_on_install
DEFINE MY_DB_NAME=DragNFly
DEFINE MY_DB_SID=DragNFly
DEFINE MY_DB_CREATION_DESTINATION=E:\Oracle_DragNFly
DEFINE MY_DB_CREATION_SOURCE=F:\Oracle\oradata\Instance_creation_scripts
DEFINE MY_ORACLE_BIN=F:\oracle\bin
DEFINE MY_ORACLE_HOME=F:\oracle
connect &&MY_DB_USER/&&MY_DB_PWD as SYSDBA
-- # The following files have to be stored in the #
-- # same repertory as the present file #
@@CreateDBdb &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
@@CreateDBtbs &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
@@CreateDBcat &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
@@postDBcreate &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
@@CreateDBuser &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
exit;
-> Finally one example of use in CreateDB.sql is:
connect &&1/&&2 as SYSDBA
set echo on
spool &&5\&&3\Create&&3.db.log
startup nomount pfile="&&6\init_DB.ora";
CREATE DATABASE &&3
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '&&5\&&3\system_&&3.01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE &&3._TMP TEMPFILE '&&5\&&3\temp_&&3.01.dbf' SIZE 1500M REUSE
UNDO TABLESPACE "&&3._UNDO" DATAFILE '&&5\&&3\undo_&&3.01.dbf' SIZE 500M REUSE
CHARACTER SET WE8ISO8859P1
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('&&5\&&3\redo_&&3.01.log', '&&5\&&3\redo_&&3.01bis.log') SIZE 102400K,
GROUP 2 ('&&5\&&3\redo_&&3.02.log', '&&5\&&3\redo_&&3.02bis.log') SIZE 102400K,
GROUP 3 ('&&5\&&3\redo_&&3.03.log', '&&5\&&3\redo_&&3.03bis.log') SIZE 102400K;
spool off;
As you can see a first problem is that i have to set the variables the first time in the .bat and a second time in the first .sql. I don't know how to use an unique file for setting all the variables i need.
Second difficulty is: fixing names and directories is a first step but i would like to fix all the different size values in this same file. The goal is to have only one file with dozen of values to change before creating new instances instead of checking all the different parameters inside of the different files.
Third problem: variables are not transmitted to the init.ora. I think that it's possible to generate it using template and the defined variables, but i don't try for the moment.
What is your mind on this?
Probably there are better examples that i don't found?
Regards,
Tif

the problem is nothing your showed.   did you see a security warning that you ignored?
to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

Similar Messages

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Is it possible to pass variables from Tidal to the Peoplesoft run controls?

    Does anyoen know
    •1) Is it possible to pass variables from Tidal to the Peoplesoft run control page such as current date?
    An example would be updating run control parameters for a PSQUERY.
    •a) From date
    •b) To date
    •c) Business units
    Thanks,
    Jay

    Edit the job - go to Run Controls Parameters tab - select the param you want in the Override column then click on the Variables button on the bottom and select the variable you want

  • Passing variable from one JSP to another

    Hi....
    I am working on customizing Oracle Application(istore).
    I need to pass variable from 1 JSP to another.
    JSP 1 contains the following line of code:
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    How can I pass this to another JSP Page. The other JSP should take the 'soldtoCustPartyName' and find out the primary address country.
    So please help me in getting variable passed from 1st JSP to next.
    By default, 1st JSP is not fwded to 2nd JSP.
    This is very very urgent...Please help.....

    When you push the submit button on jsp1 - it goes to jsp2?
    ie
    // in jsp1.jsp
    <form action="jsp2.jsp">
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    <input type="submit">
    </form>
    //Then in jsp2.jsp all you need is
    request.getParameter("soldtoCustPartyName");This will pick up the value that is coming from the hidden field on jsp1

  • Passing variables from one swf to another

    I am facing problem to pass variable from one swf to another.
    I am using loadMovie to load another swf. how can I pass a variable
    value to another swf. Can anyone help me plz? It is somewhat
    urgent.
    thanx in advance.

    first of all:
    this is the Flash Media Server and your problem is not
    related to FMS....
    second thing related to the "somewhat urgent" :
    we, users on this forum, are not there to do your job... so
    calm down otherwise no people will answer your question. This forum
    is a free support forum that community of Flash developer use to
    learn tricks and to solve problems.
    Possibles solutions:
    If the two swf are seperate you can use LocalConnection to
    establish a connection between different swf.
    If you load a second swf into the first one you can interact
    like a standard movieClip(only if there from the same domain or if
    you a policy file on the other server)
    You can use SetVariable(via Javascript) to modify a root
    variable on the other swf and check with an _root.onEnterFrame to
    see if the variable had changed in the second swf.
    * MovieClipLoader will do a better job, in your specify case,
    than the loadMovie. Use the onLoadInit event to see when the swf is
    really totaly loaded into the first one otherwise you will have
    timing issues.
    My final answer(lol) is the solution 2 with the
    notice(*)

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

  • Passing variables from Applescript to bash

    Hello,
    I'm trying to pass variables from Applescript to bash using the following code
    #!/bin/bash
    osascript <<EOF
    tell application "SystemUIServer"
    set username to text returned of (display dialog "Enter your name" with icon caution default answer ""  buttons{"Continue"})
    set macname to text returned of (display dialog "Enter name of your Mac" with icon caution default answer ""  buttons{"Continue"})
    do shell script "export USERNAME=" & quoted form of username & " && export MACNAME=" & quoted form of macname
    end tell
    EOF
    echo "USERNAME is $USERNAME, MACNAME is $MACNAME"
    but no luck
    Mac-mini:Downloads admin$./new.command
    USERNAME is , MACNAME is
    Any help would be greatly appreciated.

    I just realized you are returning 2 variables.  That can still be handled by echoing/printing the values, you just have to parse the output, or use other tricks.
    VALUES=( $(osascript -e '...') )
    This would make VALUES an array, with each array element containing one space separate return value from osascript
    USERNAME=${VALUES[0]}
    MACNAME=${VALUES[1]}
    If USERNAME or MACNAME could have spaces in them, you would need to use some kind of separator character.  For example if you use @ as the separator you could do something like:
    VALUES=$(osascript -e '...')
    USERNAME=${VALUES%@*}
    MACNAME=${VALUES#*@}
    which will %@* will delete everything starting with the @ til the end of the string, and #*@ will delete everything from the beginning of the upto and including the @.
    Another trick is to have the return values be properly formed shell variable assignments such as
    print "USERNAME='your user name' MACNAME='Your Mac Name' " -- I'm making this up as I do not really know Applescript, so you will have to figure out how to get Applescript to print something that looks like
    USERNAME='your user name' MACNAME='Your Mac Name'
    In your shell script you have code that looks like:
    VALUES=$(osascript -e '...')
    eval $VALUES
    The eval will execute whatever is stored in $VALUES, and if that happens to look exactly like shell variable assignments, you get the variables created in the current shell context, where can use them.

  • Passing variables from AS3 to PHP

    Hi there
    I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
    I've stuck with this for two days.. Here's what I have done. Please help!!!
    header.fla [Actionscript in the timeline]
    stop();
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.net.*;
    var url:String = "http://localhost/0000/try.php";
    var req:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    var variables:URLVariables = new URLVariables();
    send_btn.addEventListener(MouseEvent.CLICK, sendForm);
    function sendForm(evt:MouseEvent):void
        // add the variables to our URLVariables
        variables.asd = "value";
        // send data via post
        req.method = URLRequestMethod.POST;
        req.data = variables;
        loader.dataFormat = URLLoaderDataFormat.TEXT;
        // add listener
        loader.addEventListener(Event.COMPLETE, onLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        //send data
        loader.load(req);
    function onLoaded(evt:Event):void
        var result_data:String = String(loader.data);
        if (result_data)
            trace(result_data);
        else if (!result_data)
            trace("error");
    function ioErrorHandler(event:IOErrorEvent):void
        trace("ioErrorHandler: " + event);
    try.php
    <body>
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
      <param name="movie" value="header.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <?php
    if($_POST['asd'])
    echo "value of var1 is <b>".$_POST['asd']."</b>";
    else
    echo "bad luck";
    ?>
    </body>
    BIG THANKS!!

    the problem is nothing your showed.   did you see a security warning that you ignored?
    to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

  • Passing variables from Report to Form

    Hi, I need pass a couple of variables from the REPORT to two fields in the FORM for save in a table. Somebody knows how do I do this?. Any suggestions?
    Thanks a lot!
    I think that this situation is different that pass variables from FORM to REPORT.

    You need to use a Link component to your Form that you then attach to one of the data columns in the Report. When you edit the link in the report, you can specify the fields to pass.

  • Easily fixing parameters for instance creation script

    H all,
    In the classical instance creation scripts numerous parameters are repeated even if they are similar. For example, the directory into which saving the different tablespaces is often the same. Also i'm looking for passing them as parameters. My first tries give the following:
    -> In the .bat launching the creation:
    set MY_DB_USER=sys
    set MY_DB_PWD=change_on_install
    set MY_DB_NAME=DragNFly
    set ORACLE_SID=DragNFly
    set MY_DB_CREATION_SOURCE=F:\Oracle\oradata\Instance_creation_scripts
    set MY_DB_CREATION_DESTINATION=E:\Oracle_DragNFly
    set MY_ORACLE_BIN=F:\oracle\bin
    set MY_ORACLE_HOME=F:\oracle
    mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\bdump
    mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\cdump
    mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SIDD%\create
    mkdir %MY_ORACLE_HOME%\admin\%ORACLE_SID%\udump
    mkdir %MY_DB_CREATION_DESTINATION%\%ORACLE_SID%
    %MY_ORACLE_BIN%\oradim.exe -new -sid %ORACLE_SID% -startmode m
    %MY_ORACLE_BIN%\oradim.exe -edit -sid %ORACLE_SID% -startmode a
    %MY_ORACLE_BIN%\orapwd.exe file=%MY_ORACLE_HOME%\Database\PWD%MY_DB_NAME%.ora password=%MY_DB_PWD%
    %MY_ORACLE_BIN%\sqlplus /nolog connect %MY_DB_USER%/%MY_DB_PWD% @%ORACLE_SID% as sysdba
    %MY_ORACLE_BIN%\sqlplus /nolog @%MY_DB_CREATION_SOURCE%\StartCreation.sql
    -> Then in the first sql file, fixing all the variables and calling the other ones:
    DEFINE MY_DB_USER=SYS
    DEFINE MY_DB_PWD=change_on_install
    DEFINE MY_DB_NAME=DragNFly
    DEFINE MY_DB_SID=DragNFly
    DEFINE MY_DB_CREATION_DESTINATION=E:\Oracle_DragNFly
    DEFINE MY_DB_CREATION_SOURCE=F:\Oracle\oradata\Instance_creation_scripts
    DEFINE MY_ORACLE_BIN=F:\oracle\bin
    DEFINE MY_ORACLE_HOME=F:\oracle
    connect &&MY_DB_USER/&&MY_DB_PWD as SYSDBA
    -- # The following files have to be stored in the #
    -- # same repertory as the present file #
    @@CreateDBdb &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
    @@CreateDBtbs &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
    @@CreateDBcat &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
    @@postDBcreate &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
    @@CreateDBuser &&MY_DB_USER &&MY_DB_PWD &&MY_DB_NAME &&MY_DB_SID &&MY_DB_CREATION_DESTINATION &&MY_DB_CREATION_SOURCE &&MY_ORACLE_BIN &&MY_ORACLE_HOME
    exit;
    -> Finally one example of use in CreateDB.sql is:
    connect &&1/&&2 as SYSDBA
    set echo on
    spool &&5\&&3\Create&&3.db.log
    startup nomount pfile="&&6\init_DB.ora";
    CREATE DATABASE &&3
    MAXINSTANCES 1
    MAXLOGHISTORY 1
    MAXLOGFILES 5
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    DATAFILE '&&5\&&3\system_&&3.01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL
    DEFAULT TEMPORARY TABLESPACE &&3._TMP TEMPFILE '&&5\&&3\temp_&&3.01.dbf' SIZE 1500M REUSE
    UNDO TABLESPACE "&&3._UNDO" DATAFILE '&&5\&&3\undo_&&3.01.dbf' SIZE 500M REUSE
    CHARACTER SET WE8ISO8859P1
    NATIONAL CHARACTER SET AL16UTF16
    LOGFILE GROUP 1 ('&&5\&&3\redo_&&3.01.log', '&&5\&&3\redo_&&3.01bis.log') SIZE 102400K,
    GROUP 2 ('&&5\&&3\redo_&&3.02.log', '&&5\&&3\redo_&&3.02bis.log') SIZE 102400K,
    GROUP 3 ('&&5\&&3\redo_&&3.03.log', '&&5\&&3\redo_&&3.03bis.log') SIZE 102400K;
    spool off;
    As you can see a first problem is that i have to set the variables the first time in the .bat and a second time in the first .sql. I don't know how to use an unique file for setting all the variables i need.
    Second difficulty is: fixing names and directories is a first step but i would like to fix all the different size values in this same file. The goal is to have only one file with dozen of values to change before creating new instances instead of checking all the different parameters inside of the different files.
    What is your mind on this?
    Probably there are better examples that i don't found?
    Regards,
    Tif

    One error i didn't suspect -> don't using SID with lowercase and uppercase in the name.
    Thing i've forgotten to say: variables have to be set both in the .bat and the first .sql but they have to match too with values in the init.ora. That why i would like to simplify all these declarations with unifying them into a single file.
    If somebody can help me, please
    Tif

  • Passing variable from sql to shell script

    Usually we can pass arguments from shell script to the sql that us called inside the shell script. But I also want to do the reverse. I have the location of my backup path in a table. I want to run the rman script (shell), read this parameter from the table and use this to construct the "format" path in rman. Anyone has any ideas about this. Thanks.

    To achieve getting the modified value from the table everytime the job runs, I encapsulated this in another job.
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB(
    JOB_NAME           => 'TEST_LOGS_MAIN',
    JOB_TYPE             => 'PLSQL_BLOCK',
    JOB_ACTION          => 'declare
    v_aname varchar2(32);
    begin
    select aname into v_aname from attr where attrid = 3;
    DBMS_SCHEDULER.CREATE_JOB(
    JOB_NAME        => ''TEST_LOGS'',
    JOB_TYPE        => ''EXECUTABLE'',
    JOB_ACTION      => ''/opt/sql/testy.sh'',
    number_of_arguments => 1,
    COMMENTS        => ''TEST'');
    dbms_scheduler.set_job_argument_value(''TEST_LOGS'',1,v_aname);
    dbms_scheduler.enable(''TEST_LOGS'');
    end;',
    REPEAT_INTERVAL => 'FREQ=MINUTELY',
    ENABLED           => TRUE);
    END;
    /

  • How to declare a global variable from a PL/SQL package

    Hi All,
    Using a global variable is a bad practise for all language. However, in my case, I have a PL/SQL package defines all constants, and I want to use them directly via SQL statement, for instance,
    PACKAGE my_const
    IS
         DEFAULT_ZIP_CODE CONSTANT VARCHAR2(5) := '00000';
    END;And I cannot referrence this variable from my select statement as
    SELECT my_const.DEFAULT_ZIP_CODE from dual;I have to create a function via my package, as,
    FUNCTION get_default_zip_code RETURN VARCHAR2
    IS
    BEGIN
         RETURN DEFAULT_ZIP_CODE;
    END;and
    SELECT my_const.get_default_zip_code from dual;I don't want to create functions to referrence the default varaibles. Does anyone have any clues?
    thanks
    Edited by: user4184769 on Jul 19, 2010 8:36 AM

    riedelme wrote:
    thanks for the info. Your scope explanation makes sense even though it is not intuitive to me. I think the usage of package variables should be supported by SQL (they're just values to be copied) Maybe look at it from another language's perspective. You want to use a global PL package variable in Java/C#/Delphi/VB/etc. How would you do it?
    None of these languages can crack open the data segment of a PL code unit, inspect the variables in it, and extract a value from it. Instead, it needs to be done as follows:
    Using sqlplus as the client illustrates how all these languages will need to do it:
    SQL> var value varchar2(20);
    SQL> begin
      2>     :value := SomePackage.someVar;
      3> end;
      4> /So why should SQL behave differently? It is not the same as the PL language. It is not a subset of the PL language. Yeah, PL/SQL blurs the line between these 2 languages making it very simple for us to mix their source code. But PL/SQL is SQL integrated with PL - not PL integrated with SQL. PL has tight hooks into SQL, creating cursors for you, defining bind variables, binding variables and doing the whole Oracle Call Interface bit for you.
    But SQL has no need for PL code, just as it has no need for Java code, or Delphi code or VB code. Yes, it is possible for it to call Java stored procs. As it is possible for it to call PL procs. But these are via the formal call interface of those languages - not via tight integration hooks that blur the languages and make SQL and Java, or SQL and PL, look like a single integrated source code unit.
    Thus SQL has the pretty much the same constraints in calling the PL language as other languages do. What SQL can do is use the PL engine's call interface and tell it "+execute this function and return the result of the function+".

  • Passing Variables from one View to another

    First of all Hi this is my first post on the sap forums.
    Aplogies if I have come to the wrong place or if this question is very easy, but I am new to abap and web dynpro and have found myself struggling a little bit.  So I stumbled across this site and thought I would ask for help.
    My problem is this, I have 2 variables on my MAIN view, one called MONTH and the other called YEAR.  What I want to do is on a button click on the MAIN view pass the values of these variables to another view called SUMMARY_RPT and then use these variables in an SQL query I have on this view.
    Anybody out there that can help ?
    Many Thanks,
    George

    Hi George,
    Welcome to webdynpro abap community. To pass data from one view to another, you can should create two attributes (type string) in the attribute tab of of the component controller. Now these will act as global variable for you. Now you can access these attribute in your view in this way:
    wd_comp_controller->gv_val "gv_val is the name of the attribute
    Populate the value in it and use it anywhere you want.
    There is one more way to do the same.
    Create a node under context in component controller and create 2 attributes(type string) after that. Map this node to both the views. Now get the value of month , year and set these attribute with the same values with the help of code wizard in view 1. Now in the view2 simply read those attribute and you'll get the value of month and year which was entered in the first view. Read the attribute with the help of code wizard. Now you can use them accordingly.
    I would suggest you to use 1st method as it is better performance wise.
    I hope it helps.
    Regards
    Arjun

  • Passing Variables from One Class to Another

    Hello, I am new to Java Programming and I'm currently starting off by trying to build a simple application.
    I need help to pass variables created in one class to another.
    In my source package, I created 2 java classes.
    1. Main.java
    2. InputFileDeclared.java
    InputFileDeclared reads numerical data from an external text file and store them as string variables within the main method while Main converts a text string into a number.
    Hence, I would like to pass these strings variables from the InputFileDeclared class to the Main class so that they can be converted into numbers.
    I hope somebody out there may enlighten me on this.
    Thank you very much in advance!

    Values are passed from method to method, rather than from class to class. In a case such as you describe the code of a method in Main will probably call a method in InputFileDeclared which will return the String you want. The method in Main stores that in a local variable and processes it. It really doesn't matter here which class the method is in.
    You InputFileDeclared object probably contains "state" information in its fields such as the details of the file it's reading and how far it's got, but generally the calling method in Main won't need to know about this state, just the last data read.
    So the sequence in the method in Main will be:
    1) Create an new instance of InputFileDeclared, probably passing it the file path etc..
    2) Repeatedly call a method on that instance to return data values, until the method signals that it's reached the end of file, e.g. by returning a null String.
    3) Probably call a "close()" method on the instance, which you should have written to close the file.

  • Passing variables from PHP to AS3

    I am trying to get variables retrieved from a MySQL database
    by a PHP script into my ActionScript 3.0. script. To test I have
    created a simple instance of dynamic text called date_txt, and put
    the AS3 code below into the actions layer:
    All I want to do now is replace the hardcoded date values
    with variables passed from the PHP script (also shown below).
    Can anyone suggest a VERY simple way of passing the PHP
    variables $tgt_year, $tgt_month and $tgt_day into the AS3 code and
    let me know what modifications I need to make to the PHP to make
    the variables available to Flash?
    Thanks, Will

    Hi dzedward,
    I tried the code you posted at
    http://forums.flashgods.org/viewtopic.php?f=41&t=98
    with a little problem. Why is it that the value from event.data
    after complete loading has the value of the entire script of PHP
    script?
    At first, I have this error:
    The markup in the document following the root element must be
    well-formed.
    I replace the following codes: ########
    XML.ignoreWhitespace = true;
    var theResult:XML = new XML(event.target.data);
    var lastName = theResult.client.lname;
    With this one: ########
    trace(event.target.data);
    and has this output: #########
    <?Php
    echo "<?xml version=\"1.0\"?><clients>";
    echo "<client><lname>test
    sdfsaf</lname></client>"
    echo "</clients>";
    ?>
    instead of this output: #########
    <client><lname>test
    sdfsaf</lname></client>
    Please help me out.
    Thank you

Maybe you are looking for

  • How to loop with varying values depending on where you are in the loop

    Hi, I have need of loops / nested loops that pick different figures depending on where you are in the loop. The whole function needs to run through 'ml' times. 'ml' is a dynamic figure. Loop 1 = While the loop is within the first 12 iterations, 'exco

  • What is MiniSap? Where can I Download??

    Hello Im new in SAP community can some one tell me what is miniSAP ?? I know is a software but is it a small copy of the SAP software for trainning or what??? I need SAP software because I have to clear the SAP FICO exame. Have this miniSAP the SAP F

  • How to upload a file using java bean?

    hi, i need a code simple how to upload a file from jsp form to a java bean file (not a servlet) thank,s zik

  • QuickTime has no sound

    After updating to 10.5.1, Quicktime has no sound. At first I thought it was my PBG4. I was able to hear the system sounds as well as iTunes. I recently upgraded Flip4Mac as well. Could this be the cause of my problems. I miss listening to streams via

  • Sorting on Hide/Show Region

    One very small thing. I have show hide region and i am puling two columns from table and both can be sorted. here hows it is Expected Result: Color Col_Level Red R1 Red R2 Red R3 Red R4 Red R5 Green G1 Green G2 Green G3 Yellow Y1 Yellow Y2 But when i