Passing Pl/Sql variables into shell variables.

I have written a file that ftp information from one pc to another in unix.
All you have to do is supply a user_name/password and machine name to which ftp program will connect to.
All connection information like user_id,password, machine name are stored in an oracle table FTP_TBL.
It has the following fields:
FTP_TBL
================
USER_ID      NOT NULL VARCHAR2(100);
USR_PASSWD      NOT NULL VARCHAR2(50);
TO_MACHINE     NOT NULL VARCHAR2(50);
I have called a pl/sql script in unix shell.
This script selects all the connection information from FTP_TBL and populates the pl/sql variables with the
information.
Now i want the pl/sql variables like V_TO_MACHINE,V_USR_ID,V_USR_PASSWD to be passed on to unix variables
To_MACHINE, USR_ID AND USR_PASSWD.
How can i do this?
============================================================================================================
sqlplus -s <<+++ >> $LOG_FILE
$USER/$PASSWD
set serverout on SIZE 1000000
DECLARE
V_TO_MACHINE VARCHAR2(100);
V_USR_ID VARCHAR2(50);
V_USR_PASSWD VARCHAR2(50);
BEGIN
     BEGIN
          SELECT TO_MACHINE, USER_ID, USR_PASSWD
          INTO V_TO_MACHINE,V_USR_ID,V_USR_PASSWD
          FROM FTP_TBL;
     EXCEPTION
          when others then
          dbms_output.put_line('ERROR|SQLPLUS|'||ERROR||'|'||sqlcode||'|Failed during selecting configuration information.'||sqlerrm );
     END;
END;
+++
#======================== VARIABLES =====================
TO_MACHINE=$1
USR_ID=$2
USR_PASSWD=$3
#========================== MAIN ========================
ftp -vnd $TO_MACHINE << ++ 1>>$STA_LOG_FILE 2>&1
user $USR_ID $USR_PASSWD
prompt off
get $OR_DATA_DIR/ASC.STADATA $HOME_DIR/ASC.STADATA
bye
++
# testing the exit status of FTP
egrep "Transfer complete" $STA_LOG_FILE >/dev/null
if [ $? = 0 ]
then
echo >> $STA_LOG_FILE
echo "FTP Successfully Done" >> $STA_LOG_FILE
else
echo >> $STA_LOG_FILE
echo "FTP UnSuccessfull" >> $STA_LOG_FILE
exit 1
fi

Here an example of how to pass variables to the shell script :
TEST@db102 SQL> select ename, job, dname from emp,dept
  2  where empno = 7902
  3  and emp.deptno = dept.deptno;
ENAME      JOB       DNAME
FORD       ANALYST   RESEARCH
TEST@db102 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[ora102 work db102]$ cat disp_var.sh
set `sqlplus -s test/test << EOF
set pages 0
select ename, job, dname from emp,dept
where empno = 7902
and emp.deptno = dept.deptno;
exit
EOF`
echo $1 $2 $3
[ora102 work db102]$ ./disp_var.sh
FORD ANALYST RESEARCH
[ora102 work db102]$                                                  

