SQL in pl/sql and create the duplicate RMAN script.

Hello

I'm new to pl/sql and I am trying to write a script that will generate RMAN commands to make a clone of database.

I want to be able to run the script, and he invited me to the variables to be used in the script.

I did some research but I have been unable to find examples of how to proceed.

Basic script is (it would be obviously a lot more to the final script):

declare

dbname varchar2 (9): = & dbname;

BEGIN
DBMS_OUTPUT. ENABLE (2000);
DBMS_OUTPUT. Put_line (' DUPLICATE TARGET DATABASE to ' | dbname |) ';') ;
end;
/

Makes me:

Enter the value of dbname: ORCL4
old 3: dbname varchar2 (9): = & dbname;
new 3: dbname varchar2 (9): = ORCL4;
dbname varchar2 (9): = ORCL4;
*
ERROR at line 3:
ORA-06550: line 3, column 24:
PLS-00201: identifier 'ORCL4' must be declared.
ORA-06550: line 3, column 9:
PL/SQL: Ignored Element
ORA-06550: line 7, column 66:
PLS-00320: the declaration of the type of the expression is incomplete or incorrect
ORA-06550: line 7, column 9:
PL/SQL: Statement ignored

Thank you
Tom.

Hi, Tom.

When SQL * more variable substitution resolves, it puts the string you gave as value (ORCL4 for example) instead of the string representing the name (& dbname, for example). East exaclty what you could do using the Replace function in a text editor: nothing more.
After SQL * more substituted for these channels, it send s the text changed the database to be compiled. So, where you coded:

dbname varchar2(9) := &dbname;

is that it sends to compile

dbname varchar2(9) := ORCL4;

in other words, it looks like a variable on the side right of the: = sign.

You must provide quotes:

dbname varchar2(9) := '&dbname';

Tags: Database

