Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can CR9.0 Delete Records?

Status
Not open for further replies.

bbwrede

Programmer
May 22, 2003
52
0
0
US
CR 9 doesn't have the ability to delete records does it? What if you use a command?
 
If you've got the rights in the database, then you can indeed delete records using a command.

-dave
 
The SQL command feature allows you to enter any valid SQL command, as long as the last thing it does is SELECT some reports from table(s).

So, yes, you can use DELETE, INSERT, and UPDATE as long as your DB login includes write permissions to the DB.

For so long Cr was a "Read Only" tool. With CR9 (and above) that is no longer the case. ALthough it's not something likely to be used by accident. You have to know what you are doing to make it work properly.

Editor and Publisher of Crystal Clear
 
Use the Add Command function and paste in whatever SQL you might use to delete rows.

Crystal will not delete rows, but it can pass complex SQL statements which do so.

You may be better served to create a Stored Procedure to do this as opposed to embedding SQL in a report, and of course it's database dependent.

-k
 
Bruce,

Didn't you have a UFL to modify a record set in version 8.5?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Thanks for all your posts. The database I am querying is missing some records and I happened to be connected at the time they were deleted. I wanted to make sure I hadn't accidently done it in CR. I definitley have a select and not a delete! Thanks again to everyone.
 
FYI - I've used Crystal to create "DELETE...WHERE" strings where I needed to Delete records at the DETAIL level based on linked values within the database.

I use a text string with embedded data values extracted by Crystal.

DELETE Table WHERE {Field1} = "X" AND {Field2} = "Y"

This creates a report with multiple DELETE command lines that I can export as TEXT and run in MS-SQL.
 
MJRBIM: You can do the same thing within SQL by creating dynamic SQL, I do it fairly often, and it's faster. more flexible and easier than using CR (for me).

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top