How to generate dml scripts through sql prompt

Hi friends,
As we ve DBMS_METADATA.GET_DDL to create ddl scripts can we ve something to take out dml scripts..Not through TOAD i want through prompt...
Thks
Sonal...

Hi,
to take out dml scriptsNot sure what you mean...
Did you want to get the current statement against your database ?
Nicolas.

Similar Messages

  • How to run the SQL Script in SQL Prompt?

    Hi ExpertGroup,
    I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
    Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
    Let me know, How to Run in SQl Prompt.
    Thanks & Regards,
    Senthil K Kumar.

    This is my SQL Script....
    SET COLSEP '|'
    SET LINESIZE 32767
    SET PAGESIZE 50000
    /* SET LINESIZE 3000
    SET PAGESIZE 50000
    SET DEFINE OFF */
    SET ECHO OFF
    SET FEEDBACK OFF
    --SET HEADING OFF
    SET TRIMSPOOL ON
    SET NEWPAGE NONE
    SET UNDERLINE OFF
    SPOOL &&EnterPath;
    SELECT * FROM &&TableName;
    SPOOL OFF
    SET FEEDBACK ON
    --SET DEFINE ON
    PROMPT Done.
    I am able to run this script in SQL Prompt....
    Its executing fine...
    But, If I am executing again it maynot asking for new set of data....
    alternativily its taking old values only.....
    how can i exeute with new set of data in the sql prompt.....

  • Error to execute the script through command prompt

    I tried to execute the script through command prompt. I got some following error. Could you please advice me how to rectify this.
    cscript D:\JS\Test.js
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    D:\JS\Test.js(1, 1) Microsoft JScript runtime error: 'app' is undefined.
    Thanks,
    Prabudass

    I haven't use CS for quite some time and file associations may not work with the command prompt.
    You can try using Windows Explorer to browse to a .js file then right click on that file. From the popup menu choose Open With. Even if you see Photoshop in the file list choose Browse at the bottom. Browse to Photoshop and make sure to check 'Always use selected program...'
    If that doesn't work you will need to create an action that runs your script and make a droplet from that action. You can then use the droplet in the command prompt. You may also need to create a 'dummy' image file to launch the droplet with if you script doesn't require an open document at startup. See http://www.ps-scripts.com/bb/viewtopic.php?t=967

  • How to Generate Trace Files in SQL*Plus

    Hi Friends ,
    How to Generate Trace Files in SQL*Plus ?
    i have no idea
    thanks
    raj

    What trace files would you like to generate?
    Are we talking SQL trace files?
    ALTER SESSION SET sql_trace = TRUE;This will be generated in the user_dump_dest on the server.
    show parameter dump

  • How to Run SSIS Package through SQL AGENT Job

    I am good with SSIS, I created a package which will load the excel files to SQL SERVER  tables. To Implement this I wrote the C# code to extract the first sheet name only, and then
    package will load the data present the first sheet only. The package working fine when i run this through BIDS. But the same package throwing error at C# code step when i am running this package through SQL AGENT JOB. When i searched for this, i have seen
    many posts saying that, this is happening becoz of using Microsoft.interop.excel references inside the c# code. Please help me with this. Is there any alternate way in c# to extract the first sheet name(not based on ascending order) of an excel file with out
    using interop. Or
    How to configure SQL AGENT job to run suceessfully when using interop inside the code.
    My UAT server is of 64 bit. And i have to run this in the same server.
    I tried creating  "Desktop" folder in "C:\Windows\System32\config\systemprofile\"
    Error:Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.     at ST_ecfa668f250a45e18c95639c9ffd64d4.csproj.ScriptMain.Main()
        --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)    
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
    Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     at
    System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)     at System.Type.InvokeMember(String name, BindingFlags
    invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)     at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()  End Error  Error: 2015-02-27 11:24:00.23     Code: 0x00000001
        Source: User Mail      Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error
    occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
    not open a connection to SQL Server)     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
        at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
        at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)     at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
    host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)     at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString
    connectionOptions, String newPassword, Boolean redirectedUserInstance)     at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword,
    SqlConnection owningObject, Boolean redirectedUserInstance)     at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)  
      at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owning...
     The package execution fa...  The step failed
    using System;
    using System.Data;
    using System.Diagnostics;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    using System.Data.OleDb;
    using Microsoft.Office.Interop;
    using System.Runtime.InteropServices;
    namespace ST_ecfa668f250a45e18c95639c9ffd64d4.csproj
    [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    #region VSTA generated code
    enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    #endregion
    public void Main()
    { /*Passing the file path via User::File_Name Variable*/
    string FileName = Dts.Variables["User::File_Name"].Value.ToString();
    Microsoft.Office.Interop.Excel.Application xlApp = null;
    Microsoft.Office.Interop.Excel.Workbook excelBook = null;
    try
    xlApp = new Microsoft.Office.Interop.Excel.Application();
    excelBook = xlApp.Workbooks.Open(FileName, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    string[] excelSheets = new string[excelBook.Worksheets.Count];
    int i = 0;
    foreach (Microsoft.Office.Interop.Excel.Worksheet wSheet in excelBook.Worksheets)
    excelSheets[i] = wSheet.Name;
    i++;
    Dts.Variables["User::WorkSheetName"].Value = excelSheets[0] + "$";
    catch (Exception ex)
    excelBook.Close(false, FileName, null);
    Marshal.ReleaseComObject(excelBook);
    string error = ex.Message;
    finally
    excelBook.Close(false, FileName, null);
    Marshal.ReleaseComObject(excelBook);
    Dts.TaskResult = (int)ScriptResults.Success;

    I installed office in my machine...but this doesn't solved my problem...
    Finally i figured out the solution for this and it is working now, Here is the solution...!
    Create the folder with name "Desktop" inside the below mentioned path
    C:\Windows\SysWOW64\config\systemprofile\   
    But i really don't understand the logic behind this. Can someone explain it pls....

  • Term is not recognized when executing PowerShell Script through SQL Agent using CMDEXEC

    I am trying to simply execute a PowerShell script that is stored in a file on a network drive through SQL Agent as a job. The script is a basic copy from one directory to another.  I have run and successfully executed this from a command prompt outside
    of SQL Agent.  When I execute this through SQL Agent as a Operating System (CmdExec) command I am getting an error that the term is not recognized as the name of a cmdleet, function, script file or operable program. I have executed many different ways
    put found an article to use double quotes in the network path which I have done with no success. 
    I am executing the following command as a job in SQL Agent:
    PowerShell H:\"\PowerShell""\PS_Scripts\"\batchcopyFFLWithProgress.ps1 through SQL Agent job
    I get the following error message:
     04/21/2015 10:01:09,Copy FFL Files,Error,1,NY11266-LTW7E\JPLAPTOPSQL,Copy FFL Files,Copy FFL files,,Executed as user: NT Service\SQLAgent$JPLAPTOPSQL. H:\PowerShell\PS_Scripts\batchcopyFFLWithProgress.ps1 : The term   'H:\PowerShell\PS_Scripts\batchcopyFFLWithProgress.ps1'
    is not recognized as   the name of a cmdlet<c/> function<c/> script file<c/> or operable program. Check the   spelling of the name<c/> or if a path was included<c/> verify that the path is   correct and try again.
     At line:1 char:1  + H:"\PowerShell\PS_Scripts"\batchcopyFFLWithProgress.ps1  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      + CategoryInfo          : ObjectNotFound:
    (H:\PowerShell\P...ithProgress.p      s1:String) []<c/> CommandNotFoundException      + FullyQualifiedErrorId : CommandNotFoundException.  Process Exit Code 1.  The step failed.,00:00:03,0,0,,,,0
    Content of batchcopyFFLWithProgress.ps1 which has the PowerShell script:
    $source=ls H:\SQLTest\Script\TestData\*.*
    $i=1
    $source| %{
        [int]$percent = $i / $source.count * 100
        Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
        copy $_.fullName -Destination H:\test -Recurse
        $i++
    I have searched the internet and have not found any resolution to my error.  If someone has experienced this error and found the resolution I would greatly appreciate your help.

    I have change the service account for SQL Agent to be my domain account as I have local admin rights to my laptop.  I stopped and started the services for SQL Agent and than started the job to run which is copying locally to minimize any network drive
    issues.  I am still getting the same error message as it is showing that I am executing the job under my domain account?  Any thoughts what it could be?
    ErrorMsg
    04/23/2015 11:21:06,Copy FFL Files,Error,1,ServerName\InstanceName,Copy FFL Files,Copy FFL files,,Executed as user: Domain\DomainAccount. \\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1 : The term '\\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1'
    is   not recognized as the name of a cmdlet<c/> function<c/> script file<c/> or operable program. Check the spelling of the name<c/> or if a path was   included<c/> verify that the path is correct and try again.  At
    line:1 char:1  + \\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      + CategoryInfo          : ObjectNotFound: (\\ServerName...ithProgress.ps1:String)
    []<c/> CommandNotFoundException      + FullyQualifiedErrorId : CommandNotFoundException.  Process Exit Code 1.  The step failed.,00:00:02,0,0,,,,0
    Script
    $source=ls "\\ServerName\Test\TestData\*.*"
    $i=1
    $source| %{
        [int]$percent = $i / $source.count * 100
        Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
        copy $_.fullName -Destination "\\ServerName\Test\test" -Recurse
        $i++

  • How to run multiple scripts in sql*plus?

    I would like to run 2 scripts in sql*plus, how do I do this? I tried the following, but it won't run.
    create table student_new
    AS
    select *
    from student
    insert into student_new
    (last_name, first_name
    values
    (Crop, Jenny)
    The above are the two scripts I want to run, what am I doing wrong.
    Thanks

    Do you have a solution to run multiple scripts continuosly, one after the other as one script.
    Say I have file1.sql file2.sql, file3.sql.
    I want to create a script run.sql, where this will run file1.sql,file2.sql,file3.sql one after other without any one running one after the other like follows:
    run.sql should have
    begin
    @file1.sql
    @file2.sql
    @file3.sql
    dbms_output.put_line(select sysdate from dual);
    end;
    If I run run.sql all the three scripts should be executed successfully and then display the current time . All these files have update statements(50,000 updates each file).
    Very urgetn. Can some one hlpe, please.
    Thanks in advance.

  • How to call the javascript through Command prompt?

    I need to call the .js file through command prompt. And also through programming language like c++, java. Could you please advice me with samples.This is for "illustrator cs".

    You can also look into use of COM scripting interface to the Adobe programs. Unfortunately, this means you have to do some programming/scripting to create a (command line) script that you can execute like
    cscript C:\somePath\myScriptLauncher.vbs  C:\somePath\anAdobeScript.jsx
    or
    cscript C:\somePath\myScriptLauncher.js  C:\somePath\anAdobeScript.jsx
    the scripts can be written in VBScript (*.vbs) or Microsoft JScript (*.js) which can access COM objects thus the Adobe program's COM APIs.
    Nothing purely simple as a command line option in this solution. But it does offer customization as an advantage.
    This might be a slightly useful reference.
    http://stackoverflow.com/questions/3846626/is-it-possible-to-execute-jsx-scripts-from-outs ide-extendscript
    there's one post mentioning COM in there.
    And of course, you can also use COM through C++, Java, C#, Visual Basic, etc. as well, not restricted to VBScript and JScript, though I've found it's easier to use the latter two for COM.

  • How to Generate Dynamic Columns from SQL

    Hi Friends,
    I want to create a data fromat like This
    Showroom / date    01-01-09        02-01-09     03-01-09     04-01-09      05-01-09     06-01-09     07-01-09   
    S1                           20                      10              09            90             90                  10            100
    S2                           10                       1                1              2               6                    2             10
    S3                            5                        7                 9             1               2                    3             12This Data is Just like Matriz Reports....................................
    Here i Want to Generate Date column value Dynamically.....................is it possible through SQL
    the values are Sales value for each showroom for diffrent date value
    all sale,showroom and Date Column are in one Table......................
    It should Generate date Dynamically depending on User VAlues./..............
    Thanks in Advance

    something to play with (not tested as I don't have database access)
    declare
    /* assuming table showroom_sales has columns a_showroom,a_date,a_sale */
      the_sql varchar2(32000) := 'select a_showroom';
      day_from date := to_date('20090101','yyyymmdd');
      day_till date := to_date('20090107','yyyymmdd');
    begin
      for d in (select a_date from showroom_sales where a_date between day_from and day_till)
      loop
        the_sql := the_sql ||
                   ',max(decode(a_date,to_date('''||to_char(d.a_date,'yyyymmdd')||''',''yyyymmdd''),a_sale,null)) "'||to_char(d.a_date,'dd-mm-rr')||'"'
      end loop;
      the_sql := the_sql || ' from showroom_sales group by a_showroom order by a_showroom ';
      dbms_output.put_line(the_sql);  /* to verify if query is correct or not */
    end;the code above should generate something like (provided all those dates appear in your showroom_sales table)
    select a_showroom,
           max(decode(a_date,to_date('20090101','yyyymmdd'),a_sale,null)) "01-01-09",
           max(decode(a_date,to_date('20090102','yyyymmdd'),a_sale,null)) "02-01-09",
           max(decode(a_date,to_date('20090103','yyyymmdd'),a_sale,null)) "03-01-09",
           max(decode(a_date,to_date('20090104','yyyymmdd'),a_sale,null)) "04-01-09",
           max(decode(a_date,to_date('20090105','yyyymmdd'),a_sale,null)) "05-01-09",
           max(decode(a_date,to_date('20090106','yyyymmdd'),a_sale,null)) "06-01-09",
           max(decode(a_date,to_date('20090107','yyyymmdd'),a_sale,null)) "07-01-09"
      from showroom_sales
    group by a_showroom
    order by a_showroom to be executed to get the result as required
    Regards
    Etbin

  • How to generate XML file from SQL file !

    I am new to XML publisher. I known one way to generate XML file is register one report file in concurrent manager.
    But I want to generate XML file from sql file.
    Could someone show me how to code in sql file, how to register is in concurrent manager.
    Thanks !

    Hi
    Phew ... not sure we have the space here. So I can point you in the right direction:
    1. XML data generation - there are two packages in the db you can use with a plsql procedure, XMLGEN and SQL XML. You can also use java APIs too. Try checking the db documentation and search for the above methods.
    2. Registering the report - the system administrators guide will provide this info. Hooking the program up with XMLP is covered here - http://www.oracle.com/technology/products/applications/publishing/resource/CM%20Whitepaper5.0.pdf
    Regards, Tim

  • How to generate org model through report

    How to generate org model using report .
    please share your information .
    thanks in advance ,
    sapcrm

    Hi,
    It's look like you are assuming that an organizational model can be created from external data input via a report. If so, then your assumption is wrong. There is no standard way to create a org. model from external input.
    As a standard practice SAP provided a report as mentioned in the previous reply. Using this report you can download ECC/R3 org. model into SAP CRM. This is the easy and best proven way of generating org. model in SAP CRM.
    Please let me know, if you need any further clarification
    Do not forget to reward if it helps
    Regards,
    Paul Kondaveeti

  • How to run Exe file through Sql server agent job

    Hello All
    i have 2 servers 
    1.Application Server
    2.Database server
    Application server has a .exe file so i wanted to run this exe file through SQL server agent job from database server.
    What is the process for run this Exe file 
    Can you plz suggest me step by step process
    Kamal

    While i'm trying to implement this below method
    Step1 : Right Click SQL Server Agent. Select New -> Job. This will open a wizard to schedule a new
    job.
    Step2 : Select Steps from options given on the left side of wizard. This is the main place to set your
    exe\program as a running step. Give some name to this step, Select Operating System (cmdexec) for the Type and give the full path of exe in Text box for Command.
    ex:\\10.11.00.98(your application serverIP)\ch.exe
    Thanks vanchan-Please
    mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    I got this below error
    Message
    Executed as user:NJROSJ345\SYSTEM. The process could not be created for step1 of job
    (Reason:Access is Denied)The step failed.
    But i have sys admin rights on the both the servers 
    Kamal

  • Generate the fmx through command Prompt

    Hi,
    I am using Oracle forms6i, Oracle 10g Database and Windows (OS).
    Is it possible to compile the FMB file through command Prompt.
    And then i need to move the fmx files to server through command prompt.
    Thanks,
    Ansaf.
    Edited by: Ansaf on Jan 24, 2012 5:20 PM

    Ansaf wrote:
    Hi,
    I created the batch file as per your code and i changed only the useridn/password@db.
    I run the batch
    But i cant find the fmx file.Sorry i post the 10g batch compiler
    From where u run the batch file ? It should be in that folder where you .fmb exist.
    If then don't work. add the location path before the ifcmp60.exe
    Here is the 6i compiler
    Echo compiling forms ....
    for %%f IN (*.fmb) do C:\ORANT\BIN\ifcmp60.exe userid=mail/tti@ait module=%%f batch=yes module_type=form compile_all=yes window_state=minimize
    ECHO form compilation completechange the ifcmp60.exe path as you have
    Hope it will works for you
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: HamidHelal on Jan 24, 2012 8:12 PM

  • Need command to run sql script from sql prompt

    Hi,
    I am beginner in sql i need a command to run sql file from sql prompt.In notepad i have write 10 to 15 tables creation and saved as .sql i want to run this file from sql promp pls some one help.I am very great full to all users in this forum.

    You can also use the 'start' command.
    You may also want to look in the SQLPlus User Guide and Reference (for your release) at the set command for commands to set the number of lines per page, turn headings on or off, and so on:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
    HTH -- Mark D Powell --

  • How to check UNUSED ADMIN-SCRIPTS through SQL Query..??

    Can someone help me with the SQL query, which would give result of total unused ADMIN SCRIPTs for past few months?? (not the routing scripts)
    Thanks in advance for your help n concern..!!

    You can youse the below queries
    Step 1:
    Query to pull the used scripts between 17/12/2011 to 18/01/2012
    select MasterScriptID,EnterpriseName from Master_Script where MasterScriptID in (
    select MasterScriptID from Script where ScriptID in(
    select distinct(ScriptID) from Route_Call_Detail
    where DateTime between '2011-12-17 00:00:00' and '2012-01-18 23:59:59'))
    Step 2:
    Query to pull all the current configured Scripts 
    select MasterScriptID,EnterpriseName from Master_Script
    Step 3:
    Once we get both the data, we can use Excel’s VLOOKUP functionality to find the unused Scripts
    Regards,
    Senthil

Maybe you are looking for