SlideShare a Scribd company logo
1 of 36
The Power and Possibilities of
      SQL Expressions
      Kurt Reinhardt, Crystal Advantage
Topics

      What is a SQL Expression?
      SQL Expressions Vs. Formulas
      SQL Expression Samples
      When to use a SQL Expression
      Troubleshooting SQL Expression errors
      Q&A




Slide 3        Copyright © 2006 Business Objects S.A. All rights reserved.
What is a SQL Expression?
SQL Expressions allow one to:
      Eliminate
      unnecessary
      subeports!
      Increase
      performance!
      Optimize efficiency!
      Reduce subreport
      instances!




Slide 4        Copyright © 2006 Business Objects S.A. All rights reserved.
What is a SQL Expression?

      Everybody wants to know!
           Knowledge base article c2016183 – What is the intended use of ‘SQL
            Expression Fields’? was one of the most visited articles for July 2006!
      Similar to Formulas but written in SQL
           Generally used against SQL-based databases
           Will be disabled if your database isn’t compatible
      SQL Concepts
           Subqueries / Subselects
           Correlated Vs. Uncorrelated




Slide 5               Copyright © 2006 Business Objects S.A. All rights reserved.
What is a SQL Expression?                                                         1/2
Correlated Subquery
      Fields from the Outer Query are passed to the Subquery:

          SELECT
            A.REPAIR_ORDER_ID,
            A.REPAIR_FACILITY_CD,
            NVL((SELECT
                   DECODE(X.FINDING_CONDITION_TXT,’TRUE’,’Y’,’N’)
                 FROM
                   RECORDED_FINDING_CONDITION X
                 WHERE
                   X.REPAIR_ORDER_ID = A.REPAIR_ORDER_ID
                   AND X.REPAIR_FACILITY_CD = A.REPAIR_FACILITY_CD
                   AND X.FINDING_QUESTION_ID = ‘smart_scope’
                   AND X. FINDING_CONDITION_ID = ‘TRUE’
                 ),’N’) SMART_SCOPE
          FROM
            FINDING_HEADER A


Slide 6             Copyright © 2006 Business Objects S.A. All rights reserved.
What is a SQL Expression?                                                         2/2
Uncorrelated Subquery
      The Subquery doesn’t relate to any fields:

          SELECT
            C."Customer ID",
            C."Customer Name",
            (
            SELECT
               SUM("Order Amount")
            FROM
               ORDERS
            ) 'Total Orders'
          FROM
            CUSTOMER C
          ORDER BY
            C."Customer ID"



Slide 7             Copyright © 2006 Business Objects S.A. All rights reserved.
What is a SQL Expression?

      General Guidelines to Consider
             Intended to be used against SQL-based databases
             Can be used against certain PC-based databases
             Can’t access Formula or Parameter fields
             Available functions are based on your db and method of connectivity
             SQL Expressions are always added as fields in the SELECT clause
             SQL Expressions must return a single, distinct value




Slide 8                Copyright © 2006 Business Objects S.A. All rights reserved.
Topics

      What is a SQL Expression?
      SQL Expressions Vs. Formulas
      SQL Expression Samples
      When to use a SQL Expression
      Troubleshooting SQL Expression errors
      Q&A




Slide 9        Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expressions Vs. Formulas

     Multi-pass Reporting
        SQL Expressions - processed on the database during Pass #1
        Formulas - many processed on the client during Pass #2
     Database Considerations
        SQL Expressions – used against SQL-based databases
        SQL Expressions – must be used against tables / views
        Formulas - can be used against any data source
     Report Design
        SQL Expressions – only reference database fields
        Formulas - can reference all other Crystal Reports field elements




Slide 10           Copyright © 2006 Business Objects S.A. All rights reserved.
Topics

     What is a SQL Expression?
     SQL Expressions Vs. Formulas
     SQL Expression Samples
     When to use a SQL Expression
     Troubleshooting SQL Expression errors
     Q&A




