Scripts and Procedures

Hello,
I don't know if this question is appropriate for this forum,
but how do you execute a sql procedure within a shell script and how to use pass the variables that are contained in your script to your procedure?

fqman wrote:
what are the &1 and &2 parameters?&1 and &2 are the parameters when you are using sqlplus
like sqlplus script.sql parameter_one parameter_2
Inside your script.sql you will refer these parameters as
&1 and &2
But for sh scripts you have to refer these as $1 and $2
SS
http://db-oracl.blogspot.com

Similar Messages

  • How to restore views and procedures after drop user command?

    How to restore views and procedures after drop user command?
    We have 817 EE on NT and one developer created a lot of procedures, functions and vews. DB was not backuped and archived and export has not been done - our fault and we understand it. Sorry for this.
    Ok, now the story: another developer dropped this db user and we lost everything: procedures, functions and vews. The new user with trhe same name was created and new schema was imported in this user, but all old objects are lost. We don't have export and backup and archive log files.
    Question: may we can restore this lost stuff from some other sources. We are looking for lost codes, not data. May be we can use redo logs or shared pool or any other things. Any idea will be appreciated.
    Thanks.
    Victor
    [email protected]

    The switch has occurred after user was dropped, the data has been overwritten and there is be no way to use redo log files.
    I would like to explore another opportunity. Is possible to use Shared Pool or any Data Dictionary internal information to restore texts of the lost SQL and PL/SQL scripts executed in this DB before user was dropped? Not too many scripts are executed in this DB and the lost ones may still be in stack. I remember that Shared Pool (cash) should keep last executed scripts in order to improve performance. They probably are kept in some special format. Can we restore these scripts? Of course they also might be pushed out by Import that had been done after user was dropped.
    Thanks for your help,
    Victor

  • Difference jb/w text symblosin script and standard text in scripts

    hi to all
    can u pols explain about the
    difference b/w text symblos in script and standard text in scripts

    hi
    Default paragraph Paragraph set to * in <b>standard text</b> maintenance
    If no form has been assigned to a text, the system automatically assigns the form SYSTEM, which contains minimal definitions for text formatting. There are two ways of formatting texts using forms: • Use the <b>standard text</b> maintenance to enter and print the text.
    Any kind of text can be included in a form. If no object is specified, then TEXT will be used (<b>standard texts</b>).
    <b>
    Text Symbols</b>
    Text symbols acquire their values as a result of explicit assignment. To interactively assign text symbols, in the text editor choose Include &#61614; Symbols &#61614; Text. This method is available for all text symbols belonging to a text module as well as those of the associated form. Values defined in this way are lost when the transaction is left. If you want to print the text module again, then you must enter the symbol values again. The purpose of the DEFINE command is to provide a means of making this value assignment a permanent part of the text, so that the values are available again when the text module is called again. This command can also be used to re-assign a new value to a text symbol half-way through the text. Syntax: /: DEFINE &symbol_name& = 'value'
    /: DEFINE &subject& = 'Your letter of 7/3/95' The value assigned can have a maximal length of 60 characters. It may itself contain other symbols. A symbol contained within the value assigned to another symbol is not replaced with its own value at the point at which the DEFINE command is executed. Rather, this replacement is made when the symbol defined in the DEFINE command is called in the text.
    /: DEFINE &symbol1& = 'mail' /: DEFINE &symbol2& = 'SAP&symbol1&' /: DEFINE &symbol1& = 'script' &symbol2& -> SAPscript If, however, the DEFINE command is written using the ':=' character rather than the '=' character, then any symbol contained within the value being assigned is replaced immediately with its current value. The assignment to the target symbol is made only after all symbols in the value string are replaced with their values. The total length of the value string may not exceed 80 characters. The target symbol must be a text symbol, as before.
    /: DEFINE &symbol1& = 'mail' /: DEFINE &symbol2& := 'SAP&symbol1&' /: DEFINE &symbol1& = 'script' &symbol2& -> SAPmail
    Inserting <b>Text Symbols</b>
    Procedure
    Inserting a Text Symbol
    1. Choose Insert &#8594; Symbols &#8594; Text.
    2. Place the cursor on the desired text symbol.
    3. Choose Choose.
    4. The system inserts the text symbol.
    Editing the Value of a Text Symbol
    1. Choose Insert &#8594; Symbols &#8594; Text.
    2. Choose Edit value bearbeiten. The dialog window Value definition for symbol <text symbol> appears.
    3. Enter the appropriate value definition.
    4. Choose Continue. In the dialog window Text symbols the specified value appears after the name of the text symbol.
    5. Choose Continue.
    Deleting all Text Symbol Values
    1. Choose Insert &#8594; Symbols &#8594; Text.
    2. Choose Delete all values. The system deletes all defined values.
    3. Choose Continue.
    Using Formatting Options for Text Symbols
    1. Choose Insert &#8594; Symbols &#8594; Text.
    2. Choose Options. The dialog window Formatting options for <text symbol> appears.
    3. Fill in the fields.
    4. Choose Continue.
    5. Choose Continue. The system executes the selected formatting option.
    regards
    ravish
    <b>plz reward points if helpful</b>

  • Regarding SAP Scripts and SF

    Hi Experts,
    What is the procedure we have to follow to transfer the scripts and smartforms once created ?
    Regards
    Raghavendra.D.S

    Hi,
       Nothing to take care about this, the only thing is if the script or smartform has any standard texts, even if you save those, they are not saved under any request. So what you can do, execute the program 'RSTXTRAN' and add standard text to the corresponding script or smartform request.
    Rgds,
    Bujji

  • SubVersion in SQL Developer - how to link to packages and procedures

    My question is this - I am starting out using SubVersion in Oracle and it seems pretty straightforward to use as a source control for files that are stored in a Windows directory, that is the only way I have used it so far.
    Am I able to use it to control packages and procedures that I have saved as part of my database, ie the procedures are part of a package and the package appears within the Packages section of the appropriate connection in SQL Developer.
    I hope this makes sense.
    Cheers,
    JabJam

    Hi JabJam,
    So far, everyone is correct. SQL Developer just uses a file-based source control system (e.g., SVN), which means updating database object definitions via scripts under version control, or somehow exporting the new definition to a script so it can be version controlled after the fact. And wouldn't it be nice if the database objects could be version controlled directly. With the database developer having control over when any changes are committed for shared use in the database. Similar to using the SVN plug-in for an IDE like Eclipse for a given programming language in a shared development environment.
    But what would your DBA have to say about that? Don't most DBAs require scripts for deploying code or structural changes?
    In Oracle, definitions (DDL) are committed automatically. Anyone granted access sees them. Since you probably don't do development directly against a production database, eventually scripts (either manual or generated) will be needed for deployment to QA or production. Few mechanisms currently exist to work against an active database without other authorized users also seeing these changes.
    For DDL, the closest thing would be the fairly recent edition-based redefinition feature in 11g (R2, I think). For DML, the OWM (Oracle Workspace Management) feature would be loosely analogous.
    This is not a simple issue. Version control via an extension for Subversion provides essential basic support. Going beyond that might mean watching the evolution of edition-based redefinition, but DBAs would probably require scripts for that too.
    Regards,
    Gary
    SQL Developer Team

  • Problem using script stored procedure as using EXEC dbo.sp_executesql

    When I use the Script Stored Procedure AS Create or Drop And Create I want to get the stored procedure returned like in 2008 some how I have missed a setting and I am getting it like this.  I get the sp_executesql instead of just the create procedure
    and if I use a single quote it encloses them in single quotes.  Can some one please give me the setting I can't find it?
    IF
    NOTEXISTS(SELECT*FROMsys.objectsWHEREobject_id=OBJECT_ID(N'[dbo].[usp_record_count]')ANDtypein(N'P',N'PC'))
    BEGIN
    EXEC
    dbo.sp_executesql@statement
    =N'--DECLARE
    @tablename AS sysname;
    --SET @tablename = ''[Production].[Product]''
    CREATE PROCEDURE [dbo].[usp_record_count]
    (@tablename sysname)
    AS
    BEGIN
    SET NOCOUNT OFF
    EXECUTE (''SELECT COUNT(*) FROM '' + @tablename)
    END
    END
    Thank you for you help!!!!
    Antonio

    If you have Include IF NOT EXISTS clause
    to TRUE
    then SQL wraps
    the script in a sp_executesql statement no matter how you generate the script including above cases. To get rid of SQL wraps
    the sp_executesql statement need to set it to FALSE.
    AFAIK only alternative is to use
    sp_helptext 'proc_name'
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • How to transport scripts and smartforms layouts

    Hi All,
              would you let me know how to trasport scripts and smartform along with layouts???
    thanks in advance for your replies.
    Regards,
    Riyaz

    SAP Script Form
    If you want to copy the forms between clients on the same system (between a client 100 and 150 on a DEV box for example) Use the copy between clients option available from the Utilities menu of SE71. If you want to transport the form between DEV & QA or QA & PRD then follow the normal transport
    procedure (ensuring that your BASIS team know to import your form into each client of the new box).
    Regarding the Print Program, follow the standard procedure for normal ABAP Objects. Do SCC1 for transfer between clients on same system and normal transport procedure to different system.
    SMART FORMS
    A Smartform is transported no differently than any other object. if it is assigned to a development class that is atteched to a transport layer, it will be transported. 
    The definition is transported, and when called, the function module is regenerated. 
    This leads to an interetsing situation. On the new machine, it is very likely the function module name will be different than the name on the source system. Make sure, before you call the function module, you resolve the external name to the internal name using the 'SSF_FUNCTION_MODULE_NAME' function module. 
    Typically, generate the SF, then use the pattern to being in the interface. Then change the call function to use the name you get back from the above function module. 
    Hope this helps.
    Vinodh Balakrishnan

  • How to find out existing Reports and sap scripts and smartforms ?

    Dear Friends ,
    How to find out existing Reports and sap scripts and smartforms ?
    ( e.g: how many existing reports and SAP scripts are available in MM or SD module , What is the procedure to find out ? )
    Thanking you.
    Regards,
    Subash.

    scripts r stored in TNAPR TABLES

  • What is the diff b/w Sap Scripts and Smart Forms

    Hi,
          Whats the diff b/w SAP Scripts and Smart Forms..
             I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st  and SIMILARLY FOR SMARTFORMS WHETHER FM'S  R FORMS.
    Thanks & Regards,
    Gopi.

    Hi
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Regards,
    Swathi.

  • Mail attachment: difference between script and app bundle?

    Hiya Folks,
    I am trying to make an application in Applescript that will receive a file, then create a new email (in Mail.app) with that file attached. I would prefer it to be an app, rather than a script when it's finished. I have a script that appears to work.
    This simple script will put up a Choose File window asking for a file, then bring Mail to the front and create a new message, with the selected file attached (it won't send it). For debugging, I made a dialog box pop up showing the path to the file selected:
    -- begin script
    set OpenedFile to choose file
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    -- end script
    So I tried to make that into an app onto which I could drag n drop a file, and have Mail make a new message with that file attached. Try saving this following script as an Application or an Application Bundle:
    -- begin script
    on open OpenedFile
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    end open
    -- end script
    Run the first script as a script, and it works as advertised. Drag a file onto the second script saved as an app, and the message is created, but no attachment.
    Note that the path displayed in the pop-up is the same for both scripts.
    Anybody know what I'm doing wrong?
    Thanks for your help,
    Drewstre

    on open (dragged_items)
    my handleFiles(draggeditems) -- Send selected items to custom handler.
    end open
    on handleFiles(localItems)
    tell application "Mail" -- Use terms of 'Mail'
    activate -- Launch 'Mail'.
    -- Add text to 'Subject' and 'Message' fields.
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage -- Set focus to 'newMessage'
    set visible to true -- Make message visible.
    repeat with i in local_Items -- Cycle through the dragged items, adding each to new message.
    tell content to make new attachment with properties {file name:i} at after the last paragraph
    end repeat
    end tell
    end tell
    end handle_Files
      Mac OS X (10.4.4)  

  • I am trying to load a 2006 package in cd form onto my apple mac when I try and down load it it comes up in like foreign script, and says does not operate dos, can anyone help I am a lot of a novice. grateful - Carol

    Yes Im a lot of a novice so be patient with me lol I am trying to put a 2006 Edition of a weight programme on my laptop, but when I down load it it just comes up in weird script and says cannot operate in Dos mode can anyone help.
    Thanks

    Welcome to Apple Support Communities.
    Sounds like you have a program designed to run on Microsoft Windows, or even older (1980's) MS-DOS, rather than Mac OS X. If you have Windows on your Mac installed via Boot Camp, try booting into Windows first, and then loading the CD.  If you don't have Windows, it's probably cheaper to buy a new program designed for Mac than to purchase a copy of Windows (US$120 or more), not even knowing for certain if your old program will run.

  • How to change the Default login script and the USER login script in Netware3.12

    I need to cut down the disk map from Neware 3.12 in Win98 client's PC.
    please tell me
    how to change the Default login script and the USER login script in
    Netware3.12 ?
    Or is there any other ways to do this thing?
    Thanks a lot!

    On 4/6/2006 [email protected] wrote:
    > how to change the Default login script and the USER login script in
    > Netware3.12 ?
    Please repost in the discontinued.forums.
    Edison Ortiz
    Novell Product Support Forum SysOp
    (No Email Support, Thanks !)

  • Downloading 4.0 onto XP it takes a long conection process, with boxes on unresponsive script and a java scipt app saying type error and is all very annoying so what can I do I want the old firefox back a

    I downloaded Firefox 4.0 replacing an earlier Firefox version. I have XP on my computer. When I now click on the Firefox icon after a time a window saying Unresponsive script and underneath script chrome etc comes up. I then press stop script and another window comes up Java Script application and type error. Eventually I get on to the internet but it's all very frustrating. I wish I had ignored the request to download 4.0
    Please help

    I can assure you that the sympton is indeed identical. For as the computer got worse, eventually it refused to start up and made 3 beeps. It has done this before, but today more times than before (just like when it first had this problem). Where-ever you go on the internet, it will tell you that the 3 beeps suggest the RAM is at fault. So, the same 3 beeps, means the same problem, which is the RAM.
    With that in mind, I re-ask my question with the same reasoning and justification; am I still covered under warranty? (Reasoning/Justification: Considering the original problem was not entirely fixed, though something else was to make the MacBook Pro last a little longer before the reoccurance of this problem).

  • When trying to creat a desktop icon, it does not go to the URL.....instead I get 'script' and not a website......the script has http//etc but I am not directed to the website......I previously had IE 8 (on Vista).....is that the problem...

    Question
    When trying to create a desktop icon, it does not go to the URL.....instead I get 'script' and not a website......the script has http//etc but I am not directed to the website......I previously had IE 8 (on Vista).....is that the problem?I do not have any installed plugins....at least none that I know of.....remember I am a new user......Basically, the desktop icon is not going directly to the Mozilla FF to get me to the web site I need to go to.....FF works when I use the Mozilla FF icon.....just not the icons I create.....THANKS!!! I have also tried reinstalling FF and get the same results.....HELP!!!

    The address beginning with file:/// denotes a saved file (local file). The file may not be present. You can try dragging the site icon of this page on the left edge of the location (Address) bar and release it on the desktop. Please try opening it. If it still shows an error it could be a problem with the system's zone permissions. You can try setting each zone in the Windows Control Panel or IE > '''Internet Options''' > '''Security''' tab to '''Default Level'''.

  • Ho to find script and the related print program for print preview of PO

    Hi All,
    We are getting some text output on the print preview of a purchase order.
    How can we determine the driver script and the corresponding print program for this.
    Can you please guide on this.
    Thanks in advance.
    Regards,
    Sanjeet

    U Can check Driver program and form related to that program table is TNAPPR
    Goto NACE t.code
    Selct Application ---> click on output types
    then u wil get one window there select proper output type and
    double click on  processing  routines u wil get form name and related driver program name also
    Plz try this....
    Edited by: Upender Verma on Feb 9, 2009 1:33 PM
    Edited by: Upender Verma on Feb 9, 2009 1:37 PM

Maybe you are looking for

  • Family Share and blocking purchases

    Why has apple decided that 14 and older is an appropriate age for me to give my child access to my credit card?  Shouldn't I have the option to turn on purchase request for any family member, at any age, if it is my credit card on the line?   I would

  • Terms and Conditions in pdf output but not printing

    Hello all, I had this similar issue with my cover letter, but I could move the call to xml control file and that resolved the issue. But with T&C, I need to print them on back of every page and I've used the logic from Tim's blog (http://blogs.oracle

  • Is Apple warranty valid if NOT buying from an authorized reseller?

    If I buy a new, unregistered product that's NOT from an Apple-authorized reseller, is the 1 year warranty still valid? Can AppleCare still be purchased? Do I need some kind of receipt from the seller? I can't find anything on Apple's site that says I

  • How to avoid multiple call to function:

    In our datawarehouse we have a huge receipt row table where all metrics ar stored in the local currency. On top over that we have views which calculate metrics to the desired currency. So basically all views looks like this select geo_region, product

  • How to save/backup bookmarks in firefox 5.01?

    Dear Support, Please teach me how to save/backup bookmarks in Firefox 5.01? (1) On the File menu, there is only "Import" option but no "Export" option for me to export or save my Bookmarks. (2) On the Bookmarks menu, there is no "Manage Bookmark" tab