Similar Questions

  • How to insert image from mysql into the table using php and create the checkbox in the table?

    How can I insert image from mysql into the table using php and create the checkbox for each data as a vote? Here is my code...

    WELCOME

    connect_error) {die ("connection failed:".)} $conn-> connect_error); } $sql = "SELECT no, Calon, ID, of course, the Image OF THE candidates." $result = $conn-> Query; If ($resultat-> num_rows > 0) {echo ' '; export data of each line while ($row = $result-> fetch_assoc()) {"echo"}}
    NO Candidate INFO Vote
    " . $row ["no"]. "-" . $row ["Calon"]. "
    -" . $row ['ID']. "
    -" . $row ['class']. "
    "; } ECHO ' ' ;} else {echo '0 results' ;} $conn-> close();?} >

    hope someone can help me because I am a newbie in this program... need to finish this project... Thank you.

    If you have saved the file name in the database, it's pretty simple.

    echo '' . $row['description'] . '';
    

    Is the same for the box:

    echo '';
    

    If you have saved the image file in the database, it is much more complicated. I recommend you store only the file name in the database.

  • I am looking for an app to download which will find and delete the duplicate on my computer... If anyone can help...

    No good on this side of the computer... Computer works more slowly not as sharp as it was, I found a lot of files and duplicate files on it. Not understand or trust myself to remove anything manually.

    You might like to try these. Read their comments/user opinions 1-links provided:

    http://www.SnapFiles.com/reviews/CloneSpy/CloneSpy.html

    CloneSpy can help you recover hard disk space by detecting and removing duplicate files. It can find files that have the same exact content, regardless of their name, the date, time and location. CloneSpy is also able to search for files that are not identical, but have the same file name, allowing you to find and remove old versions of a file. Once the scan is completed, you can decide what you want to do with the found duplicates, CloneSpy you shows the details for each file (and its duplicate proposed) and allows to keep, move or delete.

    http://www.SnapFiles.com/reviews/duplicate-cleaner/duplicatecleaner.html

    Duplicate Cleaner is an easy to use program that helps you find and remove the duplicate computer files. You can search several structures of files at a time and set of criteria to identify duplicates. You can choose to search exact matches using the comparison of CRC or use the file name, size and date as the criterion. The program offers extended support for music files, allowing you to use the tag information ID (artist, title, album) to identify duplicate titles. The results are grouped together in a list and a selection wizard allows you to select quickly the files based on age, the audio quality, location and other aspects.

    See you soon.

    Mick Murphy - Microsoft partner

  • Facebook like button does not work, I used the widget of muse and created the facebook code. Anyone know how to make this work?

    Facebook like button does not work, I used the widget of muse and created the facebook code. Anyone know how to make this work?

    Hi connally25,

    Here is a link to a video tutorial on how to add a Facebook button, please check if you have followed the same steps to add the video.

    http://TV.Adobe.com/watch/learn-Adobe-Muse-CC/adding-a-Facebook-like-button/

    If you followed the steps correctly and the button still does not; Here is a link to a forum thread which may help to solve the problem:

    Facebook follow Widget does not

    Concerning

    Sonam

  • How to run SQL and export the results to Excel

    My task is to run a custom SQL script and create an Excel file through SQL Developer running from the command line (called by a scheduled script). Is this possible using SQL Developer?

    First, the thing I will try is to run a report user-defined in SQL Developer and save the results in an Excel file. Only 16000 result lines, but took 10 minutes to do the export and still cannot complete. Is there another way to do it?

    Thank you very much.

    Can't be done, but this is requested already exchanging SQL Developer, you can vote here and add weight to the possible future implementation.

    Kind regards
    K.

  • Workshop SQL-> Tables-> create the Lookup Table

    It is perhaps a SQL issue rather than an issue of Apex, but...

    With my experience of amateur to create database tables, I usually start with a parent table and create children and link them.

    While playing with Apex, I have the ability to create a Lookup Table of in any table.

    And, what is created is a new table that is, indeed, a parent.
    So I have been working from the bottom to the top.

    I understand that correctly?

    Thank you-
    Marion

    Marion...

    Yes...

    Lookup tables store data from reference and a link to your main table with a standard primary/foreign key relationship.

    This feature is particularly useful if you are creating your tables of data in the worksheet and you want to standardize it.
    Gus...

  • How to display ONLY the photos on my hard drive and remove the duplicates it.

    I bought Photo Sweeper but have heard warnings of ' reference fileis and the risk of the original photo, sitting on the hard drive.  .  Is there a way to see ONLY photos on the hard drive and use Photo Sweeper here?

    Background: on my HP PC for years, I've created folders for each Member of our family.  Thus, a paper copy of each group photo were regularly filed in each issue of people pictured in it.  Migration to iPhoto and iMac five years ago, all copies of the same photo were transferred on my Mac.  More recently, I've migrated my iPhotos library of Photos.  I would like to clarify these multiple copies to a hard copy, but I feel of the complications and risks. In particular, the integrity of all the projects I did (for example attach a photo to the album, a book or a slide show) could be compromised if I happen to remove the copy special paper which refers to this picture (the correct term?).

    It seems to me that, if I could see the actual photos on the hard drive and use the double Finder here, I could get the job done.  I could combine that info (faces, keywords, descriptions) that I added on a large number of copies and sign him for a single copy and then to eliminate duplicates. Would this work?   Back to a project, I could see a photo with a warning icon, a yellow triangle with an exclamation point inside, which indicates the hard drive file to which he referred is now defunct.  I could (I guess I could, but how!) change things to make this photo point to rest a copy on the hard disk, couldn't I?

    Tips appreciated.  The notice are maybe just don't not to alter my photo library, but it says that I have almost 30 000 photos. I know this isn't so.   Thank you.

    Your question is not clear

    What Version of the operating system and Photos you have? You have a referenced library or a managed library? What specific "warnings" topic referenced b = files you are?

    Please explain what you have and what is your concern

    LN

  • How can I copy a sequence and all the duplicate items?

    I make a film of learning with key issues such as text captions.

    Legend sequences consist of:

    Text that are animated independently for two titles appear one after the other, then both remain on the screen.

    Matte colour background

    A logo

    There are therefore 4 clips in each caption.

    I created each one as a separate sequence using duplicate

    So far so good.

    When I then change the text to sequence 02 it changes in all other cases.

    What I want to do is to reproduce a sequence AND all the elements in it so that the new titles are created.

    This seems very basic - can it be done?

    Create a title based on the title currently titration and then replace the old with the new title:

    Create a title based on the current title

    • In the Titler, open or select the title that you want to base a new title.

    • In the title quick properties panel, click new title based on current title .

    • In the new dialog box title, enter a name for the new title, and click OK.

    • Change the title as you want.

    • Close the module titration or save project to save the title.
      from there:

  • Identify and purge the duplicate files

    I'm running out of storage space. When I look at My Documents & Settings it seems that there is a lot of duplicates and files. Is there a process to identify duplicate files and purge them in Window XP?

    http://www.SnapFiles.com/reviews/AllDup/AllDup.html

    AllDup allows you to find the files duplicated on one or several folders or drives. You can choose to match files by size, date, attributes and content comparison byte by byte and also various settings to exclude certain file types or the search folders. AllDup then analyze selected records and produce a list of all files duplicate was found. The list is organized into groups, which makes it easy to manage results and process the files. You can manually select the files that you consider to be duplicates, or you can use the options of Intelligent selection that allows you to automatically select the files based on their date or folder. Duplicate files can be processed in different ways, you can choose to delete, move or copy them to a different folder or rename them in their current location. Other features include export search results, customized search profiles, a built-in file extract, ID3 tags support and more.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://www.SnapFiles.com/reviews/Auslogics-duplicate-file-Finder/ausdupe.html

    Auslogics Duplicate File Finder helps you to find duplicate files that are likely to be scattered all over your hard drive. The program can compare files based on size, date, content and name. You can select several folders (with Sub-folders) or an entire drive to analyse, specify the methods used to determine the files double and then view the results list and delete files that you no longer need.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    XP forums:

    http://social.answers.Microsoft.com/forums/en-us/category/WindowsXP

    Link above is for XP Forums.

    There is a list of the different Forums XP to the link above to help you.

    You get the help you need there.

    Here is the Vista Forums.

    See you soon

    Mick Murphy - Microsoft partner

  • Cannot see and create the idea of ORACLE Community

    Hello

    at present, it is impossible to see an idea of the ORACLE Community and create an idea. Why is that?

    Cleaned OTN at Oracle OpenWorld

    Monitored

  • Credit application note standard invoices unpaired and creating the correct payment for the invoice of the supplier adjusted.

    Hi, need opinion and expert advice. The user has created the standard bill without PO match for $100. Provider later introduced the debit note for $5 against that standard bill to correct the price gap. By paying the standard invoice is everything possible to pay $95 to the provider without manually select the credit memo. I mean can system automatically get the related credit memo in order to reduce the payment to the supplier $ 5. Please advice. Thank you

    Hello

    Below the document has the correct explanation to solve this doubt.

    See Doc ID 1199793.1

  • Bug report: save changes to geometry on Mac is broken (.) Fuse and create the preset of the agenda)

    As I mentioned previously, save changes to the geometry in a file .fuse on Mac did not work for hair and beard with a Brute and MaleFit of mounting configurations.

    Create predefined element and save the item selected in the form of preset are also similarly broken when you try to save changes to the geometry.

    Any chance your engineers can provide an ETA on a fix for this as not being is not in a position to save his work is a very big problem?

    Mac OSX 10.10.5, fuse CC Preview

    As a work-around, I was hoping I could use 'Save selected item as new preset catalogue' (star icon) or create predefined element (menu).  Nope it's broken as well.

    No need to post pictures since you can test it in 30 seconds approximately:

    1. Choose default values of the Assembly MaleFit

    2. Choose hair (braid, step back... "I don't think it's important), change the geometry, 'Save as a preset point them' (the star icon) or 'Create predefined item' in the menu.

    3. Notes the thumbnail to your newly named item does not show changes.  Choose your preset mods and newly appointed geometry are lost and were not saved.

    4. save modded point character for. FUSE file. Reload.  All mods geometry are lost.

    Repeat for the gloves.

    Thank you

    Allan

    Able to reproduce on the Brute!  Has made a few turns and looks like for example, much cannot be edited/saved on the Brute, but can be has made male.

    I have connected this bug for fixing!

  • Using the API to connect and create the user

    I currently have only the trial for Adobe Acrobat Connect Pro, but I saw on another debate that I should have the full functionality of the API.  I have problems with the record as an administrator and creating a user.  My response xml does not match what the documentation says I should get.  When I try to log in I get status code = 'ok', but when I try to create a new user I have status not available to the code.  However, this user is an administrator.

    Call the #1:

    https://meetxxxxxxxx.adobeconnect.com/API/XML?domain=meetxxxxxxxx.adobeconnect.com & action = common-info

    Result:

    <? XML version = "1.0" encoding = "utf-8"? >

    < results > < status code = 'ok' / > < local commune = "in" time-zone-id = "85" time-zone-java-id = "UTC" > < cookies > na8breez8mky3nb7tvvda8tn < / cookie > < date > 2013-05-07T 00:35:2 7,610 + 00:00 < / date > < host > https://meetxxxxxxxx.adobeconnect.com < / host > < localhost > pcpna8app04 < / local-host > < admin-host > na8cps.adobeconnect.com < / admin-host > < url > /api/xml?domain=meetxxxxxxxx.adobeconnect.com & amp; action = common-info < / url > < version9 >. 0.4 < / version > < tos-version > 7.5 < / tos-version > < true reviews-product > < / product-notice on > < account account id = "xxxxxxxxxx" / > < / common > < reg-user > < East - reg > - false < / East-reg-user > < / reg-user > < / results >

    Call the #2:

    https://meetxxxxxxxx.adobeconnect.com/API/XML?domain=meetxxxxxxxx.adobeconnect.com & session = na8breez8mky3nb7tvvda8tn & action = login & login=admin%40test.com & password = mypw123

    Result:

    <? XML version = "1.0" encoding = "utf-8"? >

    < results > < status code = 'ok' / > < / results >

    Call the #3:

    https://meetxxxxxxxx.adobeconnect.com/API/XML?domain=meetxxxxxxxx.adobeconnect.com & session = na8breez8mky3nb7tvvda8tn & action = principal-update & name = newUser & last-name = - & login = new User%test.com & password = test1234 & type = user & send-email = false & has-children = 0 and email newUser % you st.com

    Result:

    <? XML version = "1.0" encoding = "utf-8"? >

    < results > < status code = subcode "lack of access" = "no-login" / > < / results >

    Looks like you do things out of order. You should start with the login call (#2) and then use the common-info call (#1) to get your session cookie id. It may be that you are using an invalid session cookie on before you connected.

    In addition, you have a lot of extra things to your calls. You don't need the field = value xxx. Clearly explained in the documentation here (http://help.adobe.com/en_US/connect/9.0/webservices/WS5b3ccc516d4fbf351e63e3d11a171ddf77-7 ff5_SP1.html).

  • Beginner Flash... Insert SWF into the web page and create the 'play' button

    I try inserting and SWF in my Web page.  I have 3 problems, 1. I'm new to Flash and are not at all good at it yet. 2. how to say stop at the end of the sequence and insert a new button "play"?  3. what should I do to put on my Web page.

    I know that these aren't the answers Yes or no, if I appreciate even to pronounce on the best way to learn Flash for me.

    2. it can depend, but ENCs, you are probably using the timeline, very probably, that you just need to put a stop(); command in the last image to stop at the end.

    To play again, your power button code must understand something like: gotoAndPlay (1);

    How the button code is depends on which version of Actionscript using your file.

    3. When you publish your swf file, I also Flash publish an html file (configure you publishing settings).  You can then take this html file and copy the embed code that it contains your page file html web.  You will have to perhaps include a javascript file, as well to make it work, and you can say that looking at the head of the HTML code Flash created... that code head must also go to your page file web html and the javascript file must be placed according to how your html code targets there.

    You might do better just to get the html page that Flash creates working first for you.  He could find how to move into your web page more easy.

    My opinion: the best way to learn Flash for yourself is to simply dig in and keep him home.  You will lose hair, sleep and your mind as you will, but eventually, you get used to that or you defeat.

  • Create bookmark and set the Page Destination Script

    Greetings,

    I created a batch Script that will create children bookmarks and set the destination page.

    Bookmarks are listed in the script in the order in which they appear in ascending order.  (for example, Name1, name2, Name3, name4)

    However, once the script is run, the bookmarks are inserted in descending order. for example (Name3, name4, Name1, name2).

    Can someone advise please how do I get the script to create bookmarks in ascending order, as noted in the script?

    var bm =
    this.bookmarkRoot.createChild ("Name1", "this.pageNum = 0");
    this.bookmarkRoot.createChild ("Name2", "this.pageNum = 1");
    this.bookmarkRoot.createChild ("Name3", "this.pageNum = 2");
    this.bookmarkRoot.createChild ("Conjoint4", "this.pageNum = 3");

    var bm = this.bookmarkRoot.children [0];

    BM. Color = color.red;

    The script should also be changed to all bookmarks in red color.  The script for color bookmarks only works on the first bookmark.  Any intervention on changing the script for this would be most appreciated as well?

    Thank you.

    Use something like this:

    var bm;

    this.bookmarkRoot.createChild ("Bill Smith","this.pageNum = 0", 0);

    BM = this.bookmarkRoot.children [0];

    BM. Color = color.red;

    this.bookmarkRoot.createChild ("David Smith", "this.pageNum = 1", 1 ");

    BM = this.bookmarkRoot.children [1];

    BM. Color = color.red;

Maybe you are looking for

  • Pavilion dv6-6190us: driver missing

    I have a pilot missing in the section "other devices." I tried to uppdate it automatically, but without success. PLS, can anyone help me.

  • Usage of the language issue

    I just bought an Officejet 4500 G510n wireless printer.  When the set up I accidentally chose the wrong language (I think) Spanish instead of English. I tried for awhile now to rectify my error, but without success. Can anyone help? -I apologize in a

  • How can I uninstall the voice recognition software

    Speech recognition program is the source of the problems.  I would like to uninstall it.  Could you help me with this?

  • RE1000 lowers my wifi

    I bought a RE1000 extend you my wifi signal, but when I have it configured, it works wel for about 30 min and then the connection is weak, and his put the signal router down. Then al user can no longer use the wifi. So I thought the original was low,

  • Transfer ALL a W7 HD to a new system

    Replacement of a window broken on a favorite DELL Studio has led to failure in which the screen went out of control, with nothing but colorful graphic gibberish and uncertainty on my part as to if the event reports just a display or a motherboard fai