[SQL] Getting Results From Trigger

2001-01-30 Thread cbell


Hello everyone, I was hoping someone could help me with this...

I'm running postgres 7.02 on redhat 6.2, apache 1.3.14 and mod_perl
1.24_01.  I'm also using perl modules DBI 1.14 and DBD-Pg-0.95 to acces
the Postgres database.

Everytime my inventory file gets updated, I would like to have the
quantity on hand returned to my perl script.  I set up the following
function to do this:

CREATE FUNCTION inv_lookup () RETURNS OPAQUE AS '
BEGIN
RAISE  NOTICE ''%'', NEW.qtyonhand;
RETURN new;
end;
'language 'plpgsql';

Then I create the trigger like this...

CREATE TRIGGER qty after inventory for each row execute procedure
inv_lookup();

If I do any sort of updates from within psql I get the correct data
which is the Qtyonhand field in this format:

NOTICE:  15

However, in my perl program, I'm unsure as to how to get this
information back.  The Postgres Documentation says that the results from

a Notice get sent back to the application, but I check the DBI->err,
DBI->errstr, and DBI->state and they are empty.  The result code for the

actual SQL command I run is just 1 for success.

Does anyone know how to get these results from within a perl scripts???
Thanks in advance for any help.

Chris.






Re: [SQL] Re: \i command

2001-04-11 Thread cbell

I don't know if you've resolved your problem, but if not, you could try deleting and
recreating the indexes on the table...

Najm Hashmi wrote:

> Joel Burton wrote:
>
> > On Wed, 11 Apr 2001, Najm Hashmi wrote:
> >
> > > Hi All,
> > > From pgsql, I try to insert data in table using the \i command. Nothing
> > > takes place and after this command pgsql is hung... i cant use it any more.
> > > The same command works with all other tables but this is only one I am having
> > > problem with.
> > > I have attached my file with message. Could someone help me out here what is
> > > the reason for this behaviour.
> >
> > Works just fine for me (Pg7.1 RC3, Linux).
> >
> > Can you do manual inserts into the table?
> > Can you insert just a few records using \i?
> > Can you vacuum the table?
> >
> > --
> > Joel Burton   <[EMAIL PROTECTED]>
> > Director of Information Systems, Support Center of Washington
> >
> > ---(end of broadcast)---
> > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
>
> Hi, No I can't even do manaul insert on that particular table. This is really
> weird. Could this table's internals be corrupted?
>  One  more thing, if I run the same file on another db it works just fine. I am
> just wondering what is wrong with the structure.
> Thank you for replying. Anyone else has an idea about it
> Regards.
>
>   
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] Range of Serial values

2001-04-16 Thread cbell

Hello everyone,

when creating a serial column, is there a way to specify which number it
will start counting from?  For example, if you wanted all Serial ID's to
start at 1000 and count up from there, with no numbers below that.

Thanks,
Chris.


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [SQL] Range of Serial values

2001-04-16 Thread cbell

Thank you Poul and Justin, I'll give it a try!!!


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] Select between two connections

2001-05-15 Thread cbell

Hello everyone, I would like to perform a Select statement that accesses

tables and finds matching fields in two separate databases.

 For example, I have two connections to two separate database objects on
the same
Postgres server.  I would like to retrieve information from a table in
one database based on some information from tables in a different
database.

Has anyone done this before, can it be done?

Thanks in advance,

Chris.




---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html