开发者

Deleting a row in Oracle with ESQL/C

开发者 https://www.devze.com 2023-03-25 05:31 出处:网络
I\'m trying to write a program with C and ESQL. One of the things I want to do is delete old row from one of my table (by comparing with SYSDATE) each time the program is run.

I'm trying to write a program with C and ESQL. One of the things I want to do is delete old row from one of my table (by comparing with SYSDATE) each time the program is run.

So my SQL code looks like this:

DELETE FROM Trip
WHERE dateT < (SYSDATE - 1);

Now I know this works because I tested it with SQL+ Worksheet

But when I want to do it with ESQL like this:

void deleteOutDated(){
    EXEC SQL DELETE FROM Trip WHERE dateT < (SYSDATE - 1);
    printf("Old trips deletes");
}

My program just freezes there.

So I wanted to know if it is possible to make 开发者_StackOverflowsuch a statement in ESQL and if it is what am I doing wrong?

0

精彩评论

暂无评论...
验证码 换一张
取 消