Slide 11      Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples

     Using SQL Expressions to prequery subreport data:
          Customer Report – grouped by Customer
          Has a subreport in the Group Footer
          The subreports don’t always have data, but still run every time
          Report performance suffers
          The database and network are impacted




Slide 12             Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     1/7
Prequery - Two customers, one with a blank subreport




Slide 13     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     2/7
Prequery - 322 subreport instances!




Slide 14     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    3/7
Prequery - Create a SQL Expression




Slide 15    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    4/7
Prequery - Check SQL Expression for NULLs with Formula




Slide 16    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     5/7
Prequery - Conditionally suppress subreport




Slide 17     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     6/7
Prequery - Conditionally suppress report section




Slide 18     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     7/7
Prequery - Only 196 instances in 1 minute 15 seconds!
That’s a 44% performance increase!




Slide 19     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples

     Using SQL Expressions to eliminate subreports:
          Report has a subreport that returns a single aggregate value
          A Shared Variable is used to pass the value back to the main report
          Main report uses the value in calculations
          Performance is not optimal due to subreport
          Report is overly complex




Slide 20            Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    1/2
Aggregate Value – Create SQL Expression




Slide 21    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     2/2
Aggregate Value – Use SQL Expression in calculations




Slide 22     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples

     Using SQL Expressions to optimize selection criteria:
          Listing of Practitioners with Missing or Incomplete SSNs
          Report uses Formulas in the Record Selection Criteria
          The Formula isn’t passed to the database for processing
          Performance suffers




Slide 23            Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     1/5
Optimization – Formulas in the Record Selection Criteria




Slide 24     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                            2/5
Optimization – The Formulas aren’t passed to the database
     Database|Show SQL Query
        Notice, there is no WHERE clause
        All possible records will be returned and filtered out on the Client
     Example of code below
           SELECT "ENTITY"."ENTITY", "PRACENT"."PRACID",
            "PRACENT"."NAME", "PRAC"."SSNUM",
            "ENTITY"."DESCRIPTION"
           FROM   ("ENTITY" "ENTITY" INNER JOIN "PRACENT"
            "PRACENT" ON "ENTITY"."ENTITY"="PRACENT"."ENTITY")
            INNER JOIN "PRAC" "PRAC" ON
            "PRACENT"."PRACNO"="PRAC"."PRACNO"
           ORDER BY "ENTITY"."ENTITY", "PRACENT"."NAME"




Slide 25            Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    3/5
Optimization – Create SQL Expressions




Slide 26    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                     4/5
Optimization – Substitute SQL Expressions for Formulas




Slide 27     Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                           5/5
Optimization –SQL Expressions ARE passed to the database!
     Database|Show SQL Query
        WHERE clause is present
        Only records that meet the criteria will be returned
     Example of code below
        …
       WHERE ("PRAC"."SSNUM" IS NULL OR ({fn
         RTRIM(PRAC."SSNUM")}
       )='' OR ({fn LENGTH(PRAC."SSNUM")}
       )<>11)
        ORDER BY "ENTITY"."ENTITY", "PRACENT"."NAME"




Slide 28           Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples

     Using SQL Expressions to filter against aggregates:
          Most Recent Orders by Customer
          The report lists all customers and their most recent order only
          Traditional Method 1: using a subreport to find the Max Order Date
          Traditional Method 2: suppressing all records via Group Selection
          Report is inefficient
          Performance suffers




Slide 29            Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    1/3
Most Recent – Create a SQL Expression




Slide 30    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                    2/3
Most Recent – Apply SQL Expression to Record Selection




Slide 31    Copyright © 2006 Business Objects S.A. All rights reserved.
SQL Expression Samples                                                           3/3
Most Recent – The filter is applied on the database!
     Database|Show SQL Query
        WHERE clause is present
        Only records that meet the criteria will be returned
     Example of code below
       …
       WHERE "Orders"."Order Date"=((
       SELECT
          MAX("ORDER DATE")
       FROM
          ORDERS
       WHERE
          "CUSTOMER ID" = "Customer"."Customer ID"
       ))
       …
Slide 32           Copyright © 2006 Business Objects S.A. All rights reserved.
Topics

     What is a SQL Expression?
     SQL Expressions Vs. Formulas
     SQL Expression Samples
     When to use a SQL Expression
     Troubleshooting SQL Expression errors
     Q&A




Slide 33      Copyright © 2006 Business Objects S.A. All rights reserved.
When to use SQL Expressions

     Generally in table-based reports
          Creating Views or Stored Procedures may not be an option
          Many companies limit database access for report writers
          The database may be proprietary
          It may be simpler to create a SQL Expression than to modify a View
          Stored Procedures and SQL Commands may limit functionality




Slide 34            Copyright © 2006 Business Objects S.A. All rights reserved.
Topics

     What is a SQL Expression?
     SQL Expressions Vs. Formulas
     SQL Expression Samples
     When to use a SQL Expression
     Troubleshooting SQL Expression errors
     Q&A




Slide 35      Copyright © 2006 Business Objects S.A. All rights reserved.
Troubleshooting SQL Expression Errors

     Only attempt to return a single, distinct value
     Use the most recent Service Pack
        Especially important for Crystal Reports 7 – Crystal Reports 8.5
     Some keywords are prohibited
     Try encapsulating your code in parentheses
        Required by some databases such as MS SQL Server
     Test the code in an analyzer first
     Copy the code from the analyzer




Slide 36           Copyright © 2006 Business Objects S.A. All rights reserved.
Q&A

     Questions
        Kurt Reinhardt, Crystal Advantage
        I will repeat questions to ensure everyone can hear
     Contact information
        Email: kreinhardt@crystaladvantage.com




Slide 37           Copyright © 2006 Business Objects S.A. All rights reserved.

More Related Content

What's hot

Power BI: From the Basics
Power BI: From the BasicsPower BI: From the Basics
Power BI: From the BasicsNikkia Carter
 
Can You Do That with APEX? Building Not So Straightforward Pages
Can You Do That with APEX? Building Not So Straightforward PagesCan You Do That with APEX? Building Not So Straightforward Pages
Can You Do That with APEX? Building Not So Straightforward PagesDimitri Gielis
 
Data Visualization Techniques in Power BI
Data Visualization Techniques in Power BIData Visualization Techniques in Power BI
Data Visualization Techniques in Power BIAngel Abundez
 
SQL Queries
SQL QueriesSQL Queries
SQL QueriesNilt1234
 
Power BI Overview
Power BI OverviewPower BI Overview
Power BI OverviewJames Serra
 
Microsoft power bi
Microsoft power biMicrosoft power bi
Microsoft power bitechpro360
 
Computer Science Internship Report PDF Leena AI
Computer Science Internship Report PDF Leena AIComputer Science Internship Report PDF Leena AI
Computer Science Internship Report PDF Leena AIshadowhazard77
 
Oracle BI publisher intro
Oracle BI publisher introOracle BI publisher intro
Oracle BI publisher introAdil Arshad
 
College management presentation using Oracle 10G
College management presentation using Oracle 10GCollege management presentation using Oracle 10G
College management presentation using Oracle 10GAIUB
 
DAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryDAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryWill Harvey
 
Sample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportSample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportMBAnetbook.co.in
 
Power BI Made Simple
Power BI Made SimplePower BI Made Simple
Power BI Made SimpleJames Serra
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express pptAbhinaw Kumar
 

What's hot (20)

Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Power Bi Basics
Power Bi BasicsPower Bi Basics
Power Bi Basics
 
Power BI: From the Basics
Power BI: From the BasicsPower BI: From the Basics
Power BI: From the Basics
 
Can You Do That with APEX? Building Not So Straightforward Pages
Can You Do That with APEX? Building Not So Straightforward PagesCan You Do That with APEX? Building Not So Straightforward Pages
Can You Do That with APEX? Building Not So Straightforward Pages
 
Data Visualization Techniques in Power BI
Data Visualization Techniques in Power BIData Visualization Techniques in Power BI
Data Visualization Techniques in Power BI
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
Power BI Overview
Power BI OverviewPower BI Overview
Power BI Overview
 
Microsoft power bi
Microsoft power biMicrosoft power bi
Microsoft power bi
 
OData Services
OData ServicesOData Services
OData Services
 
Major project synopsis format
Major project synopsis formatMajor project synopsis format
Major project synopsis format
 
Computer Science Internship Report PDF Leena AI
Computer Science Internship Report PDF Leena AIComputer Science Internship Report PDF Leena AI
Computer Science Internship Report PDF Leena AI
 
Oracle BI publisher intro
Oracle BI publisher introOracle BI publisher intro
Oracle BI publisher intro
 
Eg5 n
Eg5 nEg5 n
Eg5 n
 
College management presentation using Oracle 10G
College management presentation using Oracle 10GCollege management presentation using Oracle 10G
College management presentation using Oracle 10G
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
 
DAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryDAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power Query
 
Sample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportSample Acknowledgement of Project Report
Sample Acknowledgement of Project Report
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Power BI Made Simple
Power BI Made SimplePower BI Made Simple
Power BI Made Simple
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express ppt
 

Viewers also liked

Crystal Reports: Basics
Crystal Reports: BasicsCrystal Reports: Basics
Crystal Reports: BasicsNet at Work
 
Crystal report
Crystal reportCrystal report
Crystal reportEverywhere
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesInfoDev
 
Generate a report using crystal reports in visual studio 2010 code project
Generate a report using crystal reports in visual studio 2010   code projectGenerate a report using crystal reports in visual studio 2010   code project
Generate a report using crystal reports in visual studio 2010 code projectKaing Menglieng
 
Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Slideshare
 
Sao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnSao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnzBackupVN
 
Sage X3 Financials Fundamentals
Sage X3 Financials FundamentalsSage X3 Financials Fundamentals
Sage X3 Financials FundamentalsSiphelele Ngcobo
 
Sage HRMS Crystal Reports- Beyond the Basics
Sage HRMS Crystal Reports- Beyond the BasicsSage HRMS Crystal Reports- Beyond the Basics
Sage HRMS Crystal Reports- Beyond the BasicsNet at Work
 
برنامج كريستال لإدارة المغاسل الإصدار 3.0
برنامج كريستال لإدارة المغاسل الإصدار 3.0برنامج كريستال لإدارة المغاسل الإصدار 3.0
برنامج كريستال لإدارة المغاسل الإصدار 3.0cetrosoft
 
Crystal Reports
Crystal ReportsCrystal Reports
Crystal ReportsACOSI
 
Nota Pendidikan Islam Tahun 5 Israk dan Mikraj
Nota Pendidikan Islam Tahun 5 Israk dan MikrajNota Pendidikan Islam Tahun 5 Israk dan Mikraj
Nota Pendidikan Islam Tahun 5 Israk dan MikrajAminuddin Mohamad
 

Viewers also liked (19)

Crystal Reports: Basics
Crystal Reports: BasicsCrystal Reports: Basics
Crystal Reports: Basics
 
Crystal report
Crystal reportCrystal report
Crystal report
 
Crystal report
Crystal reportCrystal report
Crystal report
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise Features
 
Generate a report using crystal reports in visual studio 2010 code project
Generate a report using crystal reports in visual studio 2010   code projectGenerate a report using crystal reports in visual studio 2010   code project
Generate a report using crystal reports in visual studio 2010 code project
 
Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010
 
Sao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnSao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vn
 
Sage X3 Financials Fundamentals
Sage X3 Financials FundamentalsSage X3 Financials Fundamentals
Sage X3 Financials Fundamentals
 