Similar Messages

  • Inserting variables into other variables

    I have several objects that have similar names, like slot1, slot2, slot3, etc. I also have a function that is supposed to do something to the first object, then the next, then the next, etc each time a button is pressed. Is it possible to insert variables into other variables? So say I have a variable called n that is increased each time the button is pressed. The function is then applied to slot"n" each time the button is pressed. How would I do this?

    use:
    var n:Number=1;
    function f(){
    // do something to parentmovieclip["slot"+n]
    n++
    p.s.  please mark this thread as answered, if you still can.

  • Get value from PL/SQL procedure to shell variable

    Hello,
    I have one little problem. I want to run plsql procedure from shell program and then I want to fill a shell variable with return value of plsql procedure or function. But I don't want to pass this value to some file and then read it.
    Thank's

    user9357436 wrote:
    Hello,
    I have one little problem. I want to run plsql procedure from shell program and then I want to fill a shell variable with return value of plsql procedure or function. But I don't want to pass this value to some file and then read it.
    Thank'sLike below?
    bcm@bcm-laptop:~$ cat day.sh
    set X
    var1=$1
    SQLPLUS="sqlplus -s"
    LOGON="user1/user1 "
    day=`$SQLPLUS $LOGON <<EOF
    set heading off
    set feedback off
    set verify off
    select 'Have a nice day!' from dual where dummy ='$var1';
    exit;
    EOF`
    echo $day
    bcm@bcm-laptop:~$ ./day.sh
    Have a nice day!
    bcm@bcm-laptop:~$

  • Problem to store a oracle sql result into a variable

    Hello everyone,
    I'm working on a little project that use c#, Oracle ODT and asp.net, so here is the thing, I need to save the result of a sequence (SECNUM.NEXTVAL ) into a variable, then call that value from many inserts and querys and for last make the commit. My problem is that I don't know how to convert the string result to a number and the call it from the statements. Always brings two errors, one is invalid number because Im sending a string and the another is that if I comment the line cmd.ExecuteNonQuery(); the script runs but no commit happens.
    This is my code, is attached to a button:
    C# Syntax (Toggle Plain Text)
    string oradb = "Data Source=BBDD;User Id=DEMO;Password=DEMO;";
    string cmd1 = "SELECT SECNUM.NEXTVAL FROM DUAL";
    OracleConnection conn = new OracleConnection(oradb);
    conn.Open();
    OracleParameter parm = new OracleParameter();
    parm.OracleDbType = OracleDbType.Decimal;
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    cmd.Parameters.Add(parm);
    cmd.CommandText = "INSERT INTO DEMOINCI (CODINCI, CODCLI) VALUES (('" + cmd1 +"'), 'TEST')";
    cmd.CommandText = "INSERT INTO DEMOINCILIN (CODINCI,CODLIN) VALUES (('" + cmd1 +"'),1)";
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    So my problem is that the column CODINCI is a column number of (9) and not a VARCHAR and can not be changed because is already have data, so when I use the code of the example, Oracle return an error saying Invalid number (of course).
    With the help of a friend I tried to put with the cast like this cmd.CommandText = "INSERT INTO DEMOINCI (CODINCI, CODCLI) VALUES (" + "CAST(" + cmd1 + "AS NUMBER), 'TEST')"; and it works but only if I comment the line cmd.ExecuteNonQuery();, so the commit never happend and of course there is no insert in the database.
    ¿It is so difficult to store a result of an SQL into a variable and then call it back on a statement?, on Oracle Forms you create a cursor like cursor=CVAL SELECT SECNUM.NEXTVAL VAL FROM DUAL and that it you can then use the VAL result into all other queries of the same form an retrieving with the :VAL option.
    Thanks for all the help.

    I just had to do something similar for my C# class, using SQL Server. The primary key for a "Customers" table was an auto-incrementing integer. After inserting a new customer I had to retrieve and display the primary key:
    string selectStatement = "SELECT IDENT_CURRENT('Customers') from Customers";
    SqlCommand selectCommand = new SqlCommand(selectStatement, connection);
    int customerID = Convert.ToInt32(selectCommand,ExecuteScalar());
    The ExecuteScalar() method of selectCommand returned the first column of the first row of the dataset, which in this case was the key of the new Customers record, as an object. Convert.ToInt32() converted the key to an integer.
    Once you store SECNUM.NEXTVAL as an integer, you can use it to create a Parameter for the Command object.
    HTH.

  • Export shell variables into SPS variables

    I am looking for a way to assign shell variables which are defined in the "exec native" step, as a N1 variable.
    I will use this variable to generate a more userfriendly output in the "raise message"
    Has anyone an idea??
    Thanx

    Do you mean that you want to assign a value from within a shell variable to an N1 variable? If so, then you can use the <assignOutput> element in execNative. Here's an example:
    <varList>
    <var name="var1" default="not assigned"/>
    </varList>
    <simpleSteps>
    <execNative>
    <assignOutput varName="var1"/>
    <exec cmd="echo">
    <arg value="${my_shell_var}"/>
    </exec>
    </execNative>
    <raise message=":[var1]"/>
    </simpleSteps>
    ...

  • Pass Pl/sql table into USING clause in EXECUTE IMMEDIATE statment

    Getting error when I try to pass the PL/SQL table into USING clause in EXECUTE IMMEDIATE statment:
    Declare
    result NUMBER;
    TYPE values_tab IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    lv_tab values_tab;
    lv_exp varchar2(300);
    lv_exec varchar2(300);
    BEGIN
    lv_tab(1) := 5;
    lv_tab(2) := 48;
    lv_tab(3) := 7;
    lv_tab(4) := 6;
    lv_exp := ':b1+:b2+(:b3*:b4)';
    lv_exec := 'SELECT '||lv_exp ||' FROM DUAL';
    EXECUTE IMMEDIATE
    lv_exec
    INTO
    result
    USING
    lv_tab;
    DBMS_OUTPUT.PUT_LINE(result);
    END;
    Error at line 1
    ORA-06550: line 20, column 12:
    PLS-00457: expressions have to be of SQL types
    ORA-06550: line 15, column 8:
    PL/SQL: Statement ignored
    I am trying to evaluate the expression ":b1+:b2+(:b3*:b4)" which is stored in table. This table has different expressions (around 300 expressions). I want to use the bind variables in expression because each expression evaluated thousand of time may be more in some case. If I don't use bind variable then it fill shared pool.
    Is there any way I can pass the USING (IN) parameters dynamically instead of writing "USING lv_tab(1), lv_tab(2), lv_tab(3), lv_tab(4)"? As number of input parameters change depend on the expression in the table.
    If not possible please suggest any other ideas/approches
    Please help..
    Edited by: satnam on Jun 11, 2009 11:50 AM

    Well, you keep changing reqs faster I can keep up. Anyway, assuming N-th bind variable (left-to-right) corresponds to collection N-th element:
    Declare
        result NUMBER;
        lv_tab values_tab := values_tab();
        lv_exp varchar2(300);
        lv_exec varchar2(300);
        lv_i number := 0;
    BEGIN
        lv_tab.extend(4);
        lv_tab(1) := 5;
        lv_tab(2) := 48;
        lv_tab(3) := 7;
        lv_tab(4) := 6;
        lv_exp := ':5000135+:5403456+(:5900111*:5200456)';
        lv_exec := lv_exp;
        While regexp_like(lv_exec,':\d+') loop
          lv_i := lv_i + 1;
          lv_exec := REGEXP_REPLACE(lv_exec,':\d+',':b(' || lv_i || ')',1,1);
        end loop;
        lv_exec := 'BEGIN :a := ' || lv_exec || '; END;';
    DBMS_OUTPUT.PUT_LINE(lv_exec);
    EXECUTE IMMEDIATE lv_exec USING OUT result,IN lv_tab;
    DBMS_OUTPUT.PUT_LINE(result);
    END;
    BEGIN :a := :b(1)+:b(2)+(:b(3)*:b(4)); END;
    95
    PL/SQL procedure successfully completed.
    SQL> SY.

  • How do I separate this csv variable into individual variables?

    The main variable being passed is #whoplayer#.
    I need to be able to separate them into individual variables but I can't figure it out.  Sometimes the variable passed is not separated by commas (only 1 items passed) (1245) other times it's multiple:   (1245,1246,1250)
    Please help.

    Check out cflib.org, there are a couple of tags there for handling csv data.  Was not clear whether you meant actual CSV formatted data, or just data elements separated by commas.  If the latter, then Dan's CFLOOP colution also works.  If the former, then there are a few more variations that CFLOOP won't handle so easily, but those ahve been solved by the cflib.org tags.
    -reed

  • Copy Standard Variable into Z variable.

    Hi all,
    I am using a standard variable 0DAT in the query for 0calday.
    Now i want to make a clone of the same variable.i.e i want to copy it with the same structure into Z variable.
    Also, 0DAT is having SAP Exit and that should copy to Z variable.
    Please suggest.
    Regards,
    Macwan James.

    Hello,
    User exit are variable specific, so if u create new z variable you have to write your own user exit.
    Its pretty simple to create:
    1) Create Zvariable type user exit with single and no ready for input
    2) In CMOD write a simple code for this variable as
    when 'zvariable'.
    if i_step = 1.
    l_t_range-low = sy-datum.
    l_t_range-sign = 'I'.
    l_t_range-opt = 'EQ'.
    Regards,
    Shashank

  • Issue passing variable into shell script

    Please see terminal session.
    -  calling pwd, unset, or echo alleviate the issue.
    - running the script 'plain' also exihibit an issue
    - calling 'cat test.sh' causes an issue
    I can repeat the issue on OSX 10.5.8
    On Ubuntu, two a's always print out with: A=a B=$A ./test.sh
    Terminal session:
    bash-3.2$ ls -l test.sh
    -rwxr-xr-x  1 axure  staff  16 Mar 29 09:27 test.sh
    bash-3.2$ cat test.sh
    echo $A
    echo $B
    bash-3.2$ pwd
    /Users/axure
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$ $A
    bash-3.2$ $B
    bash-3.2$ echo $A
    bash-3.2$ echo $B
    bash-3.2$ unset
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$ pwd
    /Users/axure
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$ unset
    bash-3.2$ cat test.sh
    echo $A
    echo $B
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$ unset
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$ unset
    bash-3.2$ ./test.sh
    bash-3.2$ A=a B=$A ./test.sh
    a
    bash-3.2$

    bash-3.2$ ls -l test.sh
    -rwxr-xr-x  1 axure  staff  16 Mar 29 09:27 test.sh
    bash-3.2$ cat test.sh
    echo $A
    echo $B
    bash-3.2$ pwd
    /Users/axure
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    As I would expect
    bash-3.2$ A=a B=$A ./test.sh
    a
    NOT what I would expect.  I tested this using bash 3.2 and got the same results, HOWEVER, when I tested this with bash 4.0, I got what I expected, namely your first results everytime.
    So I think there is a bug in bash 3.2.  You can get the bash sources, and build your own bash if you wish, or use a different method of setting 1 time envionment variables for use in a subprocess.
    bash-3.2$ $A
    bash-3.2$ $B
    bash-3.2$ echo $A
    bash-3.2$ echo $B
    As expected, as the way you set A & B were as 1 time environment variables that were only seen by the subprocess created when test.sh was run.  A & B were NOT created in the current shell environment, so the current shell environment would not have any values for A & B
    bash-3.2$ unset
    bash-3.2$ A=a B=$A ./test.sh
    a
    a
    bash-3.2$ A=a B=$A ./test.sh
    a
    Again, now what I would expect, but as I have already stated, I think there is a bug in bash 3.2 that does not exist in bash 4.0.
    Now a bigger question, why are you passing A & B as 1 time envionment variables?  Why not just pass them on the command line?
    test.sh a a
    where test.sh would be
    echo $1
    echo $2
    Or you could use export to create environment variables A & B
    export A=a
    export B=$A
    test.sh
    Now A & B would still exist after test.sh, which I assume you do not want to do.
    You could try ceating test.sh as a bash function and see if that changes the behavior
    test()
        echo $A
        echo $B
    A=a B=$A test
    You would have to define test() in your shell initialization scirpt if you needed each time you started a terminal session.
    While I have used 1 time environment variables, I more frequently just pass arguments on the command line.

  • Input result from a SQL-query into a Variable in ProcessFlow

    I am trying to select a value from a table with file names.
    This file name should be input to an ftp function. I use a owb function to read the file name then I try to asign the result to a variable.
    The function GET_FILENAME looks like
    f_name varchar2(30);
    BEGIN
    select distinct FILENAME_SOURCE into f_name from CTL_SOURCE_FILES
    where FILEID = (select min(FILEID) from CTL_SOURCE_FILES where status is null);
    RETURN f_name;
    END;
    When running it as a SQL-script it returns only one row/name.
    When I am running it in the ProcessFlow the following message is found:
    RPE-02040: Internal error: GET_FILENAME cannot be converted to a constant value.

    Let me talk about this in context of a mapping:
    create a mapping :
    use a function within a mapping
    assign the output of the mapping to a mapping input variable"
    use this mapping within your process flow and see if it works.
    if you are directly going to use the output of a function in a process flow , the FTP should be able to accept the filename from the outparam of the function which i am not sure how it works.
    try using the first approach as it is relatively simple and straightforward.

  • How to pass a litral string into cursor variable?

    Hi All
    I have a code like below:
    I need to select the following table,column with the criteria as such but it looks like the literal string does not work for cursor variable.
    I can run the SQL in sqlplus but how I can embed that in PL/SQL code??
    -Thanks so much for the help
    cursor ccol2(Y1 varchar2) is select table_name,column_name from user_tab_columns
    where table_name like 'HPP2TT%' and table_name like '%Y1'
    and column_name not in ('MEMBERID');

    Literal strings are fine in a cursor, however, your logic is likely wrong, and you are not using the Y1 parameter to the cursor correctly. If you are looking for tables that either start with HPP2TT or end with Y1 (whatever you pass as Y1), then you need something more like:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where (table_name like 'HPP2TT%' or
           table_name like '%'||Y1) and
          column_name not in ('MEMBERID');In the unlikely event that you are lookig for table that actually do start with HPP2TT and end in whatever is passed in Y1 then your query could be simplified to:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where table_name like 'HPP2TT%'||Y1 and
          column_name not in ('MEMBERID');Note in both cases, a single member in-list is bad practice, although Oracle will transform it to an equality predicate instead.
    John

  • How to pass the grep result into a variable in Unix

    I have the following statements in my unix batch script:
    JOBNAME=`grep "$1" rssc_plsbatch.txt|awk -F'~' '{print $1}'`;
    PROCNAME=`grep "$1" rssc_plsbatch.txt|awk -F'~' '{print $2}'`;
    JOBDESC=`grep "$1" rssc_plsbatch.txt|awk -F'~' '{print $3}'`;
    PARMS=`grep "$1" rssc_plsbatch.txt|awk -F'~' '{print $4}'`;
    I want to grep the the first line in the text file and pass it to a variable and then using awk programming, I want to print for each variable (JOBNAME, PROCNAME, JOBDESC and PARMS), instead of using grep 4 times.
    Can somebody please help.
    Each line of my text file is in the the following format:
    00001JOB1~PROCNAME1~This is a procedure~10,'A','B'~
    And also I want to check whether $1 passed (part of JONAME) is not fount, then it should exit with error message, if $1 (input parameter) does not match, I want to exit the program, instead of processing further statements.

    If you want to return error codes, you can do that with the return command.
    If the process name isn't found, grep will return a specific error code... from man grep
    Normally, exit status is 0 if selected lines are found and 1 otherwise.
    But the exit status is 2 if an error occurred, unless the -q or quiet or silent option is used and a selected line is found.
    So you can use the exit code of grep in an if statement to decide what return code you want to return with your own script.
    Mike

  • Value from a formula variable into text variable in BEx Query

    Hello,
    if anyone knows how I can do the following please let me know:
    I have a formula variable in a formula (ZUM_KVAL). The value will be entered before execution of the query.
    Now I would ALSO like to display the entered value (from ZUM_KVAL) as at text variable (ZUM_KTXT) in the name of the field in the query/report.
    If anyone could provide me with info about how to do that, I'd appreciate very much.
    Thanks in advance.
    Cu, Stefan

    Hi Shashank,
        You can achieve this by creating a customer exit variable for calendar month.
    Function module :
    READ TABLE i_t_var_range WITH KEY vnam = 'Date variable name ' INTO loc_var_range.
       IF sy-subrc = 0.
        year = loc_var_range-low(4).
        month = loc_var_range-low+4(2).
         CLEAR l_s_range.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         CONCATENATE year month INTO l_s_range-low.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    Hope this will help you. Let me know if you have any questions.
    Regards
    Suvarna

  • Put variable into another variable

    Hi All~
    I am writing the following script:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    get-content 'C:\SLDATA\Serverlist.txt'  | foreach-object {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)
    $dbs += $srv.Databases
    $dbs | select name,onwer,size | Sort-object size
    clear-variable -Name dbs
    Then the output will be :
    Name               Owner              size
    master             sa                     1024
    master             sa                     2048
    tempdb             sa                    5000
    tempdb            sa                     6000
    if I want to add a output column of the server name like the following
    Servername     Name        Owner     Size
    Server1            master       sa           1024
    Server2            master        sa         2048
    Server1             master       sa         5000
    Server2            master        sa           6000
    how to re-write the script

    Try this:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    $Servers = get-content 'C:\SLDATA\Serverlist.txt'
    foreach ($server in $servers) {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = (new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)).Databases
    $srv | Add-Member -type NoteProperty "Servername" $server
    $dbs += $srv
    $dbs | select servername,name,owner,size | Sort-object size
    clear-variable -Name dbs
    Assigning the get-content to a variable allows you to use the foreach ($server in $servers) so the server name is available at the end of the pipeline.  
    Assigning the .databases element to $srv instead of the whole object allows you to add the server property.
    Hope this helps!  I don't have a SQL instance to test...

  • Cannot proces shell variable

    Hi All,
    I am trying to write a BASH shell script, where I need to process the value of a database column. I am having trouble processing this value, and would like to know what your thoughts are. The part of the script I am having difficulty with has been isolated, and is presented below:
    [oracle@oelvm03 bin]$ cat Problem.sh
    #!/bin/bash
    export ORACLE_SID=ORCL
    export ORAENV_ASK=NO
    export PATH=/usr/local/bin:$PATH
    . oraenv
    LOG_MODE=`sqlplus -s / as sysdba <<  EOF
    set heading off
    select log_mode from v\\$database;
    exit;
    EOF`
    echo $LOG_MODE
    case $LOG_MODE in
    NOARCHIVELOG)
      echo In NOARCHIVELOG Mode.
    ARCHIVELOG)
      echo In ARCHIVELOG mode.
    MANUAL)
      echo Manual Archiving.
      echo Oops - Don\'t know what this mode is - ~$LOG_MODE~
    esac
    echo Finished!
    [oracle@oelvm03 bin]$ Problem.sh
    The Oracle base for ORACLE_HOME=/opt/oracle/app/oracle/product/11.2.0/dbhome_1 is /opt/oracle/app/oracle
    ARCHIVELOG
    Oops - Don't know what this mode is - ~ ARCHIVELOG~
    Finished!
    [oracle@oelvm03 bin]$The script is running on Oracle Enterprise Linux, against an Oracle 11gR2 database.
    The problem is that the value of the LOG_MODE variable is not being processed correctly by the case statement. Examining the error message shows that there appears to be a leading space before the value
    ~ ARCHIVELOG~
    I have tried desperately, in other scripts, to isolate the value and get the case to respond appropriately, but without any success.
    Does anybody have any ideas on what I am doing wrong??

    It will work in this case, but I would generally not use this approach. Please see below:
    var="This v$log"
    var=`echo $var`
    echo $var
    This vUsing "set pages 0 feed off" will not cause such problems and suppress control characters, feedback and other headers that you don't want when putting the output of a sql statement into a variable.

