Thread: [Fwd: In the Soup]

[Fwd: In the Soup]

From
"Thomas G. Lockhart"
Date:
Thomas Good wrote:
>
> When I pare my main() module down to simply declaring a communication
> area (include sqlca.h) and then connecting to the db (which succeeds)
> and subsequently running exec sql delete from $table where
> $attribute=value; I get no stderr.  But, alas, I get no record removed
> either. Meanwhile, the same sql cmd when run from psql rm's the
> record.
> Anyone who can get ecpg to delete records will earn my undying
> gratitude (or a rack of good belgian ale ;-)  I am able to do data
> retrieval no problem via ecpg and this morn am writing a usr interface
> to do inserts and updates (we'll see how that goes...)   But record
> removal eludes me.
> Help (Bruce!  Tom! - Anybody!!?) (and thanks!)
> Tom Good

Meskes, Michael wrote:
>
> Thomas, could you please re-send me the original bug report. I seem to
> have lost it under the about 3000 mails wainting for me.

Thomas G., can you send Michael your pared-down test case? Thanks...

                       - Tom

Re: [HACKERS] [Fwd: In the Soup]

From
Tom Good
Date:
Hmm...I don't have the original as I managed to get it going...
my exec sql commit; line was misplaced (my error not Michael's).
I apologize for wasting your time...

I am *very* stuck on updates that use a call to gets().
scanf() works fine but...
when I need the usr to give me a string for a record update gets()
behaves oddly.  The src compiles and links, connects, queries for a
list of records and then uses printf() to ask for usr input.

At this point, it leaps ahead of the current stanza, inputting a null
into the attribute in question.

I have tried making the call to gets() simple:
char usr_buffer[81];
...
printf("Enter blah blah blah: ");
fflush(stdin);
gets(usr_buffer);
and I have tried allocating memory (and making the usr-buffer var
a pointer...) but this also fails.
Finally, I tried making the call to gets() part of a separate
usr defined function.  This also compiled without error but
displays the same symptoms.

I raised this once (or twice ;-) but felt a bit sheepish over
my delete blunder so I didn't really want to push the issue.
Having said that, I do wonder if it really is stupidity on my
part or something Michael could have a look at...?

I will send him my code, off-list...

Thanks alot for your patience Tom, you're quite a guy.



    ----------- Sisters of Charity Medical Center ----------
                    Department of Psychiatry
                              ----
 Thomas Good, System Administrator            <tomg@q8.nrnet.org>
 North Richmond CMHC/Residential Services     Phone: 718-354-5528
 75 Vanderbilt Ave, Quarters 8                Fax:   718-354-5056
 Staten Island, NY   10305


Re: [HACKERS] [Fwd: In the Soup]

From
Michael Meskes
Date:
Tom Good writes:
> I am *very* stuck on updates that use a call to gets().
> scanf() works fine but...
> when I need the usr to give me a string for a record update gets()
> behaves oddly.  The src compiles and links, connects, queries for a
> list of records and then uses printf() to ask for usr input.

We've solved this one in private mail. It was no bug in ecpg. So there's no
need for a patch in 6.3.2.

Michael
--
Dr. Michael Meskes, Project-Manager    | topsystem Systemhaus GmbH
meskes@topsystem.de                    | Europark A2, Adenauerstr. 20
meskes@debian.org                      | 52146 Wuerselen
Go SF49ers! Go Rhein Fire!             | Tel: (+49) 2405/4670-44
Use Debian GNU/Linux!                  | Fax: (+49) 2405/4670-10