Re: Error

From: <operationsengineer1(at)yahoo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Error
Date: 2005-12-01 18:04:22
Message-ID: 20051201180422.39304.qmail@web33305.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--- Charley Tiggs <charley(at)xpressdocs(dot)com> wrote:

> On Nov 30, 2005, at 7:12 PM,
> <operationsengineer1(at)yahoo(dot)com>
> <operationsengineer1(at)yahoo(dot)com> wrote:
>
> >> What's the value of $customer_id before you
> attempt
> >> the insert?
> >>
> >> right after $customer_id variable is set, do the
> >> following:
> >>
> >> echo $customer_id . '<br />';
> >> echo gettype ( $customer_id );
> >> exit;
> >>
> >> With ADO, a couple of times, I've run into a
> glitch
> >> where bindings
> >> changed types. Haven't taken the time to figure
> out
> >> why. Switching
> >> to autoExecute solves the problem:
> >>
> >> $insert_array = array ( 'customer_id' =>
> >> $db->getone("select nextval
> >> ('t_customer_cust_id_seq')"),
> >> 'customer_name' =>
> >> $form->GetInputValue('customer_name'),
> >> 'customer_entry_date' =>
> $db->DBDate(time()))
> >>
> >> $result = $db->autoExecute ( 't_customer',
> >> $insert_array,
> >> 'INSERT' );
> >>
> >> Most likely, the reason it works for me is that I
> >> cleaned up my error
> >> when switching to the autoExecute method.
> >>
> >> Charley
> >
> > using php to cast to to an integer...
> >
> > $customer_id = (int) $customer_id;
> >
> > ...worked for me. i have a note in on the adodb
> forum
> > to find out why it is casting as boolean.
>
> I think your query failed.

great call.

> After you execute this query:
>
> >> $customer_id = $db->getone("select nextval
> >> ('t_customer_cust_id_seq')");
>
> do the following:
>
> echo $db->ErrorMsg();
> exit;
>
> That will tell you why the query failed.
>
> Charley

it says...

ERROR: relation "t_customer_cust_id_seq" does not
exist

i'm off to hunt down the actual name of the sequence.

bottom line - if you get a boolean response, check to
see if the query has failed first.

thank you for the insight.


__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

Responses

  • Re: Error at 2005-12-01 18:23:11 from Marcus Engene

Browse pgsql-novice by date

  From Date Subject
Next Message Marcus Engene 2005-12-01 18:23:11 Re: Error
Previous Message Jos 2005-12-01 17:08:23 \list