Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Oracle Command In Crystal Reports Post Reply Post New Topic
Author Message
awr888
Newbie
Newbie


Joined: 08 Nov 2011
Location: United States
Online Status: Offline
Posts: 2
Quote awr888 Replybullet Topic: Oracle Command In Crystal Reports
     Posted: 08 Nov 2011 at 2:04pm
I'm trying to create a command in Crystal. I'm using oracle 10g.

The command runs in oracle fine, what i'm trying to do is this

Truncate a table BOE.REF_CHG_REPORT
Insert records into BOE.REF_CHG_REPORT from various tables
Insert records into another table
Select records from BOE.REF_CHG_REPORT.

Is this possible. my sql statement is below. Thanks for help in advance

TRUNCATE TABLE BOE.REF_CHG_REPORT;
INSERT INTO BOE.REF_CHG_REPORT
--(application_id , ref_link , reference_name , product_family_name , ref_status_date , seq_owner , submission_due_date , ref_status)
SELECT rc.application_id ,
    rc.link ,
    rc.name ,
    c.name ,
    rc.status_date ,
    f.display_name ,
    c.status_date ,
    rst.name
FROM BOE.ref_chg rc
INNER JOIN ods.ref_status_type rst
ON rc.status_id = rst.id
LEFT OUTER JOIN ods.sequence c
ON c.application_id = rc.application_id
LEFT OUTER JOIN ods.product_family b
ON c.product_family_id = rc.id
LEFT OUTER JOIN sec.usr f
ON TO_CHAR(f.id) = c.owner
    -- INNER JOIN ODS.reference e ON e.application_id = a.id
    -- INNER JOIN ods.ref_chg_report rcr ON rc.id = rcr.id
WHERE rc.status_id IN ('1247400' , '1247396' , '1247396')
AND rc.id NOT      IN
    (SELECT id FROM boe.ref_chg_diff
    )
);
INSERT INTO BOE.REF_CHG_DIFF
SELECT ID ,
    NAME ,
    TYPE_ID ,
    STATUS_ID ,
    STATUS_DATE ,
    LINK ,
    CREATION_DATE ,
    APPLICATION_ID ,
    DT_ADDED
FROM BOE.REF_CHG; -- This should be the temp table, correct?
SELECT * FROM BOE.REF_CHG_REPORT;
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 09 Nov 2011 at 11:47am
I'm not sure that CR will multiple statements.
 
I have only seen selects or unions in commands, and that is what others have asked for help about
 
Never seen more than 1 SQL statement in a command object.
 
Could be the problem, but been wrong before.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum