Delete all records from file using SQLRPGLE

35 pts.
Tags:
SQLRPGLE
How to delete all the records from file(bpro1) using sqlrpgle?  

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

The following statement should do the trick :-

C/EXEC SQL
C+ DELETE * FROM BPR01
C/END-EXEC

Regards,

Martin Gilbert.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • CharlieBrowne

    Yes, that statement will delete the records in the file, but it will not release the disk space. Deleted records are "still there" just not visible.

    You are better off doing a CLRPFM BPR01

    61,485 pointsBadges:
    report
  • TomLiotta

    Technically, the SQL would have to be:

    C/EXEC SQL
    C+ DELETE FROM BPR01
    C/END-EXEC

    OR in /free format:

    EXEC SQL DELETE FROM BPR01 ;

    The SQL DELETE statement doesn't use a column-list, so the "*" cannot be used.

    Tom

    125,585 pointsBadges:
    report
  • TomLiotta
    Weird formatting between the fixed- and /free formats of the SQL, but it should be readable. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: