SQL statement from ST05
Hi All,
Please let me know how to retrieve the SQL statement from ST05 output or how to know what is the field
browsed and what was the input in SE16 from ST05.
Thank you.
With Regards,
Gandhi Subramani
Hi,
Go to ST05.
(1)- Activate Trace.
(2)- Run the desired T-Code for which you want to do the SQl Trace.
(3)- Go to "ST05" and deactivate Trace.
(4)- Then Press Display Trace.
(5)- Then POP will come. Just press Execute.
(6)- Your SQL trace will be displayed, with the table names and the Field names and the logic which is retevering data from specific table.
Thanks
Saurabh
Similar Messages
-
Extracting SQL statement from a Webi document's data provider using SDK.
Hi all,
Is it possible to extract the SQL statement from an existing Webi document's data provider using BO SDK? I've searched through the class library but haven't found any information on this yet. If you have done it, could you provide some guidance. Many thanks.I found the following Java code that might be of some help to you. I realize you are using .NET but this might push you down the right path.
The trick here is to use the Report Engine SDK to get the DataProvider of the DocumentInstance. Then, look at the SQLDataProvider to get your SQLContainer.
My apologies for the poor formatting. This didn't copy and paste over to the forums very well. I've cleaned up as much as I could.
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import="com.businessobjects.rebean.wi.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession oEnterpriseSession = null;
String username = "username";
String password = "password";
String cmsname = "cms_name";
String authenticationType = "secEnterprise";
try
//Log in. oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (oEnterpriseSession == null)
out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
else
{ loginSuccessful = true;
catch (SDKException sdkEx)
{ out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");}
if (loginSuccessful) { IInfoObject oInfoObject = null;
String docname = "WebI document name";
//Grab the InfoStore from the httpsession IInfoStore oInfoStore = (IInfoStore) oEnterpriseSession.getService("", "InfoStore"); //Query for the report object in the CMS. See the Developer Reference guide for more information the query language. String query = "SELECT TOP 1 * " + "FROM CI_INFOOBJECTS " + "WHERE SI_INSTANCE = 0 And SI_Kind = 'Webi' " + "AND SI_NAME='" + docname + "'";
IInfoObjects oInfoObjects = (IInfoObjects) oInfoStore.query(query);
if (oInfoObjects.size() > 0)
//Retrieve the latest instance of the report oInfoObject = (IInfoObject) oInfoObjects.get(0);
// Initialize the Report Engine ReportEngines oReportEngines = (ReportEngines)
oEnterpriseSession.getService("ReportEngines");
ReportEngine oReportEngine = (ReportEngine) oReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
// Openning the document DocumentInstance oDocumentInstance = oReportEngine.openDocument(oInfoObject.getID());
DataProvider oDataProvider = null;
SQLDataProvider oSQLDataProvider = null;
SQLContainer oSQLContainer_root = null;
SQLNode oSQLNode = null;
SQLSelectStatement oSQLSelectStatement = null;
String sqlStatement = null;
out.print("<TABLE BORDER=1>");
for (int i=0; i<oDocumentInstance.getDataProviders().getCount(); i++)
oDataProvider = oDocumentInstance.getDataProviders().getItem(i);
out.print("<TR><TD COLSPAN=2 BGCOLOR=KHAKI>Data Provider Name: " + oDataProvider.getName() + "</TD></TR>");
if (oDataProvider instanceof SQLDataProvider)
oSQLDataProvider = (SQLDataProvider) oDataProvider;
oSQLContainer_root = oSQLDataProvider.getSQLContainer();
if (oSQLContainer_root != null)
for (int j=0; j<oSQLContainer_root.getChildCount(); j++)
oSQLNode = (SQLNode) oSQLContainer_root.getChildAt(j);
oSQLSelectStatement = (SQLSelectStatement) oSQLNode;
sqlStatement = oSQLSelectStatement.getSQL();
out.print("<TR><TD>" + (j+1) + "</TD><TD>" + sqlStatement + "</TD></TR>");
else
out.print("<TR><TD COLSPAN=2>Data Provider is not a SQLDataProvider. SQL Statement can not be retrieved.</TD></TR>"); } } out.print("</TABLE>");
oDocumentInstance.closeDocument(); }
oEnterpriseSession.logoff();}%> -
How to store data into database by reading sql statements from text file
how to write java program for storing data into database by reading sql statements from text file
Step 1: Create a property file to add various queries.
Step 2: Read the properties file using ResourceBundle
Step 3: Use the jdbc to execute the query read from the property file.
So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file. -
How Can I Retrieve SQL Statement From The User ?
Hi
I want to know, how can I make the user can enter the SQL statement from himself ?? in this code he can't enter it. Only he can display the SQL that i wrote it...
this is my Code:
import java.sql.*;
public class db_testing {
static final String DRIVER = "com.mysql.jdbc.Driver";
static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
public static void main(String[] args) {
Connection cn=null;
Statement st= null;
ResultSet rset=null;
try{
Class.forName(DRIVER);
cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
st=cn.createStatement();
rset=st.executeQuery("select * from employee");
ResultSetMetaData metadata=rset.getMetaData();
System.out.println("The begining: ");
for(int i=1;i<=metadata.getColumnCount();i++)
System.out.print(metadata.getColumnName(i)+"\t");
System.out.println();
System.out.println();
while(rset.next()){
for(int i=1;i<=metadata.getColumnCount();i++)
System.out.print(rset.getObject(i)+"\t\t");
System.out.println();}
catch(Exception e){
e.printStackTrace();
finally{
try{
cn.close();
st.close();
rset.close();
catch(Exception e1){
e1.printStackTrace();
}The following changes in the code will make the user to give the input
import java.sql.*;
public class db_testing {
static final String DRIVER = "com.mysql.jdbc.Driver";
static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
public static void main(String[] args) {
Connection cn=null;
Statement st= null;
ResultSet rset=null;
try{
Class.forName(DRIVER);
cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
// st=cn.createStatement();
// rset=st.executeQuery("select * from employee");
PreparedStatement pstmt=null;
pstmt=cn.prepareStatement("select * from employee where id=?");
pstmt.setInt(1,Integer.parseInt(args[0]));
rset=pstmt.executeQuery();
ResultSetMetaData metadata=rset.getMetaData();
System.out.println("The begining: ");
for(int i=1;i<=metadata.getColumnCount();i++)
System.out.print(metadata.getColumnName(i)+"\t");
System.out.println();
System.out.println();
while(rset.next()){
for(int i=1;i<=metadata.getColumnCount();i++)
System.out.print(rset.getObject(i)+"\t\t");
System.out.println();}
catch(Exception e){
e.printStackTrace();
finally{
try{
cn.close();
st.close();
rset.close();
catch(Exception e1){
e1.printStackTrace();
} -
How to isolate the Sql Statement from Java Code
Hi
I Need to know that can we segregate the Sql Statements and convert them to Stored Procedures so as to isolate the Sql statements from Java Code.
So i have one static web page which uses four select Statements so what i want is to create a stored procedure encapsulating these queries. So that the Java Web Developer will simply call the Stored Procedure instead of using four different SQL Statements.
Suppose the developer has these four Statements
Select ename,empno,sal,job from emp;
select empno,ename,mgr from emp;
select deptno,dname from dept;
select emp.ename,emp.empno,emp.deptno,dept,dname fromemp,dept;
So can i encapsulate these four Sql Statements in one Procedure and the Web developer can call the Store procedure and dont need to write the Sql Statements in his code.
Can Anybody guide me how to write this Stored type of Store procedure.
Thankshttp://www.google.com/search?q=java+windows+registry
Next time, search yourself. It might be beyond your belief, but you're really, really not the first person to wonder about this. -
Can we Run a simple SQL statement from OBIEE Middle Tier node
Hi
i am working in OBIEE 11g environment. Database is installed on one node and Middle tier (BI services ) in other node,
Can i use any utility to run a simple SQL statement from Middle tier ?
Thanks
ReddyAny utility means?
We can create an ODBC connection on the BI server and run the sql.
Mark if helps. -
Exec SQL statement from BW to MS SQL
Hi Experts,
I need to execute sql statement from BW on MS SQL Server.
I want to do it in process chain. There is a so called ABAP Program Component.
How to implement such a program or function module that will execute on MS SQL Server an sql statement such as for instance:
"Create view SOME_VIEW as select * from XTABLE".
I have already configured database connection using DBCO transaction.
Waiting for response.
KrzysztofThanks, but that is not what I was asking for.
I just need to send some SQL statement from BW to MS SQL Server using ABAP program (exec sql or something like this).
Could you provide me a pattern of such an ABAP program?
The sql statement is not importent here, I have already extracted data from MS SQL to BW, I have configured dataflow, process chains and so on.
No I need to determine DELTA on MS SQL Server. I've got some ideas but I need to know how to send SQL statement from BW to MS SQL Server using ABAP program.
Please any help will be appreciated -
Where to see generated SQL statement from jdbc adapter?
Hi everybody,
where can I see the generated SQL statement from JDBC adapter?
Regards MarioYes and True lterally means the same, but alas XI does not understand literature..
Just checked the note as well, as you are correct!
Regards
Bhavesh -
How could I investigate SQL statement from standard audit record ?
We use Oracle 11gR2.
We use standard audit , audit_trail=DB.
We found suspicious audit record but that SQL_BIND,SQL_TEXT colums were NULL.
How could I investigate that SQL statement from standard audit record ?Only "DB, EXTENDED" would cause the SQL statement to be captured.
If you have the Diagnostics Pack licence you could try querying DBA_HIST_SQLTEXT (joined to DBA_HIST_SNAPSHOT) -- but this would only list SQLs captured by AWR (i.e. the "Top 'N'" SQLs in that snapshot).
Hemant K Chitale -
Patterns to execute a SQL Statement from a Droplet (select)
Hi,
I need to perform a query on a table, Example: select * from ARF_QUERY "the database used is Oracle. I would like to know if the atg has some
standard method to perform this database connection and execute the SQL statement from a Droplet (select).
Thank.I dont think there is any generic droplet to run a select query directly against a table.
However, there are various lookup droplets available that run on the repositories.
Like /atg/targeting/RepositoryLookup droplet. you can run it for specific id or for all.
You might want to have a look at it in documentation of how exactly to use it.
Thanks -
How could I extract past executed SQL statement from dictionary ?
We use oracle11gR2 on win2008R2.
How could I extract the past executed SQL statement from dictionary ? (Is it possible from V$SQLTEXT or other dictionary table ?)IvicaArsov wrote:
Hi,
You can find executed SQL in V$SQLAREA view (if it's still in memory). If it does'n't exist and you have AWR enabled you can query DBA_HIST_SQLTEXT table, but remember that the statistic information in AWR tables is filtered (1 out of 10).
I.Arsov
As you know when taking snapshot oracle will capture only top sql statements and stored in AWR.
But can you please link(source) dba_hist_sqltext contain only 1 out of 10 filtered data?. In dba_hist_active_sess_history yes it contain 1 out of 10 sampled data. -
Building up dymanic SQL statement from user entered fields on a jsp
Hi guys.
I'm building up a sql statement from a bunch of input fields that the users can type in on a .jsp page. No real problem there, but I get a problem when they type in words with ' character in it Eg: Don't, I'll etc.
This confuses the java code totally and usually results in a spectacular crash of the system.
Any ideas/thought/wild speculations would be most appreciated.
Regards
Elmar Matthee
University of Stellenbosch
South AfricaEven in pure read-only databases SQL injection can be a problem, as the user might be able to read data he should not be able to see.
You can also create dynamically created sql statements using PreparedStatements, that's not a problem, I'm doing it pretty often myself.
List<Object> arguments = new ArrayList<Object>();
StringBuilder sql = new StringBuilder("SELECT foo FROM bar WHERE");
if (someCondition) {
sql.append(" foobar = ? ");
arguments.add(someValue);
if (someOtherCondition) {
sql.append(" AND barfoo = ?");
arguments.add(someOtherValue);
// later on use setObject() to fill in the parametersObviously you'll have to handle putting the correct ANDs and ORs there, but you probably has solved that already, as it isn't any different if you don't use a PreparedStatement. -
Getting SQL statement from OCIStmt
Is there a way to retrieve the SQL statement from OCIStmt structure? That is, does anyone know what this structure is? For example, if used OCIPrepareStmt, then bound all the variables to OCIStmt, can I tell from OCIStmt what the final SQL statement is? What about the statement string that was originally passed to OCIPrepareStmt()?
Thanks!
IgorHey! Thanks for your time!
use preparedStatements.I'm trying that
Then use a wrapper class called
[url=http://www.javaworld.com/javaworld/jw-01-2002/jw-0
25-overpower.html]debuggableStatement. You willget the SQL that the driver is using.
Is that only for Debugging or can i use that in live code?
Thanks again,
Ryan -
Workspace to parse SQL statements from multiple database schema's
Hi ,
When go through the following link of workspace admin user :
Home>HTML DB Workspace Administration>Manage Services>Schema Reports>Workspace Schemas there I saw "Your workspace has the privilege to parse SQL statements using the following database schemas. Note that the terms database schema and database user can be used interchangeably.
" at the right pane.
So how can i make my workspace to parse SQL statements from multiple database schema's ?That must be listed there .But i have only one schema in view ? Can i make it multiple ?If then How ?
Anybody have an idea ?
ROSYAssign as many schemas to your workspace as you want using the administration app. Read about it in the doc.
Scott -
BusinessObject 4.0 API to get SQL statement from webi or crystal report
Hello,
Need your help.... could you confirm whether BusinessObjects 4.0 provides any SDK, API or Web Service to get physical SQL statement from the webi or crystal reports file?
If so, could you provide name of package, class and method?
If I am not wrong, there is an SDK in v3.0 that allows to extract the SQL. But I am reading a lot on these forums that lot of SDK classes and functions are deprecated / removed in v4.0.
Thanks for your help.
OmerFor Crystal Reports in BI 4.0 to retrieve the SQL query you can use Report Application Server SDK. Here is a code snippet that retrieves the SQL statement.
//oInfoObjectReport is of type IInfoObject corresponding to the crystal report.
ReportClientDocument reportClientDoc = reportAppFactory.openDocument(oInfoObjectReport, 0, Locale.ENGLISH);
//for all crystal reports
GroupPath grpPath = new GroupPath();
//get CR SQL query string
String reportSQL=reportClientDoc.getRowsetController().getSQLStatement(grpPath,null);
System.out.println("report SQL String: "+reportSQL);
//for report whose datasource is command object:
Tables tables = reportClientDoc.getDatabaseController().getDatabase().getTables();
for (int i = 0; i < tables.size(); i++)
ITable table = tables.getTable(i);
ICommandTable ic= (ICommandTable) table;
//Command can be obtained from the report using getCommandObject() method
//get CR SQL query string
String SQLText=ic.getCommandText();
System.out.println("SQLText_"+i+": "+SQLText);
Here are useful links for BI 4.0
[RAS API Specification|http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_rasjava_apiRef_en.zip]
[RAS Developer Guide|http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_rasjava_dg_en.zip]
Maybe you are looking for
-
my i tunes account for both my pc and i phone wont let me update or download any apps.
-
How to execute CGI Programs in Tomcat Server
Hi, I am working on executing Perl Scrtipts(or CGI programs) in Tomcat Server. I have downloaded ActivePerl 5.8.0 6.0.3 build.I have modified some .jar files in tomcat\server\lib. I have changed conf\web.xml to access the CGIServlet.class that is in
-
Bookmarks do not appear in the Bookmarks Toolbar
My Bookmarks toolbar is blank - there are sites in the folder.... I've just upgraded to Firefox 7. How can I get these bookmarks to show in the tool bar? (They do show when the sidebar is open, but I want them at the top as I had them.)
-
Our organization uses MS ISA server as firewall.
-
Hi I have a view, I like to create a update form for. Someone have a sample how to use a "instead of update trigger" with a form? I would like to have a report with a column link to the form, and the form use a "instead of update trigger" to update t