Re: [GENERAL] need some help with pl-pgsql

2008-12-24 Thread Scott Marlowe
On Wed, Dec 24, 2008 at 9:32 AM, justin wrote: > > > Found the problem at last. it was what i thought early this morning, the > database had some flaky data set to null. so modified the the tables in > question set defaults to zero and updated all the records that has null to > zero. hopefully

Re: [GENERAL] need some help with pl-pgsql

2008-12-24 Thread justin
justin wrote: Adrian Klaver wrote: - "justin" wrote: So it appears that something is causing _wipvalue to get set to NULL somewhere else in the code. Now when running the failing select statement manually works is because the modified record is still not committed yet and its

Re: [GENERAL] need some help with pl-pgsql

2008-12-24 Thread Adrian Klaver
On Tuesday 23 December 2008 9:57:01 pm justin wrote: > > I have taken your idea and made sure all the variables all appear the > same and add raise notice for each portion of the command that is failing. > > - > NOTICE: _wipvalue: > CON

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread justin
Adrian Klaver wrote: - "justin" wrote: Adrian Klaver wrote: Would help to see the whole function. Also make sure you did not name one of the variables the same as a column name, this will confuse plpgsql. Are you using the same value for wo_id in the function as in the manual select

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread justin
Adrian Klaver wrote: On Tuesday 23 December 2008 3:36:46 pm Adrian Klaver wrote: Hmmm. A couple of suggestions while I ponder this more. For clarity sake decide on a case scheme. I start getting twitchy when I see pwoid and pWoid refer to the same thing. This depends on case folding being co

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread Adrian Klaver
On Tuesday 23 December 2008 3:36:46 pm Adrian Klaver wrote: > > Hmmm. A couple of suggestions while I ponder this more. For clarity sake > decide on a case scheme. I start getting twitchy when I see pwoid and pWoid > refer to the same thing. This depends on case folding being consistent, not > som

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread Adrian Klaver
- "justin" wrote: > Adrian Klaver wrote: > > Would help to see the > whole function. Also make sure you did not name one of > the variables the same as a column name, this will confuse plpgsql. > Are you > using the same value for wo_id in the function as in the manual select > statement?

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread justin
Adrian Klaver wrote: On Tuesday 23 December 2008 1:04:49 pm justin wrote: have a function written in pgsql it runs just fine, except its doing something really stupid. The function runs just fine till this select statement Select (wo_wipvalue/wo_qtyord) into _TotalCost f

Re: [GENERAL] need some help with pl-pgsql

2008-12-23 Thread Adrian Klaver
On Tuesday 23 December 2008 1:04:49 pm justin wrote: > have a function written in pgsql it runs just fine, except its doing > something really stupid. > > The function runs just fine till this select statement > > Select (wo_wipvalue/wo_qtyord) > into _TotalCost > from wo >

[GENERAL] need some help with pl-pgsql

2008-12-23 Thread justin
have a function written in pgsql it runs just fine, except its doing something really stupid. The function runs just fine till this select statement Select (wo_wipvalue/wo_qtyord) into _TotalCost from wo where wo_id = pWoid ; This goes to the work order header table to