How to execute sql qurery in st05

how to execute sql qurery in st05
thanks in advanced.

Hi,
do this....
1.create a small ABAP/4 program that contains only the select statement. Before proceeding, test it to ensure that it works.
2.Open that program in the editor so that it is ready and waiting to execute.
3.Open a new session using the menu path System->Create session.
4.Run transaction ST05 (enter /nst05-zero-five, not oh-five-in the Command field, or choose the menu path System->Utilities->SQL Trace). The Trace SQL Database Requests screen is displayed.
5.If the Trace SQL Status Information box reads Trace SQL is switched off, go to step 7.
6.At this point, the Trace SQL Status Information box contains Trace SQL switched on by, followed by the user id who turned on the trace and the date and time it was started. You must switch it off before you can proceed. If the trace was started within the past hour, it is possible that it is still being used. Contact the indicated user or try again later. If the trace was started hours or days ago, the user probably left it on by mistake and it can be safely turned off. To turn off the trace, press the Trace Off pushbutton. The message in the Trace SQL Status Information box should now read Trace SQL is switched off.
7.Press the Trace On pushbutton. The Trace SQL Database Requests dialog box is displayed. The DB-Trace for User field should contain your user ID. If your user ID is not in this field, enter it now.
8.Press the OK button. You are returned to the Trace SQL Database Requests screen and the status information reads Trace SQL switched on by, indicating that you turned on the trace.
9.Switch back to the window containing your editor session (the one with your program waiting to execute).
10.Press F8 to run your program. (Only press F8, do not do anything else, do not even press the Back button.)
11.When your program has run and the hourglass is no longer displayed, switch back to the trace window.
12.Press the Trace Off pushbutton. The status information reads Trace SQL is switched off.
13.Press the List Trace pushbutton. The Trace SQL Database Requests dialog box is displayed. The fields on this screen will already contain values.
14.Press the OK button. You might need to wait a little while, at most a couple of minutes. The Trace SQL: List Database Requests screen is displayed.
15.Type %sc in the Command field and press the Enter key. The Find dialog box is displayed.
16.Type the name of the table you are tracing in the Search For field. (This is the table named in the select statement in your ABAP/4 program.)
17.Press the Find button. A search results list should be displayed with your table name highlighted.
18.Click on the first highlighted table name. You are returned to the Trace SQL: List Database Requests screen. Your cursor is positioned on the first line containing your table name. To the right of it, in the Operation column, should be the word PREPARE, OPEN, or REOPEN.
19.Press the Explain SQL button on the Application toolbar. The Show Execution Plan for SQL Statement screen is displayed.
20.Scroll down to the execution plan. The index used will be displayed in blue.

