Re: Ugly embedded SQL behaviour

From: Bob Rosales <brosales_at_netcom.com>
Date: Fri, 2 Sep 1994 18:08:33 GMT
Message-ID: <brosalesCvIL2A.4wC_at_netcom.com>


smayo_at_world.std.com (Scott A Mayo) writes:

>I'm irritated at Oracle's embedded SQL (Pro*c) product. I
>found a bug that cost me two days on a tight schedule. I'm
>posting this so other folk won't hit the same trap.
 

>Given this sequence:
 

> EXEC SQL BEGIN DECLARE SECTION;
> static char buf[32000]; /* big buffer to build SQL command in */
> EXEC SQL END DECLARE SECTION;
 
> ... buf gets used for various things ...
 

> /* Time to do a delete
> */
> strcpy(buf, "DELETE FROM ani WHERE key = 5");
> EXEC SQL EXECUTE IMMEDIATE :buf;
 ...
>If you are considering using Oracle embedded SQL products, and
>have a choice between it and Informix, take another look at
>Informix. I've had two weeks of pain with Oracle, and have learned
>the fine art of being on hold, waiting for support people to
>get to me. The informix stuff went quite smoothly by comparison.

I would not be too hasty to condemn Oracle due to your lacking of basic understanding of how char or varchar works. Had you done this then you would not have any trouble:

  EXEC SQL BEGIN DECLARE SECTION;
  static char buf[32000]; /* big buffer to build SQL command in */   EXEC SQL VAR buf IS STRING(32000);
 EXEC SQL END DECLARE SECTION;



Robert Rosales
Sonica Software Corp
brosales_at_netcom.com
Received on Fri Sep 02 1994 - 20:08:33 CEST

Original text of this message