How to Retrieve SQL Statements in RDF Reports
I need to retrieve the SQL statements from my reports without having to call each of them up in Reports Builder. The reports are in binary (RDF format). Does anyone know of a way to do this?
Hello,
Convert your RDF into a text format :
- REX
- XML/HTML/JSP if your are using Reports 9.0.x or greater)
and search in these text files .
Regards
Similar Messages
-
How to retrieve SQL statement in the CR 2008
I'm using Crystal Reports 2008 in MS Visual Studio 2008, how can i retrieve SQL statement from *.rpt file, i have tried this code, but it doesn't work:
ReportDocument rdReport = new ReportDocument();
rdReport.Load("Reports/EmployeeTest.rpt", OpenReportMethod.OpenReportByTempCopy);
CrystalDecisions.ReportAppServer.Controllers.RowsetController rsController;
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rdClient = rdReport.ReportClientDocument; // on this line it throws an exception "The ReportClientDocument property can only be accessed when the report is opened using a Report Application Server."
CrystalDecisions.ReportAppServer.DataDefModel.ISCRGroupPath rdGroupPath = new CrystalDecisions.ReportAppServer.DataDefModel.GroupPath();
string temp;
string sql;
rsController = rdClient.RowsetController;
sql = rsController.GetSQLStatement(rdGroupPath, out temp);
maybe i'm doing something wrong ?
thanksHello Ludek,
when I try to get the report from the session I got an error like this (I am using State Server Session mode i.e out proc in my application)
ReportClientDocument 'reportDocument.ReportClientDocument' threw an exception of type 'System.InvalidOperationException' CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument {System.InvalidOperationException}
+base {"The ReportClientDocument property can only be accessed when the report is opened using a Report Application Server."} System.SystemException {System.InvalidOperationException}
StackTrace " at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_ReportClientDocument()" string
so is it the problem of not opened with RAS. Does installation of RAS solves the problem, If so Is it a free-ware or needs to be purchased.
Ashok -
Passing parameter into SQL statement in Crystal Reports
Hi all,
I would like to call Crystal Reports in JSP. I can handle it well now. But I hope to let user input their selection criteria before printing out the report. I know how to get the parameter value in JSP, but I really dunno how to pass these parameter values into the SQL statement in Crystal Report. Actually, is it possible to do so?
If anyone has idea, please tell me. Thx Thx!
Regards,
BettyDear Sir,
I want to use Crystal Report as a web base using JSP. But, I am getting how to call .rpt file in .jsp file & passing of parameter.
If you have any idea, please reply as early as possible
Thanking U.
My userid = [email protected]
Regds
Pankaj.. -
Get an set the SQL statement from a report at runtime
i know there is an opportunity to filter the records by using setRecordSelectionFormula() method...but i wondered if you can anyhow get the whole SQL statement that is in the report. i think it would be very useful for many developers to maipulate the SQL directly like you were able to using the PE-functions in the old CRPE32.DLL...
but in CR XI the CRPE32.DLL is no longer supported. now we have to substitute these functions with the JRC but i am not sure if it provides everything we had in the CRPE32.DLL...
after all i do not understand why the CRPE32.DLL is still delivered but not supported. in my CR XI R2 installtion i found this file signed with version 11.5.3.438
by the way it is a question of performance...a query would be faster if you could directly query the database by changing the reports sql statement instead of allowing the report to retrieve all data and then performing the filtering.
so please, for the next version of the JRC give us the opportunity to get an set the sql statement of a report directly!Not an option. crpe32 is proprietory and the SQL we generate is to complex to assume it will be done correctly. Which is why the ability was removed
-
Adding a field to an sql statement in Oracle Reports error ORA-00933
We have been requested to add a field that already exists in the table referred to by the sql statement in Oracle Reports Builder. The report was set up by a consultant about 3 yrs ago and we don't really have much skill in this area. What is happening when I try to modify the SQL statement, either adding a field or deleting a field to the SELECT statement, causes an error message preventing the statement from being saved. The only way out of the error message is to click Cancel. The error message is
ORA-00933:SQL command not properly ended
ORDER BY Program ==> NAME
Even adding or deleting a space anywhere in the SQL statement causes the error (not adding any new fields). A coworker found that if we comment out the ORDER BY, the statement will accept the new field in the SELECT section, however then we lose the order by functionality. I would like to add one additional field before the FROM. Not sure if any additional data are needed. Thank you.
SELECT p.person_uid PIDM_KEY, p.id_number ID,
p.full_name_lfmi name,
p.BIRTH_DATE, p.GENDER Sex,
Decode(a.residency,'D',p.Primary_ethnicity,'F') Ethn,
a.academic_period TERM,
CASE WHEN :p_group_by = 'PROGRAM' THEN a.program
ELSE ' '
END AS Program,
a.COLLEGE, a.degree, a.major, ' ' rule,
a.STUDENT_POPULATION,a.STUDENT_LEVEL, a.application_status Status, a.application_status_date app_sts_dte,
ad.decision_date1 Last_Dec_Date,
ad.decision1||' '||ad.decision2||' '|| ad.decision3||' '|| ad.decision4||' '|| ad.decision5 Decisions,
/* Deposit Date uses the last term entered in :p_term parameter string */
(SELECT MAX(deposit_effective_date) FROM usf_as_deposit WHERE account_uid = a.person_uid &term_clause group by account_uid) AS "DEPOSIT DATE",
ph.phone as PHONE,
CASE WHEN PS.FIRST_CONTACT IN ('NET','PAP','COM','COP') THEN PS.First_Contact
ELSE CASE WHEN ps.latest_contact IN ('NET','PAP','COM','COP') THEN PS.Latest_Contact
ELSE ' '
END
END AS FIRST_CONTACT,
DECODE(:p_address,'Y',REPLACE(adr.street1||' '||adr.street2||' '||adr.street3||' '||adr.city||','||adr.state||' '||adr.nation||' '||adr.zip,' ',' '),' ') as address, adr.nation, adr.state,
goremal_email_address email, a.residency, a.application_date, p.primary_ethnicity, c.cohort
FROM MST_ADMISSIONS_APPLICATION A,
MST_PERSON p,mst_pre_student PS, Admissions_Cohort c, usf_v_phone_pr_ma ph,
MST_admissions_decision_slot AD, usf_v_email, usf_v_address_dr_lr_ma_pr adr
WHERE a.PERSON_UID = p.person_uid
AND a.curriculum_priority = 1
AND a.person_uid = ps.person_uid
AND a.person_uid = ad.person_Uid(+)
AND a.person_uid = goremal_pidm(+)
AND a.person_uid = adr.pidm(+)
AND a.person_uid = ph.pidm(+)
AND ph.rnum(+) = 1
AND a.person_uid = c.person_uid(+)
AND a.academic_period = c.academic_period(+)
&Where_Clause
/* TAKE OUT FOLLOWING LINE AFTER DATA IS CLEANED UP */
AND NOT(p.id_number = '00000000' OR SUBSTR(p.id_number,1,1) = 'B' OR UPPER(p.full_name_lfmi) LIKE '%TESTING%')
AND a.application_status_date >= NVL(:p_as_of_date,sysdate-8000)
AND a.academic_period = ad.academic_period(+)
AND a.application_number = ad.application_number(+)
AND a.degree <> 'ND' /* AND a.college <> 'LW' -- Does not need non-degree and law students */
&Cohort_Clause
ORDER BY Program &ORDER_CLAUSEHi Denis,
I tried your suggestion. The good thing is that adding the comma allowed me to be able to add a.campus to the select statement, unfortunately, another error message happened.
ORA-00936: missing expression SELECT p . person_uid PIDM_KEY ,
p . id_number , p . full_name_lfmi name , p . BIRTH_DATE , p . GENDER Sex ,
Decode ( a . residency , 'D' , p . Primary_Ethnicity , 'F' ) Ethn , a . academic_period TERM ,
CASE WHEN : P_group_by = 'PROGRAM THEN a I started over and tried only putting in the comma and get the same message even though I didn't add campus. After that, removed the comma which led to the ORA-00933 error message. So once again, I had to close the file without saving, in order for the report to run at all. -
How to find sql statement with Unix process pid
Hi
how to find sql statement with Unix process pid
is there any view to find that.
please if so let me know
Thanks in advancethis is how I am doing this:
oracle 7352340 7459066 0 07:47:10 - 0:00 oracleJDERED (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 7459066 5386396 2 07:47:10 pts/1 0:01 sqlplus
select sid,serial# from v$session where process='7459066';
SID SERIAL#
2178 6067
select sql_text
from
v$sqlarea a,
v$session b
where a.hash_value = b.sql_hash_value
and b.sid = 2178
; -
XML Publisher - can we specify multiple SQL statements in the report?
Hi there,
can we specify multiple SQL statements in the report with XML Publisher?
Regards,
LiviuCould we eventually generate with the Wizards available in XML Publisher desktop 5.6.2 an xml file with a structure like the one given below? The reason is to facilitate creation of the two rowsets. Thanks, Liviu.
<?xml version="1.0" encoding="UTF-8"?>
<DATA>
<ROWSET2>
<ROW2>
<FIELD1>Query1</FIELD1>
<FIELD2>field2</FIELD2>
<FIELD3>field3</FIELD3>
</ROW2>
</ROWSET2>
<ROWSET>
<ROW>
<FIELD1>Query2</FIELD1>
<FIELD2>field2</FIELD2>
<FIELD3>field3</FIELD3>
</ROW>
</ROWSET>
</DATA> -
Retrieve SQL Statement from Transaction_ID
Hi,
Is there any way to retrieve SQL Statement for LOCAL/SOURCE_TRANSACTION_ID listed in DBA_APPLY_ERROR ?
Database version: 11.2.0.2
Thanks,
BSS.Hi,
I am not sure if you can get that sql_id but if you use LOGMINER can get the SQL Text (ie.V$LOGMNR_CONTENTS.SQL_REDO) for a given transaction id.
hth,
Pradeep -
we have 1 server oracle and many clients.
when client sends sql statement to server.How to Capture sql statement to analysis berfore it sent to server and execution.
Edited by: 955185 on Aug 27, 2012 4:22 AM955185 wrote:
yes. how to do this?Check these link all of them talking about Already executed sql in database by Users , but i don't know if what you ask is possible since they already connect to database
If you attending to analysis sql read the below links and start your analysis,
Last executed sql
http://www.databasejournal.com/features/oracle/article.php/3373701/Watching-SQL-Execute-on-Oracle---Part-I.htm
http://stackoverflow.com/questions/55899/how-to-see-the-actual-oracle-sql-statement-that-is-being-executed -
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 Print BARCODE in oracle RDF report
Hi,
We are trying to print BARCODE for Order Number in RDF report. Kindly let me know how to do this.
Thanks & Regards,
Suresh897745 wrote:
Hi,
We are trying to print BARCODE for Order Number in RDF report. Kindly let me know how to do this.It's very easy. Download a font which show barcode then choose your desire field's font that font. I use IDAutomationHC39M font.
Hope this will help you. -
How to print message in oracle rdf report output?
Hi,
There is a requirement to print message in output of oracle rdf report. srw.message prints the message in log file but how to print message in output.
Please suggest.
Thanks & Regards,
Sunita897745 wrote:
Hi,
We are trying to print BARCODE for Order Number in RDF report. Kindly let me know how to do this.It's very easy. Download a font which show barcode then choose your desire field's font that font. I use IDAutomationHC39M font.
Hope this will help you. -
How to process sql statements stored in a table
I have a rule table that contain rule_type, rule_status and rule_condition. The rule condition is a sql statement. In a report I need to be able to expand this condtion based on the status selected. E.g When rule status is terminated the rule_condition is as below. When a user pick terminated status, I need to be able to go to the table and expand the sql statement. Another example is active status.
RULE_STATUS TERMINATED
SELECT leaseid
FROM leatatt
WHERE txtattid = 'LEAS END'
and value = 'TERMINATED'
RULE_STATUS ACTIVE
SELECT leaseid
FROM lease
WHERE redoc_class = 'MASTER'
AND TRUNC(SYSDATE) <=
NVL(TRUNC(enddate),TRUNC(SYSDATE)+1)
AND functional_status IN ('ACTIVE','OVERHOLD')
Any suggestion will be appreciated.Please refer to
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:246014735810
I am sure you would be twist this to bring it in to your use.
<PRE>
the proper way to do this is to NOT use a PLSQL table type but to use a SQL Object Type
instead. It would look like this:
[email protected]> create or replace type myScalarType as object
2 ( x int,
3 y date,
4 z varchar2(25)
5 )
6 /
Type created.
[email protected]> create or replace type myTableType as table of myScalarType;
2 /
Type created.
[email protected]> create or replace
2 function demo_proc( p_start_row in number,
3 p_end_row in number )
4 return myTableType
5 as
6 l_data myTableType := myTableType();
7 l_cnt number default 0;
8 begin
9 for x in ( select * from emp order by sal desc )
10 loop
11 l_cnt := l_cnt + 1;
12 if ( l_cnt >= p_start_row )
13 then
14 l_data.extend;
15 l_data(l_data.count) :=
16 myScalarType( x.empno,
17 x.hiredate,
18 x.ename );
19 end if;
20 exit when l_cnt = p_end_row;
21 end loop;
22
23 return l_data;
24 end;
25 /
Function created.
[email protected]> select *
2 from the ( select cast( demo_proc(2,6) as mytableType )
3 from dual ) a
4 /
X Y Z
7788 09-DEC-82 SCOTT
7902 03-DEC-81 FORD
7566 02-APR-81 JONES
7698 01-MAY-81 BLAKE
7782 09-JUN-81 CLARK
[email protected]>
</PRE> -
How to find SQL Statement fired using SYS.AUD$ - Database Auditing
Dear Friends
I am having Oracle 9i Database and have configured it with database auditing option by setting the following parameter in init.ora file
AUDIT_TRAIL = "DB"
I want to audit SELECT, INSERT , UPDATE and DELETE operations on PRACTICE.EMP table for which I did :
1) Logged in as SYS
2) SQL> AUDIT SELECT, INSERT, UPDATE, DELETE
ON PRACTICE.EMP
BY ACCESS
WHENEVER SUCCESSFUL;
Audit Succedded
Now how should I find out the SQL statement that does the insert, update or delete operation on the EMP table using SYS.AUD$ table
ThanksHi,
It's contents can be viewed directly or via the following views:
* DBA_AUDIT_EXISTS
* DBA_AUDIT_OBJECT
* DBA_AUDIT_SESSION
* DBA_AUDIT_STATEMENT
* DBA_AUDIT_TRAIL
* DBA_OBJ_AUDIT_OPTS
* DBA_PRIV_AUDIT_OPTS
* DBA_STMT_AUDIT_OPTS
The audit trail contains a lot of data, but the following are most likely to be of interest:
* Username : Oracle Username.
* Terminal : Machine that the user performed the action from.
* Timestamp : When the action occured.
* Object Owner : The owner of the object that was interacted with.
* Object Name : The name of the object that was interacted with.
* Action Name : The action that occured against the object. (INSERT, UPDATE, DELETE, SELECT, EXECUTE)
So, take a look at action_name column from DBA_AUDIT_TRAIL view.
Cheers
Legatti -
How to find SQL statement = Database Auditing
Dear All
I have configured Database Auditing on Oracle 9i Enterprise Edition Server
parameter init.ora file:
AUDIT_TRAIL = "DB"
I want to audit INSERT,UPDATE, DELETE STATEMENT on PRACTICE.EMP table
for which i did :
1) Logged in as SYS
SQL> AUDIT INSERT,UPDATE,DELETE
ON PRACTICE.EMP
BY ACCESS
WHENEVER SUCCESSFUL
Audit Succedded
2) Now I have to check the SQL statement that did insert update or delete operation using SYS.AUD$
3) There is SQLTEXT field , datatype is CLOB.
How should I check the SQL Statements that were fired on PRACTICE.EMP table
Kindly helpSQL> show user
USER is "SYS"
SQL> alter system set audit_trail = db,extended scope=spfile;
alter system set audit_trail = db,extended scope=spfile
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE specified at startup
I have init.ora but no spifle so should I create SPFILE based on INIT.ORA and then give the command ?
As of now I am using V$SQL view to find all the commands executed on my database.
I found one good book "Oracle Security" OREILY PUBLICATION in which Auditing Database is discussed in good details.
Thank you so much for all your efforts
Maybe you are looking for
-
Errors in implementing Text Layout Framework text flow- selection event not found
please help me i have implemented the same project givan at adobe open source code site. This is my code <?xml version="1.0" encoding="utf-8"?> <!-- ADOBE SYSTEMS INCORPORATED Copyright 2008 Adobe Systems Incorporated All Rights Reserved. NOTICE: Ad
-
Business Intelligence Installation Error
I am having an issue creating a package within BIDS. So, far my PC has the following installed. 1. Microsoft Server SQL 2008 R2 a. Management Studio b. SQL Server Business Intelligence Development Tools 2. Microsoft Visual Studio 2008
-
IE Crashes with signed applet.
I've been having problems in the last few days where my signed applet will crash on one server, and will not on the other. The server it doesn't crash on never crashes, where as the one it does crash on, will always crash. The certificate is currentl
-
Conversion of Flat file to tables in oracle
hi i am doing my project in oracle and i have got stuck up at a point where i have to convert flat files to tables in oracle Please suggest a solution for the above problem Regards, Mahesh
-
How to connect to data base in web dynpro development?
hi, I am a green man in web dynpro development.I don't know how to create a connection to database in web dynpro development.I don't know wether we must create a DC to commit the mission.Hope to hear from you.Thank you!