Similar Messages

  • How to execute SQL Query in Code behind Using infopath 2010?

    Hi,
    I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
    Thanks In Advance
    Shoeb Ahmad

    Hello,
    You first need to add new SQL DB connection then you need execute connection from code behind.
    See below link to create new connection
    http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
    http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
    Then use below code to execute this connection:
    AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
    string origCommand = Select * from tablename;
    conn.Command = origCommand;
    conn.Execute();
    Finally bind your table:
    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
    http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Please Suggest...How to execute SQL quiries in JDeveloper using BPEL????

    Hi All,
    I am very new user of Oracle JDeveloper and BPEL. I am trying to develop a process flow in JDeveloper using BPEL and get stuck when I was trying to execute a SQL quiry in the flow.
    How to execute SQL quiries using JDeveloper and BPEL?????????????
    Possibilities might be..
    1.Configring Database Adapter
    2.Using Java Embedded activities of BPEL
    However, any of the above mentioned way is not clear with me how to implement it to get the query run in the process flow.
    It will be great if anyone could help me with this concept....
    Thanks in advance
    -Prabha
    Edited by: user10259700 on Sep 15, 2008 3:48 AM

    Hi,
    though BPEL has its development environment in JDeveloper, it has its own forum
    BPEL
    Frank

  • How to execute SQL Quiries in BPEL using JDeveloper

    Hi All,
    I am very new user of Oracle JDeveloper and BPEL. I am trying to develop a process flow in JDeveloper using BPEL and get stuck when I was trying to execute a SQL quiry in the flow.
    How to execute SQL quiries using JDeveloper and BPEL?????????????
    Possibilities might be..
    1.Configring Database Adapter
    2.Using Java Embedded activities of BPEL
    However, any of the above mentioned way is not clear with me how to implement it to get the query run in the process flow.
    It will be great if anyone could hepl me with this concept....
    Thanks in advance
    -Prabha

    ... or perhaps just scan the last 5 posts before you post a new thread, in which case, you'd discover that someone else already asked Help needed in executing SQL query... and got the same answer

  • How to execute sql scripts from Powershell across multiple databases

    Re: How to execute sql scripts from Powershell across multiple databases
    I have an tsql script that I want to run across a list of databases. How is the best way to do this in Powershell? Thanks.

    My example below, using just the SMO and not breaking up the batches, the ExecuteWithResults give the following error when the .sql file contains a GO. My script files are as simple as a DECLARE and then a GO.
    WARNING: SQL Script Failed
    The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-list" comm
    and which is conflicting with the default formatting.
        + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperationException
        + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
    Also, when executing from the ISE, is there a way to force the ISE to release the files. I am having to close the ISE and reopen my script every time I want to make a testing change to the .sql file.
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
    $scriptspath = "C:\temp\psExecuteSQLScripts\scripts"
    $SQLServer = "fidevc10"
    $SQLDB = "Bank03"
    # Create SMO Server Object
    $Server = New-Object ('Microsoft.SQLServer.Management.Smo.Server') $SQLServer
    # Get SMO DB Object
    $db = $Server.Databases[$SQLDB]
    # Load All SQL Scripts in Directory
    $scripts = Get-ChildItem -Path (Join-Path $scriptspath "*") -Include "*.sql" -Recurse
    # Loop through each script and execute
    foreach ($SQLScript in $scripts)
    $fullpath = $SQLScript.FullName
    # Read the Script File into Powershell Memory
    $reader = New-Object System.IO.StreamReader($fullpath)
    $script = $reader.ReadToEnd()
    # Execute SQL
    Write-Host "Executing $SQLScript on $SQLDB...."
    try
    $ds = $db.ExecuteWithResults($script)
    Foreach ($t in $ds.Tables)
    Foreach ($r in $t.Rows)
    Foreach ($c in $t.Columns)
    Write-Host $c.ColumnName "=" $r.Item($c)
    Write-Host "Complete"
    catch [Exception]
    Write-Warning "SQL Script Failed"
    echo $_.Exception|format-list -force
    Write-Host " " -BackgroundColor DarkCyan

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • How to execute .sql file in Stored Procedure?

    Hi,
    I have an urgent requirement, where i have to execute .sql file form Stored Procedure.
    This .sql file will have set of update statement. I need to pass value to this update statement.
    Kindly please help me.
    Regards,
    Irfan

    This is required as part of Data Migration where  i have to do 100 of table's update. Each time update table will defer, so its better to have in separate script file (.sql). Can u paste some sample/syntax to exceute .sql file from stored procedure. I am new to this PL/SQL.
    How have you determined that it's "better" to have seperate scripts?  I assume you mean the table name will "differ" (and not "defer" - I assume that's just because English isn't your first language? no problem - I think I understand what you're asking).
    So what I think you're asking is that you have dynamic table names but each table needs to be updated in the same way?
    Question: Why do you have tables with different names that all need the same process doing to them?
    Assuming it's a valid requirement (and 99% of the time doing dynamic coding implies it's not).... you could use dynamic code, rather than 'scripts'...
    e.g.
    create procedure update_table(tbl_name varchar2) is
    begin
      execute immediate 'update '||tbl_name||' set lastupdate = null';
    end;
    As you haven't bothered to provide a database version, any example code/data or explanation of what you're actually doing, you're not going to get any detailed answer.  Please do take the time to read the FAQ and post appropriate details so people can help you.

  • How to execute sql from table

    For a migration I have created a sql script that puts the full statement to be executed in a specific table column
    I'm now looking for a way how to execute those statements.
    Table structure like: oldName, newName, sqlStatement, id, otherField, otherField2
    Instead of the full statement(sqlStatement) it would also be possible to use the oldName, newName and id field if that simplifies the problem.
    The reason for building the statement and running that one is a) to validate upfront b) a self join is applied to the query result table to prevent some items for update.
    The initial idea was to take the sql statements and execute them as a sql script but that process is pretty slow.

    user2833655 wrote:
    For a migration I have created a sql script that puts the full statement to be executed in a specific table column
    I'm now looking for a way how to execute those statements.That is wrong, tables are for data not executable code
    Re: ref cursor - result set not known
    http://en.wikipedia.org/wiki/Data_%28computing%29
    >
    Data is often distinguished from programs. A program is a sequence of instructions that detail a task for the computer to perform. In this sense, data is thus everything that is not program code.
    >
    user2833655 wrote:
    The initial idea was to take the sql statements and execute them as a sql script but that process is pretty slow.This alternative will just make it difficult, complicated and unreliable as well.

  • How to execute   .sql whitn dos

    i don't know how to execute one text.sql(exemple one procedure) with MsDos.
    thanks

    friend
    i think you can execute a script from the MS DOS prompt like this . you need to write the script in a text file like the
    example i have used below.
    create a text file called t.sql with content as
    create table test_today(n number);
    exit
    Run the following command at MSDOS prompt to execute the script
    sqlplus -s username/password@connect_string @t.sql
    the above script will create a table called test_today and u can see the output as table_created on the screen
    if u want to suppress the feedback just put the following line as first line in the script t.sql
    SET FEEDBACK OFF
    hope this helps you
    thanks & regards
    Prakash Eranki
    [email protected]

  • How to execute SQL statement with oracle jdev

    Please I'm a beginner in oracle jdeveloper. I want to know how to use and execute sql statememt within oracle Jdeveloper 10 g release 3 to manipulate objects in oracle database. I want for e.g. to Enable/disable trigger using sql statement "ALTER TRIGGER trigername DISABLE" explicitly. Please tell me how to proceed.
    i am sure you can help me
    Sincerly yours.

    Hi,
    Using following tutorial http://www.oracle.com/technology/obe/ADF_tutorial_1013/10131/index.htm
    you will found how to connect from Jdev to a database (chapter 1 or 2 ?). Then you just have to go under Tool>SQL*Plus or Tools>SQL Worksheet depending on what you need.
    Luck,
    Tif

  • How to execute SQL Script using windows powershell(using invoke-sqlcmd or any if)

    OS : Windows server 2008
    SQL Server : SQL Server 2012
    Script: Test.sql (T-SQL)  example : "select name from sys.databases"
    Batch script: windows  MyBatchscript.bat ( here connects to sql server using sqlcmd  and output c:\Testput.txt) 
     (sqlcmd.exe -S DBserverName -U username -P p@ssword -i C:\test.sql -o "c:\Testoutput.txt)  ---it working without any issues.....
    This can execute if i double click MyBatchscript.bat file and can see the output in c:\testput.txt.
    Powershell: Similarly, How can i do in powershell 2.0 or higher versions?  can any one give full details with each step?
    I found some of them online, but nowhere seen clear details or examples and it not executing through cmd line (or batch script).
    example: invoke-sqlcmd -Servernameinstance Servername -inputfile "c:\test.sql" | out-File -filepath "c:\psOutput.txt"  --(call this file name MyTest.ps1)
    (The above script working if i run manually. I want to run automatic like double click (or schedule with 3rd party tool/scheduler ) in Batch file and see the output in C drive(c:\psOutput.txt))
    Can anyone Powershell experts give/suggest full details/steps for this. How to proceed? Is there any configurations required to run automatic?
    Thanks in advance.

    Testeted the following code and it's working.....thanks all.
    Execute sql script using invoke-sqlcmd with batch script and without batch script.
    Option1: using Import sqlps
    1.Save sql script as "C:\scripts\Test.sql"  script in side Test.sql: select name from sys.databases
    2.Save Batch script as "C:\scripts\MyTest.bat" Script inside Batch script:
    powershell.exe C:\scripts\mypowershell.ps1
    3.Save powershell script as "C:\scripts\mypowershell.ps1"
    import-module "sqlps" -DisableNameChecking
    invoke-sqlcmd -Servername ServerName -inputFile "C:\scripts\Test.sql" | out-File -filepath "C:\scripts\TestOutput.txt"
    4.Run the Batch script commandline or double click then can able to see the output "C:\scripts\TestOutput.txt" file.
    5.Connect to current scripts location  cd C:\scripts (enter)
    C:\scripts\dir (enter )
    C:\scripts\MyTest.bat (enter)
    Note: can able to see the output in "C:\scripts" location as file name "TestOutput.txt".
    Option2: Otherway, import sqlps and execution
    1.Save sql script as "C:\scripts\Test.sql"  script in side Test.sql: select name from sys.databases
    2.Save powershell script as "C:\scripts\mypowershell.ps1"
    # import-module "sqlps" -DisableNameChecking #...Here it not required.
    invoke-sqlcmd -Servername ServerName -inputFile "C:\scripts\Test.sql" | out-File -filepath "C:\scripts\TestOutput.txt"
    3.Connect to current scripts location
    cd C:\scripts (enter)
    C:\scripts\dir (enter )
    C:\scripts\powershell.exe sqlps C:\scripts\mypowershell.ps1 (enter)
    Note: can able to see the output in "C:\scripts" location as file name "TestOutput.txt".

  • How to execute sql statement under bat file?

    I want to execute following statement
    C:\>sqlplus /nolog
    SQL> conn scott/tiger
    SQL> select * from tab;
    I know I can realize it as following test.bat and testdb.sql file
    test.bat is follows:
    sqlplus /nolog @testdb.sql
    testdb.sql is follows:
    conn scott/tiger
    select * from tab;
    Now I don't want to use sql file,I only want to use bat file,like follows:
    test.bat is follows:
    sqlplus /nolog
    conn scott/tiger
    select * from tab;
    when I run test.bat,I find only sqlplus /nolog statement execute,the other statements don't execute.
    1)I want to know whether there is a method to execute sql statement only by bat file without a sql file? How to realize it?
    2)If I call sql file,how to hide passord of user? Because I don't want to other persons know scott password,if I use conn scott/tiger in testdb.sql,other person can see testdb.sql and know the password. Is there a good method to avoid?
    Thanks!

    I'm running *NIX, but works the same on Windows
    bcm@bcm-laptop:~$ cat here.sh
    sqlplus dbadmin/admindb << EOF
    select count(*) from user_objects;
    exit
    EOF
    bcm@bcm-laptop:~$ sh here.sh
    SQL*Plus: Release 11.2.0.1.0 Production on Mon May 17 18:14:09 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
      COUNT(*)
          9
    SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    bcm@bcm-laptop:~$ Edited by: sb92075 on May 17, 2010 6:15 PM

  • How to execute sql query stored in  a variable

    Hi
    define query = 'select * from abc;'
    then how to execute this defined variable query.
    Thanks,
    Shyam

    EXECUTE IMMEDIATE mmy_sql --(variable
    INTO     mmy_default_bill_type;
    by kumar.

  • How to execute sql file from servlet

    Hi,
    I am using JSP, Servlets and Oracle 8i in my application. I want to execute .sql file from java code. Is it possible to do that,
    as we execute .sql file from sql plus prompt.
    Suppose I have abc.sql file and I want to execute it from java code.
    If any body have the solution then pl. reply with sample code.
    Thanks,
    Rajesh

    If any body have the solution then pl. reply with
    sample code.No, no, dec - s/he doesn't want the actual solution, but the full code!
    /k1

  • How to execute SQL in a BI Beans application?

    BI Beans connect to data stores using class oracle.dss.connection.client.Connection. This class has a method naming executeCommand() for running OLAP DML commands. But I don't think it surport for running SQL.
    So how to run SQL, do i have to create another JDBC connection to do that.
    Thank u.

    Hi,
    I would recommend using a new JDBC connection to control SQL access as this provides more control over the transactional capabilities available within the SQL environment. Depending on what it is you want to do within the SQL environment.
    I think you can use the connection architecture to retrieve information about the host/port/sid/username/password etc which will help in creating the new JDBC connection.
    Hope this helps
    Keith Laker
    Product Manager
    Oracle Business Intelligence Beans

Maybe you are looking for

  • JDBC Lookup in PI 7.1 - SELECT ? FROM DUAL and Connection timed out

    Hi, We have a scenarios (Idoc to JMS) with JDBC lookup. We have used graphical JDBC lookup functionality. We are reading country names for a given country code from SAP in an external database table. The query is so simple. That  should not take much

  • Printing font Barcode3of9 from Crystal Reports XI

    I have an issue with printing font Barcode3of9 from Crystal Reports XI utilizing Manhattan Associates Performance Management (PM) UI application. The font is applied to a field that is converted from a number to a text using the CStr formula in Cryst

  • How to? Suppress Crosstab Total column, based on condition, Please help!

    Hi All, Please give an advice on the following: My problem I have an item stock and value by depo by region report, with the following structure: http://img29.imageshack.us/img29/5289/ctab.jpg Row 1 is Items Column 1 is region, has six values (value

  • Why no 'Public connections' link is displayed?

    Hi, I meet the problem with Discover(with oracle10g 10.1.2) : according to "Discoverer configuration B13918_02.pdf", Section 4.6, we could create "public connection" via OAS manage page, But there is no hyperlink "public connections" , where I can fo

  • CS5 updates won't install

    Computer crashed, reinstalled windows 7 (64-bit), reinstalled CS5, now can't install updates to CS5.  CS5 says,"there was an error downloading this update, please try again later" - well, I tried again later a number of times and it still won't downl