Back to forum list… Back to How Do I?...

Delete data from a DB (4 replies)

Llewellyn Victor
9 years ago
Llewellyn Victor 9 years ago

After reading a dataset from a DB table and copying that to an archive table, how would I then delete the original dataset?

So I am doing a Select * where archive = 'Y', I am then copying that into a archive table, and then I want to delete where archive = 'Y' from the oroginal table

Support
9 years ago
Support 9 years ago

Llew, there is currently no facility to perform a delete operation.

I think you would need to have a separate operation to perform this outside of IMan (or possibly use a script task).

Mohammadali Naghibi
9 years ago
Mohammadali Naghibi 9 years ago

you can use the script task and perform data base commands there

Mark Binkley
8 years ago
Mark Binkley 8 years ago

Hi Mohammadali,

I am trying to use a script task to delete some records in a temp table.    I'm having trouble with the syntax  (I'm not a programmer).   I am wondering if I'm close, or if I should just seek a programmer's assistance.   

I'm getting an error message on refresh:   

Description: Expected end of statement

Source Line: Dim con As New ADODB.Connection

. ^

Line=3 Pos=8

WHLOCATION is a mapped field in IMAN.

Here is my script

Dim con As New ADODB.Connection

con.ConnectionString = "Provider=SQLNCLI10;"

& "Server=ppac-sql-02;"

& "Database=DQuest;"

& "Uid=accpac;"

& "Pwd=xxxxxxx;"

con.Open

sql="DELETE FROM ICEPAC_WHCounts WHERE LOCATION=%WHLOCATION"

con.Execute sql

conn.close

D Dunn
8 years ago
D Dunn 8 years ago

The syntax isn't correct.  You're wanting something like (and I stress "like"):

Dim con

con = CreateObject("ADODB.Connection","")

then the rest of your code should work.

One other work around that comes to mind:

You can run SQL commands via a batch file. You could use a file task (I think) to execute a batch file used to delete those records.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close