dbTalk Databases Forums  

Help with building an Oracle View for Crystal Reports

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Help with building an Oracle View for Crystal Reports in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cory.swartz
 
Posts: n/a

Default Help with building an Oracle View for Crystal Reports - 04-24-2007 , 01:32 PM






I'm not sure if this is more Crystal related or a problem with my
Oracle view I created... here is the view script:
================================================== ================================

Select
CMDSERIES.ORDR.CUST_CODE,
CMDSERIES.ORDR.CUST_NAME,
CMDSERIES.ORDR.PROJ_CODE,
CMDSERIES.ORDR.PRICE_PLANT_CODE,
CMDSERIES.ORDR.SLSMN_EMPL_CODE,
CMDSERIES.ORDR.ORDER_DATE,
CMDSERIES.ORDR.ORDER_CODE,
CMDSERIES.ORDL.ORDER_DATE,
CMDSERIES.ORDL.ORDER_CODE,
CMDSERIES.ORDL.PROD_CODE,
CMDSERIES.ORDL.PROD_DESCR,
CMDSERIES.ORDL.PRICE_QTY,
CMDSERIES.ORDL.PRICE,
CMDSERIES.PROJ.PROJ_CODE,
CMDSERIES.PROJ.PROJ_NAME,
CMDSERIES.PROJ.CA_SALES_ANL_CODE,
CMDSERIES.EMPL.EMPL_CODE,
CMDSERIES.EMPL.NAME,
CMDSERIES.PLNT.PLANT_CODE,
CMDSERIES.PLNT.NAME
From
CMDSERIES.ORDR,CMDSERIES.ORDL,CMDSERIES.PROJ,CMDSE RIES.EMPL,CMDSERIES.PLNT
WHERE
((CMDSERIES.ORDR.CUST_CODE=CMDSERIES.PROJ.CUST_COD E)
AND(CMDSERIES.ORDR.ORDER_DATE=CMDSERIES.ORDL.ORDER _DATE)
AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_C ODE)
AND(CMDSERIES.ORDR.ORDER_CODE=CMDSERIES.ORDL.ORDER _CODE)
AND(CMDSERIES.ORDR.SLSMN_EMPL_CODE=CMDSERIES.EMPL. EMPL_CODE)
AND(CMDSERIES.ORDR.PRICE_PLANT_CODE=CMDSERIES.PLNT .PLANT_CODE))

================================================== ================================

My issue is with the CMDSERIES.ORDR.PROJ_CODE field. We have orders
that exist (ORDR.ORDER_CODE and ORDR.ORDER_DATE both exist), but do
not contain any data in the ORDR.PROJ_CODE field. I want to display
these orders, but when I remove the
"AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_ CODE)" from the
WHERE clause, I get thousands and thousands of duplicate records in my
Crystal Report. Any assistance would be greatly appreciated.

Thanks!


Reply With Quote
  #2  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: Help with building an Oracle View for Crystal Reports - 04-24-2007 , 01:47 PM






On 24 Apr 2007 11:32:28 -0700, "cory.swartz" <cory.swartz (AT) icmatls (DOT) com>
wrote:

Quote:
I'm not sure if this is more Crystal related or a problem with my
Oracle view I created... here is the view script:
Just lousy database design and lack of SQL knowledge.
Please look up OUTER JOIN in the documentation.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Help with building an Oracle View for Crystal Reports - 04-24-2007 , 03:21 PM



cory.swartz wrote:
Quote:
I'm not sure if this is more Crystal related or a problem with my
Oracle view I created... here is the view script:
================================================== ================================

Select
CMDSERIES.ORDR.CUST_CODE,
CMDSERIES.ORDR.CUST_NAME,
CMDSERIES.ORDR.PROJ_CODE,
CMDSERIES.ORDR.PRICE_PLANT_CODE,
CMDSERIES.ORDR.SLSMN_EMPL_CODE,
CMDSERIES.ORDR.ORDER_DATE,
CMDSERIES.ORDR.ORDER_CODE,
CMDSERIES.ORDL.ORDER_DATE,
CMDSERIES.ORDL.ORDER_CODE,
CMDSERIES.ORDL.PROD_CODE,
CMDSERIES.ORDL.PROD_DESCR,
CMDSERIES.ORDL.PRICE_QTY,
CMDSERIES.ORDL.PRICE,
CMDSERIES.PROJ.PROJ_CODE,
CMDSERIES.PROJ.PROJ_NAME,
CMDSERIES.PROJ.CA_SALES_ANL_CODE,
CMDSERIES.EMPL.EMPL_CODE,
CMDSERIES.EMPL.NAME,
CMDSERIES.PLNT.PLANT_CODE,
CMDSERIES.PLNT.NAME
From
CMDSERIES.ORDR,CMDSERIES.ORDL,CMDSERIES.PROJ,CMDSE RIES.EMPL,CMDSERIES.PLNT
WHERE
((CMDSERIES.ORDR.CUST_CODE=CMDSERIES.PROJ.CUST_COD E)
AND(CMDSERIES.ORDR.ORDER_DATE=CMDSERIES.ORDL.ORDER _DATE)
AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_C ODE)
AND(CMDSERIES.ORDR.ORDER_CODE=CMDSERIES.ORDL.ORDER _CODE)
AND(CMDSERIES.ORDR.SLSMN_EMPL_CODE=CMDSERIES.EMPL. EMPL_CODE)
AND(CMDSERIES.ORDR.PRICE_PLANT_CODE=CMDSERIES.PLNT .PLANT_CODE))

