sqlplus from a shell script with the variable in unix

I'm having some trouble calling sqlplus from a shell script... I am basically asking for a path/name of file which I attribute to one to a variable called $code. Then use cp to move the file ($code) to a new directory. I think that there is something wrong with my sqlplus below. echo $code does not work yet. I thought that $code was variable, which I could see, but rather it seems that the script is trying to rerun the SQL command each time.

Any help would be greatly appreciated... condensed version of the code is below. Thank you!

file in $FILES
do
Code =""
code ='sqlplus-s $USER_PWD < < EOF
Set the off position;
set pagesize 0;
Select r.outfile_name OUTFILE
some paintings
where file_name = $file;
EXPRESSIONS OF FOLKLORE"
echo $code
CP $code $newdir

Hello

I hope code below will help but set feedback off so that he won't be any info if no line selected

echo ${CODE}
if [ -z "${CODE}" ]
then
echo "No rows returned"
else
echo "Returned"
fi

Concerning
CA
uninstall security tool
essential elements of the Security window
Windows startup configuration
the Award bios update

Tags: Oracle

Similar Questions

  • Is it possible the reel with the variable column size?

    Hi, I'm queue to a CSV file with the following script (the SELECT real is different but similar, Oracle 10.2.0.3.0):
    SET COLSEP ';'
    SET FEEDBACK OFF
    SET LINESIZE 2000
    SET PAGESIZE 0
    SET TERMOUT OFF
    SET TRIMSPOOL ON
    SET VERIFY OFF
    
    SPOOL test.csv REPLACE
    
    SELECT 'COLUMN1', 'COLUMN2', 'COLUMN3' FROM dual UNION ALL
    SELECT 'value1', NULL, NULL FROM dual UNION ALL
    SELECT 'value2', NULL, NULL FROM dual;
    
    SPOOL OFF
    
    EXIT SUCCESS COMMIT
    Which produces the following output:
    COLUMN1;COLUMN2;COLUMN3
    value1 ;       ;
    value2 ;       ;
    Is it possible to get the following with the variable column size result
    COLUMN1;COLUMN2;COLUMN3
    value1;;
    value2;;
    I tried SET NULL "but I see no difference. Thanks in advance!

    Markus

    Hello

    SQL * Plus you button the output so that each column has a fixed length, which is exactly what you don't want.

    To get around this, concatenate all your data in a column VARCHAR2 fat with delimiters.

    For example, instead of

    SELECT    empno
    ,       ename
    ,       hiredate
    FROM       scott.emp
    ;
    

    Do something like

    SELECT    empno
    || ';' || ename
    || ';' || TO_CHAR (hiredate, 'DD-Mon-YYYY')
    FROM       scott.emp
    ;
    
  • How the coil with the variable?

    I need the motion of the coil with the variable filename.
    Concept as below:
    select HOST_NAME||'_'||INSTANCE_NAME||'_'||to_char(sysdate,'YYYYMMDD_HH24MISS')||'.txt' as Filename from V$INSTANCE;
    
    SPOOL c:\&Filename;
    When I run this script it will ask to input 'filename '.

    Please suggest.

    Kind regards
    Suradech

    There are many examples to achieve...

    http://tinyurl.com/2f7ukdr

    However, why the spool SQL * more to get an outing in the files, when you can export within PL/SQL to achieve the same and then dynamic file names making is really easy.

  • Is it possible to store parameters to script with the InDesign file?

    Hello

    I have a crazy idea: it is possible to store parameters to script with the InDesign file?

    In this case the Scripting Guys will be able to store these settings with the file, and when the script runs - he can check if those setting exists - if so - script can run without showing the dialog with the settings... (like all the necessary parameters are stored with the indesign file), and of course we can force InDesign to display the script dialog parameters if run us with the alt/option key pressed when executing this script. Maybe even different scripts will be able to share these settings and interact with each other... We will be able to have the settings will be saved with the file, or temp settings for the document assets or session (till InDesign is closed). With eventListeners and commissioning, scripts, that we will be able to make scripts that would be able to check updates and automatically run when we placing images and text and so on... This can be a set framework of InDesign scripting, allowing to write scripts that use ui and same libraries so we don't have to write everything from scratch every time and just included required libs...

    So here are 2 great questions for now:

    (1) is it possible to store script with .indd file settings

    (2) who is interested in creating InDesign scripting (because it only makes sense if it will use a lot of people)

    PS: I know that it is possible to store settings in an external file, but this time, I'm interested only to save the params with .indd

    The syntax of the function to write the label:

    app.activeDocument.insertLabel('myLabel', 'myLabelValue');
    

    IMPORTANT: If you forget the name of the label, the label is LOST! Really? YES, REALLY!

    The syntax of the function for the reading of labels:

    var myLabel = app.activeDocument.extractLabel('myLabel');
    

    http://indisnip.WordPress.com/2010/07/31/saving-script-data-within-document/

  • get a dotted line around .swf files in my flash site now. This is new from Firefox 3. With the help of 4 on a MacBookPro. tried the fix "style no outline. does not work. any help?

    Question
    get a dotted line around .swf files in my flash site now. This is new from Firefox 3. With the help of 4 on a MacBookPro. tried the fix "style no outline. does not work. any help?

    Ah, quite understand now that I added to my doc html

    < style type = "text/css" >
    {body
    background-color: #FFF;
    }
    "'object {outline: none ;}"} '

    < / style >

  • Adjust the data in the database with the variables

    Hello

    For my internship, I have an assignment to read and set a database with the variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables and the user can adjust the variables of Scripture. The first part was "easy" because the forum contained a lot of examples of this. The second part is more difficult because the forum contains absolutely no example of this. Can I use LabVIEW 2010 and 2011, and also I downloaded the 30 day trial of the database connection tool. If it's useful, I can recommend my company to buy this package. Playback vi makes use of a UDL (Microsoft data link) connection.

    So you guys my question is: is it possible to adjust the specific variables in a database using LabVIEW? And maybe you can give me a little advice on this topic...

    Thanks in advance!

    Roy

    In SQL, the specific data are always selected with the keyword WHERE. In VI to update there is a link for options, you can for example add a constant 'WHERE id = 1457 and measure > 0.54 ".

    You can ofc. also build this chain through controls, settings and other means.

    If you prefer, you can use the Execute Query (under Advanced tab I think) to which you can send the complete query example "TestTable Update set name ="Zeus"where id > 14 and id.<>

    /Y

  • getURL() does not work with the variable

    I have a button that does two things:
    First of all, it opens a new Flash movie in a new window, using the line:

    getURL ("javascript:OpenBrWindow('/movie2.asp','MyMovie','status=0,scrollbars=1','865','690_','true')");

    It then redirects the original window to another URL by using the line:

    getURL (" http://www.mydomain.com")

    This works very well when the two lines are combined into an instance of button as follows:

    on (release) {}
    getURL ("javascript:OpenBrWindow('/movie2.asp','MyMovie','status=0,scrollbars=1','865','69_0','true')");
    getURL (" http://www.mydomain.com")
    }

    But if I set a variable to contain the first url, replace the url with the variable, the new window never opens.

    Here's the new code:
    It is located in frame 1:
    MyURL = "javascript:OpenBrWindow('/movie2.asp','MyMovie','status=0,scrollbars=1','865','690','tru_e')";

    This is the new code behind the button instance:
    on (release) {}
    getURL (myurl);
    getURL (" http://www.mydomain.com")
    }

    The second command, redirection, works, but a new window never opens to the other film.

    Any ideas?

    Thank you
    Beth

    Okay - with some trial and error I figured it. I discovered that the variables declared and populated in the timeline not copied to the button unless they are configured as global variables. Call of my variable _global.myurl did the trick.

  • Evaluation of a String XPath Expression with the Variable

    SQL & gt; Select * from version of v$.

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    5 selected lines.

    SQL & gt; Get & xdb.eval
    1 xquery
    2. let $x: = document {& lt; doc & gt; & lt; a & gt; 1 & lt; /a & gt; & lt; b & gt; 2 & lt; /b & gt; & lt; c & gt; 3 & lt; / c & gt; & lt; / doc & gt ;}}
    3. let $i: = ' / doc/one.
    4 * return $x (: {$i} :))
    SQL & gt; /

    Result sequence
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    & lt; doc & gt; & lt; a & gt; 1 & lt; /a & gt; & lt; b & gt; 2 & lt; /b & gt; & lt; c & gt; 3 & lt; / c & gt; & lt; / doc & gt;

    1 item (s) selected.

    SQL & gt; Edit
    A written file afiedt.buf

    1 xquery
    2. let $x: = document {& lt; doc & gt; & lt; a & gt; 1 & lt; /a & gt; & lt; b & gt; 2 & lt; /b & gt; & lt; c & gt; 3 & lt; / c & gt; & lt; / doc & gt ;}}
    3. let $i: = ' / doc/one.
    4 * return $x {$i}
    SQL & gt; /
    ERROR:
    ORA-19114: XPST0003 - error during parsing of the XQuery expression:
    LPX-00801: XQuery syntax error in ' {'}
    3. return $x {$i}
    - ^


    SQL & gt; -expected result: & lt; a & gt; 1 & lt; /a & gt;

    My goal is to use the results of the xmldiff function to analyze the changes in xml documents. The xmldiff product update-nodes with xpath attribute elements. I want to produce a result extended with surrounding elements of the node has changed. This feature to evaluate the content of a variable in UNIX is provided by the $(expr) or the function eval in other script languages. How this is done in xquery?

    Edited by: 880283 August 18, 2011 19:26

    Hello

    There is no standard XQuery function to do.

    Here are some alternatives:

    1 - construction of the entire XQuery expression dynamically
    2. using a user-defined function to access the items dealt with by the XPath expression
    3 - use excerpt function, but it is obsolete...

    Example 1-

    SQL> var doc1 varchar2(4000)
    SQL> var doc2 varchar2(4000)
    
    SQL> begin
      2
      3   :doc1 := '
      4   
      5    ABC
      6    XYZ
      7   
      8  ';
      9
     10   :doc2 := '
     11   
     12    ABC
     13    XYZ
     14   
     15   
     16    123
     17   
     18  ';
     19
     20  end;
     21  /
    
    PL/SQL procedure successfully completed
    
    SQL> with t as (
      2   select xmldiff(xmltype(:doc1), xmltype(:doc2)) xdiff_doc
      3   from dual
      4  )
      5  select x.*,
      6         xmlserialize(document
      7           xmlquery(x.parent_xpath
      8             passing xmltype(:doc1)
      9             returning content
     10           )
     11           as clob indent
     12         ) parent_node
     13  from t,
     14       xmltable(
     15         xmlnamespaces('http://xmlns.oracle.com/xdb/xdiff.xsd' as "xd"),
     16         '/xd:xdiff/child::*'
     17         passing t.xdiff_doc
     18         columns
     19           op_type        varchar2(30)   path 'local-name(.)'
     20         , node_type      varchar2(30)   path '@xd:node-type'
     21         , parent_xpath   varchar2(2000) path '@xd:parent-xpath'
     22         , attribute_name varchar2(30)   path '@xd:attr-local'
     23       ) x
     24  ;
    
    OP_TYPE                        NODE_TYPE                      PARENT_XPATH                 ATTRIBUTE_NAME                 PARENT_NODE
    ------------------------------ ------------------------------ ---------------------------- ------------------------------ ----------------------------------
    delete-node                    attribute                      /root[1]/item[1]             id                             
                                                                                                                                ABC
                                                                                                                                XYZ
                                                                                                                              
    
    append-node                    element                        /root[1]                                                    
                                                                                                                                
                                                                                                                                  ABC
                                                                                                                                  XYZ
                                                                                                                                
                                                                                                                              
     
    

    Published by: odie_63 on August 19, 2011 10:40

  • Help with the variables!

    First of all, allow me to apologize for my screen name, I tried to 31 different names and none of them would work, pretty bad if you ask me.

    I tried a project for more than a year, who failed miserably after that I have had no help anywhere I asked, but the circumstances are bring me to take over this project.

    To expose my project, this is a great Simulator, created in Excel, and he got several very large databases in this regard. However the most simplest thing; variable, kept me from using flash to complete the project. I don't know how to explain it more simple, that I was just on the sites of more than a dozen on the first page of google that attempt to explain the use of variables and text boxes and none of them worked.

    Let me to you, my problem is that no matter what I try, I have dynamic text boxes that always return a value of NaN. I'll give my method to have an entry box return values for dynamic areas.

    My first step is to have a box of text, with the defined variable such as; rlevel and a dynamic as; text box points. I have a button that applies to text input in the dynamic area.

    It's the actionscript on the button;

    on (release) {}

    =(rlevel-1) points * 4;

    }

    It's pretty basic to start, but no matter the method I tried he always returns NaN. Another alternative, I've tried is defining the dynamic and input areas and other variables and do the math an individual variable;

    Level = x;

    points =(x-1) * 4

    on (release) {}

    bpoints = points;

    }

    Once more, this returns Nan in my box of text dynamic and undefined in my Inbox.

    I'm very fluent with the mathematical formula and I have a lot of additions to make, however as said I can't get beyond the most basic part of my project once more despite the continuation of many tutorials on the subject, that note saying to do exactly what I have made. An example of method as reference is the following;

    founded_date = 2000;

    closing_date = 2003;

    on {(press)

    founded_date closing_date = years_running;

    }

    This is no different that mine, and she always returns NaN. I did successfully a dynamic > entry text box function, just by;

    on (release) {}

    points = level

    }

    and the string level is returned correctly, he simply refuses to do so with a calculation. I'm very lost and confused and do not want to give up my plans once more. Kudo to ANYONE who can explain what is happening. I hope this time someone mind helping me.

    Chances are your first attempt to get a screen name would have stolen, but for some reason, their registration system rejects anything you enter... After some trial and error, I found that you just ignoring the message gets the name you want (unless it's really had).

    For all your troubles go with the textfield, I recommend to avoid the use of the var of the textfields and just manipulate their text property.  Name the instance textfields in the properties panel instead of specifying a var for them.  Let's say you a myPoints name and the other MonNiveau.  Your button code would look like...

    on (release) {}

    myPoints.text = String ((Number (myLevel.text)-1) * 4);

    }

    If AS2 is often very indulgent if you do not throw things like a string or a number, it just helps to ensure that things are designed to work correctly if you use them.  A textfield contains string values, so treat them as numbers, you throw as the Number(), and if the result is assigned to a textfield, casting while he is a String [] is appropriate.

    If you always go to AS3, it's not at all forgiving and textfields var element no longer exists.

  • Graphic problem with the variable

    I have an icon of screen with a graphic that is bound to an expression, specifically = imagefilepath.

    Imagefilepath variable is generated by the code attached with a few other variables that already exist in the Authorware piece. I also have a test screen that shows what the imagefilepath value is at the moment.

    Note that fileQuiz is the name of the file individual quizzes based on XML that is used (for example, quiz.xml) and all the image files are stored in a subfolder named after it more than image files (for example, quizImageFiles).

    When I test locally or run this with access to the files, it works fine. It test it via web access, the imagefilepath points to the correct URL, the graphic is at this URL, but no image to appear.

    Any ideas as to what I do wrong or how fix?

    "JPKinstle" wrote in message
    News:eio1u9$q6t$1@forums. Macromedia.com...
    > I appreciate your help, Amy, and I'm sorry that I disappeared on you. I had a few
    > allergy tests spoil... wasn't pretty.
    >
    > In any case, I could probably use NetDownload if I would always run forward.
    > Authorware still has a lot of things that I've never touched.
    >
    > Let me see if I have notions of right, here.
    >
    >

    1. In computing, I currently have, I could use the location
      > generator I have now to specify the netlocation of my chart.
      >
    2. Then, I use NetDownload with this site generated to stuff the file
      > on the local disk of the user.
      >
    3. Then I could use the string: = NetDownload ("URL") to get the new local
      > location of the chart.

      The above two steps would be combined in a single step.

      >

    4. Can I use the new channel for the local graphic location to update the
      > image.

    You might actually which combine with the above two steps as well.

    > I basically have that, or have I missed something?

    You can also watch the NetDownloadBackGround, because it does not stop
    all for download. You can also consider renaming the
    downloaded the files to prevent them from being deleted when your piece of AW
    farm.

    HTH;

    Amy

  • macOS installation of Sierra (from El Capitan) fails with the message "internal error."

    Tried the update to Mac OS Sierra and it seemed that everything was fine, but at the very end of the process, it would not be completed installation. Sierra downloaded OK and when I click on install it went through a process of 15 to 30 minutes, rebooted and then watched as he was finishing the installation for a few minutes. But then I got similar error message (a gray window clear on a gray screen dark, with a round Sierra icon upwards):

    "Mac OS could not be installed on your computer.

    An internal error has occurred.

    Quit the installer to restart your computer and try again

    [Button] »

    I have a Macbook Pro retina mid 2012 with a processor clocked at 2.6 GHz Intel Core i7, NVIDIA GeForce GT 650 M 1024 MB graphics, 16 GB 1600 MHz DDR3 RAM and a SM768E of APPLE SSD flash hard drive. I ran disk utility, and it says everything is fine. I tried different approaches, several times, but no matter what I try, I can't seem to install the new macOS Sierra. I even wiped my entire computer and started from scratch, by installing a clean OS X 11 (El Capitan) and then try to install the Sierra, but still it does not work. This makes me think that maybe that's a problem with my App Store account? But given that I was connected, I'm not sure that it could be. Or maybe it's hardware related? I do not know. Even the SR Advisor. Apple I was talking with the phone was perplexed.

    Super frustrated, certainly would like some advice, thanks!

    https://support.Apple.com/en-us/HT201262

    Try starting mode safe mode and see if you can install it then

  • Problem with the variable moveIntoFolder_Task

    Hello

    I spend a lot of time already trying to find how I can put VM I found in moveIntoFolder_Task.

    What I'm doing:

    1 create a folder

    2. find a virtual machine provided in the text field

    3. move this virtual machine in the target folder.

    try {newFolder = parentFolder.createFolder ("test1") ;}

    {catch (Err)}

    findVM (vmname);

    function findVM (vmname) {}

    allVms = System.getModule("com.vmware.library.vc.folder").getAllVirtualMachinesByFolder (parentFolder);

    RET = null;  for (var i in allVms) {}

    If (allVms [i] .name == vmname) {ret = allVms [i];  break;  }} return ret;

    }



    var vms1 = new Array();

    vms1 = [];

    vms1 = vms1.push (ret);

    task = newFolder.moveIntoFolder_Task (vms1);

    var actionResult is System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd (task, progress, pollRate);.


    vms1 is VC:VirtualMachine type - but when I select this variable manually as an attribute - it works fine, I can't cmove VM in the target folder.

    When I find this virtual machine by using the function {} findVM I get following error:

    State: 'impossible', State of the business: "null" exception: ' cannot convert 1.0 [com.vmware.vmo.plugin.vi4.model.VimManagedEntity]


    Do you know how I can convert VM to data type VimManagedEntity?

    Hello

    You have no need to convert the VM VimManagedEntity.

    The problem is the next part of your code:

    vms1 = vms1.push(ret);
    task = newFolder.moveIntoFolder_Task(vms1);
    

    It seems that you expect the first line to push the object ret at vms1 table and return the array object, which then you pass as an argument to the method moveIntoFolder_Task().

    The problem is that the push() method will not return the table object, but the length of the array. So in fact you call moveIntoFolder_Task() method with the type argument number instead of argument array of virtual machines, and that's why you get this exception "cannot convert...". »

    So the solution is to replace:

    vms1 = vms1.push(ret);
    

    with a little (no assignment)

    vms1.push(ret);
    
  • Run a script with the command sudo bash

    Hello

    I'm trying to run a bash script with comments script Manager package. There is a sudo command in the script and he asks me problem.

    First mistake is: sudo: Sorry, you must have a TTY to run sudo

    So I tried to run the command sudo with ssh localhost sudo t t < command > but I get a new error (and even one): tcgetattr: Inappropriate ioctl for device

    I don't know how to run as the root user is not allowed to connect.

    So, launching a vCO sudo command really possible?

    Thank you!

    Sudo problem is quite easy to solve; "edit/etc/sudoers on the endpoint point ssh and then comment or delete the line"Defaults requiretty". That should fix that right up. What command are you trying to run?

  • Spacing problems with the variable in the text captions and smartshapes

    Hello

    I am using Captivate 7.0.1.237 on Windows 7.

    I created a questionnaire that is customized with the last screen showing a message of congratulations and the total score. The total score is variable. The legend appears on the "Edit" mode. But when I publish it as a SWF, spacing stops to the variable.

    Here's what it looks like in edit mode:

    VariableIssue.jpg

    Here's how it looks in the browser (F12 and published modes):

    VariableIssue_Browser.jpg

    I inserted the variable using the accordion Format. What I tried:

    • The simultaneous use of smartshapes and text captions
    • Different browsers (FireFox 24, IE 11, Google Chrome 32)
    • Typed content in Notepad and copy it to the legend smartshape and text.
    • Typed content directly in the legend smartshape and text.

    I get the same result in each scenario.

    Please notify.

    Anthony

    Try to remove the Red extra formatting.

  • Bug with the 'Variable width tool. "

    I tried the new CS6 Illustrator and using the Variable width tool, I found this was not accurate, at least the anchors appear somewhere else where I'm clicking on...

    I uploaded a picture. and a videoto clarify.

    It is a line with no other "width anchors", after pulling the handle, the anchor appears in another place where I just change the width...

    AI bug.jpg

    Yes, but as shown in your video, when all is said and done, you have the exactly width anchor point where you originally placed the cursor.

    I noticed a 'ghost' width anchor point appearing when I tested, but it disappears as soon as I move the cursor.  The anchor of width is created exactly where I initially put it-in this case, at the intersection of the guidelines:

    Ken

