Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:59:50+00:00 2026-05-27T14:59:50+00:00

i have a crystal report that returns the records i need based on criteria

  • 0

i have a crystal report that returns the records i need based on criteria i added in the report. I also want this report to update records in the data base when it is run. to do this i created the procedure (in oracle) below. How do i get this to run? I really only need the part that updates records to run in the procedure. Is this possible? meaning can i run the procedure from the same report that i would build as i normally do (using select expert)? I kind of sandwich the update statment between a statment that returns records as my research indicates that i can’t just run the update portion from crystal. when i try using the procedure below crystal throws an invalid argument provided error.

 create or replace Procedure           "P_UPDATE_REPORT_DATE_2" (

 N_BEGIN IN date,

 N_END IN date)

 is

 CUS_ID NUMBER;

 cursor c1 is select customer_id FROM customer;

 begin

 --real begining

 update dbo.customer set REPORT_DATE= sysdate 

 where customer.customer_id in

 (SELECT customer.custoemr_id

  FROM   dbo.CUS_ADDRESS CUS_ADDRESS INNER JOIN (((dbo.CUS_ASSOC_V
 CUS_ASSOC_V INNER JOIN dbo.customer customer ON
 CUS_ASSOC_V.ASSOC_ID=customer.ASSOC_ID) INNER JOIN dbo.ITEM ITEM ON
 CUSTOMER.ITEM_NUMBER=ITEM.ITEM_NUMBER) LEFT OUTER JOIN
 dbo.PAY_TYPE_CODE PAY_TYPE_CODE ON
 CUSTOMER.PRIM_PAY=PAY_TYPE_CODE.CODE) ON
 ITEM_ADDRESS.ADDRESS_ID=ITEM.ITEM_ADDRESS_ID

  WHERE  CUSTOMER.FACILITY='CHI' 

  AND CUSTOMER.START_DATE<= N_END 

  AND CUSTOMER.END_DATE>= N_BEGIN

  AND CUSTOMER.CUSTOMER_TYPE_CODE='O');

  commit;

 --fake to create sandwich

 OPEN c1;

    LOOP

       FETCH c1 INTO CUS_ID;

       EXIT WHEN c1%NOTFOUND;

       DBMS_OUTPUT.PUT_LINE(CUS_ID);

    END LOOP;


 end "P_UPDATE_REPORT_DATE_2";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:59:51+00:00Added an answer on May 27, 2026 at 2:59 pm

    Create a function with an autonomous transaction:

    create or replace function my_function return number is
        pragma autonomous_transaction;
    begin
        --Perform DML here
        insert into my_table values(1);
    
        --You must commit or rollback within an autonomous transaction
        commit;
    
        --Return any dummy value
        return 1;
    end;
    /
    

    Then call it with SQL like this:

    select my_function from dual;
    

    Performing DML as part of a SELECT statement is generally a horrible thing you should try to avoid. SQL does not make any guarantees about how things will be executed. And Crystal Reports does not always execute every query in the report. Be very careful and test thoroughly. Or even better, find some other way to accomplish this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a crystal report that is like this: Group By Property.ID Group By
I have a Crystal Report, that is populated with a stored procedure, it also
I have a crystal report that currently shows data grouped twice. The first group
I have a Crystal Report that runs from within an MS SQL Server based
I have a crystal report that I have to add a Bar Code to.
I have an existing report (Crystal Report) in my Visual Studio project that is
I need some clarification. I have a Reportwriter dll that uses Crystal Reports. It
I have a crystal report that shows sales volumes called week to date volume.
I have a Crystal 2008 report that will be deployed to an InfoView server.
I have a single crystal report that usually ends up about 150 pages long.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.