QueryCAT Logo
Search 5,000,000+ questions and answers.

Frequently Asked Questions

How can I trace and/or profile SQL statements executed by OJB?

Frequently Asked Questions
OJB ships with out of the box support for P6Spy. P6Spy is a JDBC proxy which delegates all JDBC calls to the real JDBC driver and traces all calls to a log file. P6Spy is contained in the p6spy.jar, which you'll find in the lib folder of your OJB distribution. Add this to the classpath of your app (if you're using the ojb-blank project, then simply copy the jar into the lib folder of the project and if you're using Eclipse then also add it to the project build path).

Why do I receive duplicate trace messages for my trace statements?

Debugging - Windows Forms FAQs
This is possible if the same listener was added more than once to the Listeners list in Trace. This is possible even if an assembly that you linked to makes an additional entry for the same listener. Perform a check like this before adding a listener...

Is it possible to perform my own sql-queries in OJB?

Frequently Asked Questions
If you completely want to bypass the OJBquery-api see Can I directly obtain a java.sql.Connection within OJB?. A more elegant way is to use a QueryBySQL object: String sql = "SELECT A.Artikel_Nr FROM Artikel A, Kategorien PG" + " WHERE A.Kategorie_Nr = PG.Kategorie_Nr" + " AND PG.Kategorie_Nr = 2"; // get the QueryBySQL Query q2 = QueryFactory.newQuery(Article.class, sql); Iterator iter2 = broker.getIteratorByQuery(q2); // or Collection col2 = broker.getCollectionByQuery(q2);

How can I time my SQL statements in TCL?

FAQ
The TCL time or clock commands are useful for timing statements. More information is available in the documentation.

How do I view debug or trace statements when debugging an application in Visual Studio?

Debugging - Windows Forms FAQs
When your application is launched from Visual Studio in Debug mode, you will see all trace and debug messages in the Output window. Contributed from George Shepherd's Windows Forms FAQ

Why am I getting dupllicate trace messages for my trace statements?

Windows Forms FAQ - VS.NET Debugging
This is possible if the same listener was added more than once to the Listeners list in Trace. This is possible even if an assembly that you linked do makes an additional entry for the same listener.

Can one call DDL statements from PL/SQL?

PL/SQL FAQ - Oracle FAQ
One can call DDL statements like CREATE, DROP, TRUNCATE, etc. from PL/SQL by using the "EXECUTE IMMEDIATE" statement (native SQL). Examples: begin EXECUTE IMMEDIATE 'CREATE TABLE X(A DATE)'; end; begin execute Immediate 'TRUNCATE TABLE emp'; end; DECLARE var VARCHAR2(100); BEGIN var := 'CREATE TABLE temp1(col1 NUMBER(2))'; EXECUTE IMMEDIATE var; END; Users running Oracle versions below Oracle 8i can look at the DBMS_SQL package (see FAQ about Dynamic SQL).

Can I see what T-SQL statements are using Hints?

Reports
Yes, run the "Queries with Table Hints", "Queries with Query Hints", and "Queries with Join Hints" to find this information. Please, keep in mind that the filtering option: "Show Top (in %): N" will filter the top queries with most executions and then it will check them for Hints usage; this lowers quite a bit the impact on the server when running this report. reports.

How many SQL statements can I execute in one report processing?

PTReportGen FAQs - Report Generator for Microsoft PowerPoint
It is dependent on the license of PTReportGen you have purchased. For detailed information, see Licenses.

How can I find out how many rows were affected by an SQL statement after I have executed it ?

The Oracle (tm) Users' Co-operative FAQ - Index
Is it possible to write a trigger referencing more than one table - I want a trigger to audit a master/detail pair. Is it possible to easily convert existing SQL scripts into a format that cannot be read or altered? This is to improve security on an existing site.

Can one use dynamic SQL statements from PL/SQL?

