Re: Delete tuple in Pro*C C

From: Donald W. Pope II <ii_e_at_thunder.cs.odu.edu>
Date: 1995/03/30
Message-ID: <3lf5rh$om_at_xanth.cs.odu.edu>#1/1


In article <1995Mar30.150330.2921_at_uxmail.ust.hk>, Chung Hoi Shan <cs_henry_at_ug.cs.ust.hk> wrote:
>Hi,
>
>In Pro*C, why my program does not stop when I intend to
>delete an existing tuple from an existing table such as follows:
>
>EXEC SQL DELETE FROM table WHERE name = :input_name;
>
>Thanks in advance.
>Henry (cs_henry_at_cs.ust.hk)

Why should it stop? It should delete the record and continue processing. However, are you trying to stop processing so that you can enter data into the host variable :input_name?

If so, this is wrong. :input_name must have a value assigned to it prior to deleting the record.

Try this:

EXEC SQL BEGIN DECLARE SECTION;
        VARCHAR input_name[the size];
EXEC SQL End DECLARE SECTION;

gets(input_name);
input_name.len = strlen(input_name.arr);

EXEC SQL delete FROM table WHERE name = :input_name;

I hope I understood your question correctly. If so this should help.

Don Received on Thu Mar 30 1995 - 00:00:00 CEST

Original text of this message