05 gui 07
05 gui 0705 gui 07
05 gui 07
 
Slide isra-dan-mikraj
Slide isra-dan-mikrajSlide isra-dan-mikraj
Slide isra-dan-mikraj
 
Crystal repor
Crystal reporCrystal repor
Crystal repor
 
Cr8.5 usermanual
Cr8.5 usermanualCr8.5 usermanual
Cr8.5 usermanual
 
C# Crystal Reports
C# Crystal ReportsC# Crystal Reports
C# Crystal Reports
 
Sage HRMS Crystal Reports- Beyond the Basics
Sage HRMS Crystal Reports- Beyond the BasicsSage HRMS Crystal Reports- Beyond the Basics
Sage HRMS Crystal Reports- Beyond the Basics
 
برنامج كريستال لإدارة المغاسل الإصدار 3.0
برنامج كريستال لإدارة المغاسل الإصدار 3.0برنامج كريستال لإدارة المغاسل الإصدار 3.0
برنامج كريستال لإدارة المغاسل الإصدار 3.0
 
Asp.Net MVC 5
Asp.Net MVC 5Asp.Net MVC 5
Asp.Net MVC 5
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
Crystal Reports
Crystal ReportsCrystal Reports
Crystal Reports
 
Nota Pendidikan Islam Tahun 5 Israk dan Mikraj
Nota Pendidikan Islam Tahun 5 Israk dan MikrajNota Pendidikan Islam Tahun 5 Israk dan Mikraj
Nota Pendidikan Islam Tahun 5 Israk dan Mikraj
 

Similar to Crystal Reports - The Power and Possibilities of SQL Expressions

Step-by-Step Cookbook for Identifying and Tuning SQL Problems
Step-by-Step Cookbook for Identifying and Tuning SQL ProblemsStep-by-Step Cookbook for Identifying and Tuning SQL Problems
Step-by-Step Cookbook for Identifying and Tuning SQL ProblemsMinh237839
 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaMayank Prasad
 
Microsoft (SQL Server)
Microsoft (SQL Server)Microsoft (SQL Server)
Microsoft (SQL Server)Vinayak Hegde
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...GeneXus
 
BO Universe best practices
BO Universe best practicesBO Universe best practices
BO Universe best practicesMalin Johansson
 
SQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - OverviewSQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - OverviewCadaxo GmbH
 
Controlling execution plans 2014
Controlling execution plans   2014Controlling execution plans   2014
Controlling execution plans 2014Enkitec
 
MSBI Classroom Training with Realtime Project
MSBI Classroom Training with Realtime ProjectMSBI Classroom Training with Realtime Project
MSBI Classroom Training with Realtime ProjectSequelGate
 
Oracle Database features every developer should know about
Oracle Database features every developer should know aboutOracle Database features every developer should know about
Oracle Database features every developer should know aboutgvenzl
 
Barun_Practical_and_Efficient_SQL_Performance_Tuning
Barun_Practical_and_Efficient_SQL_Performance_TuningBarun_Practical_and_Efficient_SQL_Performance_Tuning
Barun_Practical_and_Efficient_SQL_Performance_TuningVlado Barun
 
Beyond SQL Tuning: Insider's Guide to Maximizing SQL Performance
Beyond SQL Tuning: Insider's Guide to Maximizing SQL PerformanceBeyond SQL Tuning: Insider's Guide to Maximizing SQL Performance
Beyond SQL Tuning: Insider's Guide to Maximizing SQL PerformanceAshish Agrawal
 
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...Embarcadero Technologies
 
common_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQLcommon_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQLShlomi Noach
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primaryKaizenlogcom
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosqlbharati k
 
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...Jens Kleinschmidt
 
Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroringwebhostingguy
 
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptxODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptxToon Koppelaars
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONMario Beck
 

Similar to Crystal Reports - The Power and Possibilities of SQL Expressions (20)