PL/SQL FAQ - Oracle FAQ
Starting from Oracle8i one can use the "EXECUTE IMMEDIATE" statement to execute dynamic SQL and PL/SQL statements (statements created at run-time). Look at these examples. Note that the statements within quotes are NOT semicolon terminated: EXECUTE IMMEDIATE 'CREATE TABLE x (a NUMBER)'; -- Using bind variables... sql_stmt := 'INSERT INTO dept VALUES (:1, :2, :3)'; EXECUTE IMMEDIATE sql_stmt USING dept_id, dept_name, location; -- Returning a cursor..

Can I find if hints are being used in the t-sql statements run on the SQL Server?

Other FAQs
Yes, run the "Query Optimizer" report. It will provide you with different statistics including the use of hints (i.e. table, join, plan, etc.)

How can I see debug/trace statements when I run my application in debug mode?

Windows Forms FAQ - VS.NET Debugging
When your application is launched from the VS.NET IDE in Debug mode, you will see all trace and debug messages in the Output window calling:

Can I integrate the existing SQL statements into the Scribe procedures?

Frequently Asked Questions
Direct SQL mode of the Database Retrieval component allows freely-formatted SQL SELECT statements of any degree of complexity to be added to the procedures. The SQLCommand system function can be used to run SQL statements that add, update and delete rows in the database tables.

top] How to see SQL statements issued by DbUnit using P6Spy?

DbUnit - Frequently Asked Questions
P6Spy is a transparent JDBC proxy-driver specialized to log the statements performed against the actual driver you normally would use. Using p6spy would allow to log the SQL statements issued by DbUnit. Move spy.properties into a directory listed in your classpath. Unlike JAR files, you do not directly reference your property file in the classpath (e.g.: if you have the file c:\r\proj\conf\spy.properties make sure you put c:\r\proj\conf in the classpath). Modify the realdriver line in the spy.

I'm having problems with apostrophies and SQL statements. What's going on?

ColdFusion FAQ
ColdFusion will automatically escape an apostrophe if it's in a variable value that you're inserting into a database. It escapes it by doubling it up from ' to ''. For exmple, if Var1 and Var2 contain apostrophies, you don't need to worry about escaping the following code.

When and why are quotes needed in <CFQUERY> SQL statements?

CFFaq.com
All content in between <CFQUERY> and </CFQUERY> is sent to the database via the database driver as is. Unlike CFML, SQL is not typeless, and so SQL statements must be complete and valid as per SQL syntax specifications. All strings (or variables being used as string values) must be enclosed within singe quotes. Similarly, all numeric values must not be within quotes, and all dates and times must be formatted as valid date and time values.

When I roll back an update routine, some sql statements are not rolled back. Why?

Database schema updater
There are a couple of sql statements that cannot be executed inside a transaction. User and db space creation are examples of such statements. These are special statements that seldom you will need to synchronize. DbUpdater executes first these statements and then starts a transaction for all the other sql statements. As a consequence, rolling back the transaction will leave these entities changed.

How should I escape text in SQL statements, and express dates and times?

FAQ for the microsoft.public.languages.csharp newsgroup
The answer here is not to put the data in your SQL statements at all, but to use parameters. Every data provider worth using provides a way of specifying parameters in SQL statements, either named (e.g. SELECT NAME FROM PEOPLE WHERE ID=@ID) or positional (e.g. SELECT NAME FROM PEOPLE WHERE ID=?). Some providers only support positional parameters, others only support named parameters, others support both.

What is My Profile?

Frequently Asked Questions | OurStage.com
The My Profile section of OurStage is your personal destination on the site. For example, all of the blocks on the page are now movable and editable, and have a great new appearance to them. Blocks can be added or removed from the page, and you can now see who is in your fan clubs or are your friends. This way, you can show off the size of your fan club to your friends and competitors, and help message to your fans about upcoming shows, new albums, and more.
More Questions >>

© Copyright 2007-2012 QueryCAT
About • Webmasters • Contact