Maybe you are looking for

  • I have updated to ioS 9.3.2 and now my phone won't open.

    I've just updated to iOs 9.3.2.  My laptop does not open.  Its as if the phone crashed after the update.  This happened to someone else?  I was hoping that this new update would fix my Bluetooth problem and my problem of date and hour now, it seems t

  • Click satellite 10 - upgrding BIOS problem

    Hi all!I have a new toshiba satellite click on 10, but when I try to update the BIOS to 1.6 it pops up an error that says "update bios image is not valid in the current bios or flash secure does not support flash secure." What it means? How can I sol

  • HP Pavilion Touch Smart 23: computer restarts randomly during games

    So I got this computer from little more than 3 years.  It's an all-in-one PC. Ive never had any problems until a month ago, whenever I play League of Legends, my PC will go to a black screen and initialize back without error message.  Only, this happ

  • Help to reinstall Battlefield 1942

    When trying to reinstall battlefield 1942: the complete collection. first installed on "E:\. ». He sees a player who no longer exists. I deleted my temporary files and am now lost. any help would be appreciated. Battlefield 1942: the complete collect

  • Qualcomm, atheros AR9285 802.11b/g/n wifi adapter problem

    Hi, if I can connect to the internet, but after a bit, I'm disconnected from the network. When I have the Troubleshoot, it indicates that there is a problem with my card. It is not a problem with my network as all other devices work correctly. I use