Step-by-Step Cookbook for Identifying and Tuning SQL Problems
Step-by-Step Cookbook for Identifying and Tuning SQL ProblemsStep-by-Step Cookbook for Identifying and Tuning SQL Problems
Step-by-Step Cookbook for Identifying and Tuning SQL Problems
 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance Schema
 
Chapter06.ppt
Chapter06.pptChapter06.ppt
Chapter06.ppt
 
Microsoft (SQL Server)
Microsoft (SQL Server)Microsoft (SQL Server)
Microsoft (SQL Server)
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
 
BO Universe best practices
BO Universe best practicesBO Universe best practices
BO Universe best practices
 
SQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - OverviewSQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - Overview
 
Controlling execution plans 2014
Controlling execution plans   2014Controlling execution plans   2014
Controlling execution plans 2014
 
MSBI Classroom Training with Realtime Project
MSBI Classroom Training with Realtime ProjectMSBI Classroom Training with Realtime Project
MSBI Classroom Training with Realtime Project
 
Oracle Database features every developer should know about
Oracle Database features every developer should know aboutOracle Database features every developer should know about
Oracle Database features every developer should know about
 
Barun_Practical_and_Efficient_SQL_Performance_Tuning
Barun_Practical_and_Efficient_SQL_Performance_TuningBarun_Practical_and_Efficient_SQL_Performance_Tuning
Barun_Practical_and_Efficient_SQL_Performance_Tuning
 
Beyond SQL Tuning: Insider's Guide to Maximizing SQL Performance
Beyond SQL Tuning: Insider's Guide to Maximizing SQL PerformanceBeyond SQL Tuning: Insider's Guide to Maximizing SQL Performance
Beyond SQL Tuning: Insider's Guide to Maximizing SQL Performance
 
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
 