================================================== ================================

My issue is with the CMDSERIES.ORDR.PROJ_CODE field. We have orders
that exist (ORDR.ORDER_CODE and ORDR.ORDER_DATE both exist), but do
not contain any data in the ORDR.PROJ_CODE field. I want to display
these orders, but when I remove the
"AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_ CODE)" from the
WHERE clause, I get thousands and thousands of duplicate records in my
Crystal Report. Any assistance would be greatly appreciated.

Thanks!
http://www.psoug.org
Click on Morgan's Library
Click on Joins
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
cory.swartz
 
Posts: n/a

Default Re: Help with building an Oracle View for Crystal Reports - 04-26-2007 , 01:57 PM



On Apr 24, 4:21 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
cory.swartz wrote:
I'm not sure if this is more Crystal related or a problem with my
Oracle view I created... here is the view script:
================================================== =========================*=======

Select
CMDSERIES.ORDR.CUST_CODE,
CMDSERIES.ORDR.CUST_NAME,
CMDSERIES.ORDR.PROJ_CODE,
CMDSERIES.ORDR.PRICE_PLANT_CODE,
CMDSERIES.ORDR.SLSMN_EMPL_CODE,
CMDSERIES.ORDR.ORDER_DATE,
CMDSERIES.ORDR.ORDER_CODE,
CMDSERIES.ORDL.ORDER_DATE,
CMDSERIES.ORDL.ORDER_CODE,
CMDSERIES.ORDL.PROD_CODE,
CMDSERIES.ORDL.PROD_DESCR,
CMDSERIES.ORDL.PRICE_QTY,
CMDSERIES.ORDL.PRICE,
CMDSERIES.PROJ.PROJ_CODE,
CMDSERIES.PROJ.PROJ_NAME,
CMDSERIES.PROJ.CA_SALES_ANL_CODE,
CMDSERIES.EMPL.EMPL_CODE,
CMDSERIES.EMPL.NAME,
CMDSERIES.PLNT.PLANT_CODE,
CMDSERIES.PLNT.NAME
From
CMDSERIES.ORDR,CMDSERIES.ORDL,CMDSERIES.PROJ,CMDSE RIES.EMPL,CMDSERIES.PLNT
WHERE
((CMDSERIES.ORDR.CUST_CODE=CMDSERIES.PROJ.CUST_COD E)
AND(CMDSERIES.ORDR.ORDER_DATE=CMDSERIES.ORDL.ORDER _DATE)
AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_C ODE)
AND(CMDSERIES.ORDR.ORDER_CODE=CMDSERIES.ORDL.ORDER _CODE)
AND(CMDSERIES.ORDR.SLSMN_EMPL_CODE=CMDSERIES.EMPL. EMPL_CODE)
AND(CMDSERIES.ORDR.PRICE_PLANT_CODE=CMDSERIES.PLNT .PLANT_CODE))

================================================== =========================*=======

My issue is with the CMDSERIES.ORDR.PROJ_CODE field. We have orders
that exist (ORDR.ORDER_CODE and ORDR.ORDER_DATE both exist), but do
not contain any data in the ORDR.PROJ_CODE field. I want to display
these orders, but when I remove the
"AND(CMDSERIES.ORDR.PROJ_CODE=CMDSERIES.PROJ.PROJ_ CODE)" from the
WHERE clause, I get thousands and thousands of duplicate records in my
Crystal Report. Any assistance would be greatly appreciated.

Thanks!

http://www.psoug.org
Click on Morgan's Library
Click on Joins
--
Daniel A. Morgan
University of Washington
damor...@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -
Apologies for the double post. IT dept is at it with their web
caching.

Thanks for the info Daniel. I was messing around with out joins and
just couldn't get it prior to posting.


Thanks to Sybrand for pointing out the shortcomings of a system I
inherited. Also thanks for pointing out my shortcomings of my SQL
knowledge, which I was already aware of. I will be able to sleep
better tonight knowing someone else is aware of it.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.