Re: Pro C/C++ Question

From: <rtproffitt_at_my-deja.com>
Date: Tue, 07 Dec 1999 17:13:10 GMT
Message-ID: <82jf71$hin$1_at_nnrp1.deja.com>


Milo,

> I'm guessing that since I'm doing the insert from the C program the
> value of user isn't set properly.

    INSERT .... VALUES (USER, SYSDATE, etc.etc.etc.) should work just fine, even in Pro/C, because the SQL will be sent to the kernel anyway, where USER and SYSDATE exist.

However when I select user from dual
> in the C program I see that it is set properly (to the userid I use to
> connect to the database), and so is sysdate. So why is the trigger
> failing? Any ideas?

I forget exactly how the trigger is coded,
> something like:
>
> new.column1 = user
> new.coulmn2 = sysdate

    :New.column1, :New.column2.... looks fine.

   Are you sure column1 is Varchar2(32) (at least)    and that column2 is DATE?

>
> Anyway, the trigger works fine when inserting into the table from
> SQLPlus.

It sounds more like a Pro/C coding problem...
Troubleshoot the whole insert statement.... check all your Pro/C
variables that they match type properly....
Try tests of the insert in Pro/C with one variable at a time until you find the offending code... Narrow it down with a step-wise approach....

Good Luck,
Robert Proffitt
Beckman Coulter

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Dec 07 1999 - 18:13:10 CET

Original text of this message