common_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQLcommon_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQL
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primary
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosql
 
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...
ANSI SQL - a shortcut to Microsoft SQL Server/Azure SQL Database for Intersho...
 
Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroring
 
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptxODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSON
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Crystal Reports - The Power and Possibilities of SQL Expressions

  • 1. The Power and Possibilities of SQL Expressions Kurt Reinhardt, Crystal Advantage
  • 2. Topics What is a SQL Expression? SQL Expressions Vs. Formulas SQL Expression Samples When to use a SQL Expression Troubleshooting SQL Expression errors Q&A Slide 3 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 3. What is a SQL Expression? SQL Expressions allow one to: Eliminate unnecessary subeports! Increase performance! Optimize efficiency! Reduce subreport instances! Slide 4 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 4. What is a SQL Expression? Everybody wants to know!  Knowledge base article c2016183 – What is the intended use of ‘SQL Expression Fields’? was one of the most visited articles for July 2006! Similar to Formulas but written in SQL  Generally used against SQL-based databases  Will be disabled if your database isn’t compatible SQL Concepts  Subqueries / Subselects  Correlated Vs. Uncorrelated Slide 5 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 5. What is a SQL Expression? 1/2 Correlated Subquery Fields from the Outer Query are passed to the Subquery: SELECT A.REPAIR_ORDER_ID, A.REPAIR_FACILITY_CD, NVL((SELECT DECODE(X.FINDING_CONDITION_TXT,’TRUE’,’Y’,’N’) FROM RECORDED_FINDING_CONDITION X WHERE X.REPAIR_ORDER_ID = A.REPAIR_ORDER_ID AND X.REPAIR_FACILITY_CD = A.REPAIR_FACILITY_CD AND X.FINDING_QUESTION_ID = ‘smart_scope’ AND X. FINDING_CONDITION_ID = ‘TRUE’ ),’N’) SMART_SCOPE FROM FINDING_HEADER A Slide 6 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 6. What is a SQL Expression? 2/2 Uncorrelated Subquery The Subquery doesn’t relate to any fields: SELECT C."Customer ID", C."Customer Name", ( SELECT SUM("Order Amount") FROM ORDERS ) 'Total Orders' FROM CUSTOMER C ORDER BY C."Customer ID" Slide 7 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 7. What is a SQL Expression? General Guidelines to Consider  Intended to be used against SQL-based databases  Can be used against certain PC-based databases  Can’t access Formula or Parameter fields  Available functions are based on your db and method of connectivity  SQL Expressions are always added as fields in the SELECT clause  SQL Expressions must return a single, distinct value Slide 8 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 8. Topics What is a SQL Expression? SQL Expressions Vs. Formulas SQL Expression Samples When to use a SQL Expression Troubleshooting SQL Expression errors Q&A Slide 9 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 9. SQL Expressions Vs. Formulas Multi-pass Reporting  SQL Expressions - processed on the database during Pass #1  Formulas - many processed on the client during Pass #2 Database Considerations  SQL Expressions – used against SQL-based databases  SQL Expressions – must be used against tables / views  Formulas - can be used against any data source Report Design  SQL Expressions – only reference database fields  Formulas - can reference all other Crystal Reports field elements Slide 10 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 10. Topics What is a SQL Expression? SQL Expressions Vs. Formulas SQL Expression Samples When to use a SQL Expression Troubleshooting SQL Expression errors Q&A Slide 11 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 11. SQL Expression Samples Using SQL Expressions to prequery subreport data:  Customer Report – grouped by Customer  Has a subreport in the Group Footer  The subreports don’t always have data, but still run every time  Report performance suffers  The database and network are impacted Slide 12 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 12. SQL Expression Samples 1/7 Prequery - Two customers, one with a blank subreport Slide 13 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 13. SQL Expression Samples 2/7 Prequery - 322 subreport instances! Slide 14 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 14. SQL Expression Samples 3/7 Prequery - Create a SQL Expression Slide 15 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 15. SQL Expression Samples 4/7 Prequery - Check SQL Expression for NULLs with Formula Slide 16 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 16. SQL Expression Samples 5/7 Prequery - Conditionally suppress subreport Slide 17 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 17. SQL Expression Samples 6/7 Prequery - Conditionally suppress report section Slide 18 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 18. SQL Expression Samples 7/7 Prequery - Only 196 instances in 1 minute 15 seconds! That’s a 44% performance increase! Slide 19 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 19. SQL Expression Samples Using SQL Expressions to eliminate subreports:  Report has a subreport that returns a single aggregate value  A Shared Variable is used to pass the value back to the main report  Main report uses the value in calculations  Performance is not optimal due to subreport  Report is overly complex Slide 20 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 20. SQL Expression Samples 1/2 Aggregate Value – Create SQL Expression Slide 21 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 21. SQL Expression Samples 2/2 Aggregate Value – Use SQL Expression in calculations Slide 22 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 22. SQL Expression Samples Using SQL Expressions to optimize selection criteria:  Listing of Practitioners with Missing or Incomplete SSNs  Report uses Formulas in the Record Selection Criteria  The Formula isn’t passed to the database for processing  Performance suffers Slide 23 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 23. SQL Expression Samples 1/5 Optimization – Formulas in the Record Selection Criteria Slide 24 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 24. SQL Expression Samples 2/5 Optimization – The Formulas aren’t passed to the database Database|Show SQL Query  Notice, there is no WHERE clause  All possible records will be returned and filtered out on the Client Example of code below SELECT "ENTITY"."ENTITY", "PRACENT"."PRACID", "PRACENT"."NAME", "PRAC"."SSNUM", "ENTITY"."DESCRIPTION" FROM ("ENTITY" "ENTITY" INNER JOIN "PRACENT" "PRACENT" ON "ENTITY"."ENTITY"="PRACENT"."ENTITY") INNER JOIN "PRAC" "PRAC" ON "PRACENT"."PRACNO"="PRAC"."PRACNO" ORDER BY "ENTITY"."ENTITY", "PRACENT"."NAME" Slide 25 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 25. SQL Expression Samples 3/5 Optimization – Create SQL Expressions Slide 26 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 26. SQL Expression Samples 4/5 Optimization – Substitute SQL Expressions for Formulas Slide 27 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 27. SQL Expression Samples 5/5 Optimization –SQL Expressions ARE passed to the database! Database|Show SQL Query  WHERE clause is present  Only records that meet the criteria will be returned Example of code below … WHERE ("PRAC"."SSNUM" IS NULL OR ({fn RTRIM(PRAC."SSNUM")} )='' OR ({fn LENGTH(PRAC."SSNUM")} )<>11) ORDER BY "ENTITY"."ENTITY", "PRACENT"."NAME" Slide 28 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 28. SQL Expression Samples Using SQL Expressions to filter against aggregates:  Most Recent Orders by Customer  The report lists all customers and their most recent order only  Traditional Method 1: using a subreport to find the Max Order Date  Traditional Method 2: suppressing all records via Group Selection  Report is inefficient  Performance suffers Slide 29 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 29. SQL Expression Samples 1/3 Most Recent – Create a SQL Expression Slide 30 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 30. SQL Expression Samples 2/3 Most Recent – Apply SQL Expression to Record Selection Slide 31 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 31. SQL Expression Samples 3/3 Most Recent – The filter is applied on the database! Database|Show SQL Query  WHERE clause is present  Only records that meet the criteria will be returned Example of code below … WHERE "Orders"."Order Date"=(( SELECT MAX("ORDER DATE") FROM ORDERS WHERE "CUSTOMER ID" = "Customer"."Customer ID" )) … Slide 32 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 32. Topics What is a SQL Expression? SQL Expressions Vs. Formulas SQL Expression Samples When to use a SQL Expression Troubleshooting SQL Expression errors Q&A Slide 33 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 33. When to use SQL Expressions Generally in table-based reports  Creating Views or Stored Procedures may not be an option  Many companies limit database access for report writers  The database may be proprietary  It may be simpler to create a SQL Expression than to modify a View  Stored Procedures and SQL Commands may limit functionality Slide 34 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 34. Topics What is a SQL Expression? SQL Expressions Vs. Formulas SQL Expression Samples When to use a SQL Expression Troubleshooting SQL Expression errors Q&A Slide 35 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 35. Troubleshooting SQL Expression Errors Only attempt to return a single, distinct value Use the most recent Service Pack  Especially important for Crystal Reports 7 – Crystal Reports 8.5 Some keywords are prohibited Try encapsulating your code in parentheses  Required by some databases such as MS SQL Server Test the code in an analyzer first Copy the code from the analyzer Slide 36 Copyright © 2006 Business Objects S.A. All rights reserved.
  • 36. Q&A Questions  Kurt Reinhardt, Crystal Advantage  I will repeat questions to ensure everyone can hear Contact information  Email: kreinhardt@crystaladvantage.com Slide 37 Copyright © 2006 Business Objects S.A. All rights reserved.

Editor's Notes

  1. Business Objects Insight Americas 2006
  2. Business Objects Insight Americas 2006
  3. Business Objects Insight Americas 2006
  4. Business Objects Insight Americas 2006
  5. Business Objects Insight Americas 2006
  6. Business Objects Insight Americas 2006
  7. Business Objects Insight Americas 2006
  8. Business Objects Insight Americas 2006
  9. Business Objects Insight Americas 2006
  10. Business Objects Insight Americas 2006
  11. Business Objects Insight Americas 2006
  12. Business Objects Insight Americas 2006
  13. Business Objects Insight Americas 2006
  14. Business Objects Insight Americas 2006
  15. Business Objects Insight Americas 2006
  16. Business Objects Insight Americas 2006
  17. Business Objects Insight Americas 2006
  18. Business Objects Insight Americas 2006
  19. Business Objects Insight Americas 2006
  20. Business Objects Insight Americas 2006