Maybe you are looking for

  • OS 10.4.2 User account corrupt?

    G5 dual 2.7 Ghz - OS 10.4.2 We had a power supply die during use. The supply has been replaced and I'm testing the mac now. The user account ( user A ) that was open when the Mac died will not log in. The other pre existing accounts log in fine. When

  • Serious Firewire Meltdown

    I'm working on a film right now, with four different drives - two Lacie D2s, and two Western Digital MyBooks. A couple of weeks ago, something very strange started happening - the firewire cards on every computer we use stop working. It's not just th

  • Acrobat 9-Possible to Crop to TrimBox?

    Hello, I have a feeling this is very easy to do. I am not familiar with any acrobat scripting. Where's the object model viewer? How do you add the script?(I hate this question) I know I can figure it out with a little research. Any help would be a ve

  • XSD Namespace and WSDL Namespaces

    Hi, I have a wsdl in which I'm defining a xsd schema in the <wsdl:types> element. Can we have same targetnamespace for both (wsdl) and (xsd that is defined in wsdl <types> element) ?? Please clarify. Thanks Edited by: bpeltechie on Jul 5, 2012 2:17 P

  • Problem with 9.0.3(urgent)

    hi, i am trying to deploy an application created and built under java 1.4. in fact, im using some functionality provided by 1.4 only. now if i deploy it in oc4j release 2(9.0.3) it gives a version problem saying that class version for java.lang.Objec