Re: [SQL] Moving from Transact SQL to PL/pgSQL

2005-01-26 Thread Clint Stotesbery
For Oracle info, check out one of my recent posts: http://archives.postgresql.org/pgsql-sql/2005-01/msg00231.php For TSQL, well, I was involved in project where we converted an Oracle db (with procs, functions, triggers, etc) to PostgreSQL and MS Sql Server. plpgsql and plsql are close enough whe

Re: [SQL] converting Oracle scripts to PostgreSQL

2005-01-25 Thread Clint Stotesbery
Hi Gary, I went through a conversion from Oracle to PostgreSQL about 9 months ago. There's a little bit of documentation in the PostgreSQL manual http://www.postgresql.org/docs/7.4/interactive/plpgsql-porting.html or http://www.postgresql.org/docs/8.0/interactiveplpgsql-porting.html I had ment to s

Re: [SQL] Help converting Oracle instead of triggers to PostgreSQL

2003-12-04 Thread Clint Stotesbery
Hi Christoph, Thanks for the links but the techdoc links for converting from Oracle to PostgreSQL has 2 links that don't go to their intended targets anymore, one is in the 7.3 docs which is really limited (only covers simple things), and the Ora2Pg one I don't really get that well. As far as u

[SQL] Help converting Oracle instead of triggers to PostgreSQL

2003-12-03 Thread Clint Stotesbery
I have some instead of triggers in Oracle, some update instead of triggers and some insert instead of triggers. I was thinking that I could maybe use instead of rules in PostgreSQL to get the same effect. I converted the instead of trigger in Oracle into a PostgreSQL function below: CREATE OR RE

Re: [SQL] Create Trigger porting problem from Oracle to PostgreSQL7.3.2

2003-12-03 Thread Clint Stotesbery
Hi, I ran into the same thing last week. There is no way to specify that functionality in the trigger creation for Postgresql. You will have to code the trigger to detect when the specific field is updated. Tom Lane had suggested something for me last week. Check out the archive for the mailing

Re: [SQL] trigger conversion advice needed

2003-11-26 Thread Clint Stotesbery
Received: from sss2.sss.pgh.pa.us ([EMAIL PROTECTED] [127.0.0.1])by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hAQFe819015058;Wed, 26 Nov 2003 10:40:08 -0500 (EST) X-Message-Info: JGTYoYF78jE74k1WFZAS8n73gEHv7D0r In-reply-to: <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> Comm

[SQL] trigger conversion advice needed

2003-11-26 Thread Clint Stotesbery
I'm working on converting a simple trigger from Oracle to Postgres and I have a couple ofl questions that I need some help on please. First here's the Oracle trigger: CREATE OR REPLACE TRIGGER t_ship_date AFTER UPDATE OR INSERT OF order_date ON orders BEGIN UPDATE orders SET ship_date = work

[SQL] create type input and output function examples

2003-10-28 Thread Clint Stotesbery
I've seen the docs for create type and an example of the syntax to create a type. What I haven't seen is the functions that are passed for the input and output elements. CREATE TYPE box (INTERNALLENGTH = 8, INPUT = my_procedure_1, OUTPUT = my_procedure_2); Now what would be in my_procedure1 a

[SQL] assorted Postgres SQL/ORDBMS questions

2003-10-20 Thread Clint Stotesbery
1. You can raise exceptions but you can't catch exceptions in pgsql right? 2. Does Postgres support ORDBMS operations? Specifically I am wondering about the ability to define your own objects and create functions/procedures for the objects (e.g. object.method()). In Oracle I would use CREATE TYPE

[SQL] converting an oracle procedure to postgres

2003-10-20 Thread Clint Stotesbery
I have read the docs on converting Oracle to Postgres already. I'm a little confused though. I have a procedure in Oracle that just does some calculations and then does an update based on the calculations. The procedure doesn't return anything. It seems like in Postgres that everything has to b