How to escape the quotes when I run the .sql Unix script

Hello

I have a ddl script files...
to keep specific information from the environment, I use a placeholder $variable (for example, the names of patterns etc.)

and creating a document and say the dba this export variable = value.

Use of variable for the following cases?

CREATE DATABASE LINK "abc.ge.com".
CONNECT TO $SRC_SCHEMA_NAME
IDENTIFIED BY $SRC_SCHEMA_PWD
With the HELP of 'abc.ge.com '.


I want to create a varaiable with value abc.ge.com How can I do this from the command have single and double quotes...

Thanks and greetings
REDA

You don't need quotation marks in your CREATE DATABASE LINK statement. Just leave and forget any of this escape.

Are you sure you must export all these variables, i.e. will they be mentioned in sublayers without be passed as parameters?

Tags: Database

Similar Questions

  • How to integrate the police Segoe Script in a saved pdf file?

    When I save a file .psd in .PDF (with Photoshop elements 12), two of the three fonts do appear fine in the .pdf file, but not the third (Segoe Script).  I open the PDF with Adobe Reader XI.

    How to integrate the police Segoe Script in the .pdf file?   (Depending on the printer, it must be there.)

    Thank you.

    Yes you will not be able to use either the distorted text.

    (these kinds of properties do not appear in this font)

    If you want to tilt the text as it would be for the italicized text, you can use Image > transform > Skew.

  • How to import the .sql file in oracle apex?

    I am new to oracle apex...

    How to import the .sql file in oracle apex?

    I have to import a table in apex...

    This script I have to write in the .sql file...

    pls help...

    Published by: 794244 on January 31, 2011 21:31

    Hi Manu

    You can import and browse workshop SQL, SQL Scripts .sql files. If you have multiple SQL statements in your script, make sure that they are separated by the / character

    Andy

  • How to remove the default calc script in Web Analytics?

    Hello

    Mode of data analysis Web edition, how to show the calc custom scripts only?
    Because users might wrongly apply the script to calc default that calculates the database, some data in the parent members would be rewitten.
    I wonder if the setting is in the Essbase or not?

    Thank you.

    You can change but does not remove the default calculation in Essbase. You can use EAS, ESSCMD or MaxL to change the calculation of the default of another calculation script.

  • How to get the SQL if I get exception

    I get this exception and do not know what was the actual sql with the variables of liaison who was executed.



    sqlmesg = error in the select query to retrieve the segment associated with a pair of cables: ORA-01006: there is no bind variable

    y at - it a way to get the real sql executed so I know what mistake I did.

    I thought your question was about how to view the SQL statement and bind variables in the exception. The answer to that is to put variables in the exception message.

    The root cause of the problem seems to be that your dynamic SQL statement may require 3 or4 variable bind but your USING clause specifies always 4 values if the underlying SQL statement has 3 positions, it will lead to an error.

    Justin

  • How to escape the quotes in image.metadata.title

    Was working on a web template that uses image.metadata.title and image.metadata.description but when my user place a quote "or an apostrophe I get an error in the processing of the page html or xml I'm generation. What I would like something isg as php htmlspecialchars. I tried the following:

    String.format('%Q',image. Metadata.title) who escapes from the "------" and the apostrophe with------' but I will get in my xml

    < image title = "She said \"this isn\ ' t work------"" > "

    "Unfortunately the------" isn't escape the quote in xml, I would like to have

    < image title = "says she & quot; This n & #039; work & quot; ">

    Similarly, if my user wants to thml in the title of the image or the title I'm getting the same problem.

    It would be nice to have a function SDK for HTML quoting.  But in the meantime I think you should use string.gsub () to make your own replacements, for example

    String.gsub (s, "\ '", "'")

    You can pass an array to the third parameter, which allows you to make all necessary substitutions with call to string.gsub ().

  • How to escape the quotation mark?

    I need to move a column of link from page 1 to page 2. I found a bug in my program. When there is quotation mark in the string, the corresponding query cannot be displayed on page 2. However, by using the same query, I get the correct result in the SQL * more console. I don't know why. Because of the quotation mark? Thank you!

    Hello

    OK - I've updated my test page to include the date in the filter - [http://apex.oracle.com/pls/otn/f?p=267:126]. I added a new page element called P126_DATE for the date filter

    My SQL for the IR is now:

    SELECT
    ENAME BLAH,
    EMPNO,
    ENAME,
    HIREDATE
    FROM EMP
    WHERE HIREDATE IS NOT NULL
    

    The URL of the link is now:

    #" onclick="javascript:doLink(this, '#HIREDATE#');
    

    My javascript function is now:

    function doLink(o, d)
    {
     $x('P126_TEXT').value = o.innerHTML;
     $x('P126_DATE').value = d;
     doSubmit();
    }
    

    And SQL of the standard report is now:

    SELECT EMPNO, ENAME
    FROM EMP
    WHERE ENAME = :P126_TEXT
    AND TO_CHAR(HIREDATE,'DD/MM/YYYY') = :P126_DATE
    

    Note that the column HIREDATE on the IR has been formatted using JJ/MM/AAAA

    Everything seems to work very well.

    The only time I haven't had "no data" was when I had included all the records in the EMP and clicked on a link for a record that had no value of hiring date. Otherwise, clicking on any link meets the standard report ok. Have you tried using TO_CHAR or TO_DATE to ensure that both sides of the WHERE statement using the same type of data?

    Andy

  • How to execute the sql statement in the file beats?

    I want to execute after the statement
    C:\ > sqlplus/nolog
    SQL > conn scott/tiger
    SQL > select * from tab;

    I know I can achieve it following test.bat and testdb.sql file
    test.bat is:
    sqlplus/nolog @testdb.sql

    TestDB.SQL is:
    Conn scott/tiger
    Select * from tab;

    Now I don't want to use the sql file, I want only use bat file, as follows:
    test.bat is:
    sqlplus/nolog
    Conn scott/tiger
    Select * from tab;

    When I run test.bat, I find only one sqlplus /nolog execute statement, do not execute other statements.
    (1) I want to know if there is a method to run the SQL file by fighting without a sql file? How to make it happen?
    (2) if I call the sql file, how to hide the password of user? Because I don't want other people to know scott password, if I use conn scott/tiger in testdb.sql, other person can see testdb.sql and the password. Is there a good way to avoid?

    Thank you!

    It works a bit different in Windows. Create a file is like this:

    (
      echo conn scott/tiger@orcl
      echo spool c:\temp\list.txt
      echo select sysdate from dual;
      echo spool off
      echo exit
    ) | sqlplus -s -l /nolog
    
  • How to see the sql on the tables verified statements?

    Hi all

    I just check schema as the following comment run

    AUDIT UPDATE TABLE DELETE TABLE INSERT TABLE BY user1, user2 BY ACCESS;

    However, I could not find the SQL statements.

    SELECT A.TIMESTAMP, A.* DE DBA_AUDIT_TRAIL A

    Username = ' USER1'

    Also, this does not work, it shows empty

    select sql_text from sys. aud$ obj$ nom = « TAB_PROJELOG »


    Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    • db

      Redirect audit records to the database audit trail (the SYS.AUD$ table), except for records that are always written in the track operating system audit. Use this setting for a general database for administration.

      If the database is started in read-only mode with AUDIT_TRAIL defined on db , then affects the Oracle database internally AUDIT_TRAIL to os . Check the log of alerts for details.

    • db, extended

      Performs all the actions of AUDIT_TRAIL = db and fulfills also the bind SQL and SQL CLOB type text columns of the SYS.AUD$ table, when it is available. These two columns are filled only when specified.

      If the database is started in read-only mode with AUDIT_TRAIL defined on db, extended , then affects the Oracle database internally AUDIT_TRAIL to os . Check the log of alerts for details.

    https://docs.Oracle.com/CD/E11882_01/server.112/e40402/initparams017.htm#REFRN10006

  • How to find the sql queries executed in one day with the sql and runtime text

    Hi Experts,

    Please tell me the sql query to find out the queries executed on a particular day and the runtime and the sql text of the query.

    Please reply urgent.

    Thanks in advance

    Database instance 'A' may have run 100 SQL queries today.  As for the instance of database 'B' could have exploited queries SQL 1 million today.  Instance of database 'B' to 'keep' the 1 million SQL statements - in memory or on disk do you expect?  Of course not.  There the age or flush or invalidate memory SQL statements.  He can't keep them on the disk (imagine running a completely different set of 1.2million SQL statements tomorrow and 1.3 the next day).

    AWR and StatsPack can make counts the number of "n" top of the page ("n" default to 30) SQL statements which are still present in the cache of the library (not years, rinsed, invalidated) when a snapshot was taken.  They can't declare "all" SQL statements.

    To return to your needs.  WHY do you need all the SQL statements?  Or are there only certain operations specific SQL would you be interested?  Could they have been treated by allowing audit (for example, UPDATE and DELETE with EXTENDED verification instructions)?

    Hemant K Collette

  • How to access the table cell script plugin c labels

    Hello

    We have a plugin written in actionscript, which prepares data in labels of each cell in a row of a table, when the user has their cursor in this line:

    var: a cell = getSelectedCell();

    for each {(var childCell:Cell in cell.parentRow.cells)

    childCell.insertLabel (labelName, theString);

    }

    public function getSelectedCell (): cell

    {

    ...

    var selectedLayers:Array = doc.selection in the table;

    var selectedLayers = obj:Object [0];

    If (obj have PointInsertion! = null) {}

    var ip:InsertionPoint = obj as PointInsertion;

    If (ip.parent cell) {}

    return ip.parent as cell;

    }

    } else if (obj as cell! = null) {}

    return items as cell;

    }

    Returns a null value.

    }

    I am now writing a C plugin that needs to read data using IScriptLabel: once again, when the user has a cursor in the same row.

    My problem is that I can't find (via the C code) against that UIDRefs the labels would have been stored by the script that the table does not seem that the objects of the cell in the same way as the script only.

    Any ideas on how to get the relevant UIDRefs?

    Thank you

    I found the answer:

    1) go to SnpIterTableUseDictHier.cpp.

    (2) go to the function void SnpIterTableUseDictHier::inspectThreadDict (const InterfacePtr& textStoryThreadDict).

    (3) add this code after the line after the line InterfacePtrMyCell (textStoryThread, UseDefaultIID());

    #define Solutiontotheproblem 1

    #if Solutiontotheproblem

    InterfacePtr iscript (textStoryThread-> QueryParent (ScriptInfo::RequestContext ()), IScript::kDefaultIID);

    {if (iscript)}

    Tags IScriptLabel::ScriptLabelKeyValueList is iscript-> GetTags();.

    IScriptLabel::ScriptLabelKeyValueList:iterator iter;

    If (!) Tags.Size ())

    {

    PMString return ("no labels found.");

    returnVal.SetTranslatable (kFalse);

    }

    for (iter = tags.begin (); iter)< tags.end();="">

    {

    PMString returnVal ((*iter).) Key());

    Return +=("::");

    Return += ((*iter).) Value();

    CAlert::InformationAlert (returnVal);

    }

    }

    #endif

    (3) voila!

    Hope that helped. If your question is the answer, please mark my solution as correct

    I used this link for the answer. The main thing to find was finding what associated text interface was IScript is associated with.

  • How to get the sql query result?

    Hello

    Currently I use LV2012 to connect to an Oracle database server. After the Oracle Express and Oracle ODBC driver facilities/settings made.

    I managed to use the SQL command to query the data through my command prompt window.

    Now the problem is, how to do the same task in Labview using database connectivity tools?

    I have build a VI to query as being attached, but I have no idea of what range to use to get the result of the query.

    Please help me ~ ~

    Here is a piece of code that I use to test the SQL commands, you can use the part that retrieves the results of sql.

    It is also possible to get the rear column headers, but it's for the next lesson!

    ;-)

  • How to put the SMS PHP script on the Web site using adobe DreamWeaver

    Where should we found a site that is easy to love your HTML codes with PHP scripts to receive or send TEXT messages? [suspect URL removed by Moderator] so we saw this Web site?

    [suspect URL removed by Moderator] Talking about how to skip the check for text Messages on a Web site, but it is possible to intergrate such a script in PHP coded in a designed HTML tag or the designed Web Adobe Muse site

    You could, but my favorite workflow is to use Dreamweaver for the entire project.  Muse code is very messy work with.

    Nancy O.

  • How to format the sql format GET easily in sqlplus

    Hello
    I use TOAD to format my sql always (to help shift + ctrl + F). It's really frustrating because I have to format the sqls a lot all the time. I have recently joined a successful dba team and need to quickly understand the sqls.

    A member of the forum can you please suggest me a way to do it quickly in sqlplus itself?

    Thanks & take care,.
    Malika

    Anthony wrote:

    But there are situations where I have to work on machines where I can't access the internet because of procedures/etc security problems, that's why I need to find a way to quickly put the sqls in sqlplus/unix itself.

    SQL * Plus is not an editor does not support formatting of unformatted existing SQL code. It uses an external editor - and formatting you want to, must be a function or feature of the external editor. The Unix/Linux default editor is vi or vim. Emacs, kate and others can also be configured (using the EDITOR environment variable) for use with SQL * more.

    Formatting manual is often a 'good' thing that it forces you to slow down and look at each line (when the manual formatting) in the code. So they identify issues and problems that could be missed when looking at already formatted code.

  • How to get the sql query

    Hello

    I already set date value as below.
    SET THE VALUE OF START_TIME = 2011-08-12 09:00
    DEFINE END_TIME = 2011-08-12 10:00
    and executes the table based on the defined date as below,
    Select * from my_table
    where
    (to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS))
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS));
    ) but now I want to query the table based on the time,

    Any help please,.

    Hello

    It is not very hard in SQL * more.

    First of all, put your query in a script file, like this one, called hour_query.sql:

    --     hour_query.sql          Show data from my_table for a given time period
    
    PROMPT     The data below shows the period from &1 to &2
    PROMPT
    
    SELECT     *
    FROM     my_table
    WHERE     accounting_start_time     <= '&2'
    AND     '&1'               <= accounting_stop_time
    ;
    

    Parameters & 1 and & 2 are beginning and end of time, for example "2011-08-12 09:00".
    Note that this does not use TO_DATE. If you have incorrect strings in columns that must be DATEs, no errors occur.

    Assuming that hour_query.sql is located on p:\some_dir\, you want another script that runs hour_query.sql 24 times, like this one, which I will call all_hours.sql:

    @p:\some_dir\hour_query  "2011-08-12 09:00:00"  "2011-08-12 10:00:00"
    @p:\some_dir\hour_query  "2011-08-12 10:00:00"  "2011-08-12 11:00:00"
    @p:\some_dir\hour_query  "2011-08-12 11:00:00"  "2011-08-12 12:00:00"
    ...
    

    (I just did 3 hours to test. You can easily make that 24 hours).

    The following code creates and then runs all_hours.sql:

    -- Turn off SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    SET     VERIFY          OFF
    
    -- Write all_hours.sql
    SPOOL     p:\&some_dir\all_hours.sql
    
    WITH     got_start_time     AS
    (
         SELECT TO_DATE ( '2011-08-12 09:00:00'
                            , 'YYYY-MM-DD HH24:MI:SS'
                     ) AS start_time
         FROM    dual
    )
    SELECT     '@p:\some_dir\hour_query  "'
        ||  TO_CHAR ( start_time + ((LEVEL - 1) / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"  "'
        ||  TO_CHAR ( start_time + ( LEVEL      / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"'
    FROM    got_start_time
    CONNECT BY     LEVEL <= 3     -- You can make this 24, or any other number
    ;
    
    SPOOL     OFF
    
    -- Turn on SQL*Plus features turned off earlier
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Except VERIFY.  leave that OFF while all_hours runs
    --SET     VERIFY          OFF
    
    -- Run all_hours.sql
    @p:\some_dir\all_hours.sql
    
    SET     VERIFY     ON
    

Maybe you are looking for

  • Pavilion DM1: Failure of HD

    I have run the test BIOS HD and get Smart Check: PAST DST short: FAILURE FAILURE ID: RGDXHG-5S27LC-FEHV4K-60TE03 PRODUCT ID: LY997LA #AC4 1 hard disk What is the problem, does anyone know? Need a new HD? THX

  • Cannot close the nori.exe

    My computer wouldn close and a message came that said 'nori.exe couldn t close' and me gave options to end now or cancel, I pressed the end now and the message disappeared, but stayed on the screen with no icons on the desktop wallpaper.  I had to re

  • How to fix file missing or damaged NTLDR in WINDOWS Vista Home Basic

    I tried to start windows from CD/DVD, but did not, so I tried to go in the Advanced Start menu options, but then also omitted to do. Please help how to repair these files. If we can repair it by command promt then mention.

  • A5000. Notification menu

    I can't find the menu of notification displayed on the lock screen. http://postimg.org/image/f64guul7r/

  • BSOD Internal_Data_Inpage_error W764bit

    Any suggestions? Questions began to appear after I installed a new GPU (GTX970 of Radeon 7700). I uninstalled the drivers for the Radeon before hand. During the game, Grand Theft Auto 5, on the new GPU the game crashed. After experimenting I notice I