Fw: [SQL] stored procedures for complex SELECTs

2006-01-24 Thread ipv
timization) Regards - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Thursday, January 19, 2006 12:17 AM Subject: [SQL] stored procedures for complex SELECTs Are there performance advantages that can be achieved by wrapping a complex SELECT into a stored

Re: [SQL] stored procedures for complex SELECTs

2006-01-18 Thread Michael Glaesemann
On Jan 19, 2006, at 8:17 , [EMAIL PROTECTED] wrote: Are there performance advantages that can be achieved by wrapping a complex SELECT into a stored procedure? I believe it depends on the procedural language. If it's SQL, I think it may be inlined, so you'd have overhead due to the stored p

[SQL] stored procedures for complex SELECTs

2006-01-18 Thread alex-lists-pgsql
Are there performance advantages that can be achieved by wrapping a complex SELECT into a stored procedure? Alex ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] stored procedures in postgresql user plpgsql

2004-11-29 Thread Michael Fuhr
Please Cc the mailing list when you respond -- that way others can participate in and learn from the discussion. Also, if you have a new question then please start a new thread with a relevant Subject header. On Mon, Nov 29, 2004 at 10:12:59PM -0500, [EMAIL PROTECTED] wrote: > Thanks for the help

Re: [SQL] stored procedures in postgresql user plpgsql

2004-11-29 Thread Michael Fuhr
On Mon, Nov 29, 2004 at 01:37:42PM -0500, [EMAIL PROTECTED] wrote: > I have tried to create a simple function to select data from a table. Could > you all please correct me It would be helpful if you told us what you want to happen and what actually does happen. Without that information we have

[SQL] stored procedures in postgresql user plpgsql

2004-11-29 Thread RobertD . Stewart
I know that there are not stored procedures like that in oracle. I know that you have to create functions.   I have tried to create a simple function to select data from a table.  Could you all please correct me   Thanks     CREATE FUNCTION retrive_atype(varchar) RETURNS varchar AS '

Re: [SQL] Stored Procedures returning a RECORD

2004-10-05 Thread Jeff Eckermann
--- Kent Anderson <[EMAIL PROTECTED]> wrote: > I am attempting to use a stored procedure to pull a > report from the > database. My questions is if its even possible to > pull the data using a > function and then treat the returned data as a > normal recordset with the web > pages. > > The actua

[SQL] Stored Procedures returning a RECORD

2004-10-05 Thread Kent Anderson
I am attempting to use a stored procedure to pull a report from the database. My questions is if its even possible to pull the data using a function and then treat the returned data as a normal recordset with the web pages.   The actual function looks like   CREATE OR REPLACE FUNCTION submi

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Richard Huxton
Patrice OLIVER wrote: Hello, I got this error message : ERROR: set-valued function called in context that cannot accept a set CONTEXT: PL/pgSQL function "lsttable" line 5 at return next You need to treat set-returning functions as though they are tables. SELECT * FROM lsttable(); NOT SELECT l

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Philippe Lang
yé : mardi, 24. août 2004 11:26 À : Patrice OLIVER Cc : [EMAIL PROTECTED] Objet : Re: [SQL] stored procedures and type of returned result. Patrice OLIVER wrote: > Hello, > > I'm new in PostgreSQL. It's very cool. Hello, and yes it is isn't it :-) > I would like

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Richard Huxton
Patrice OLIVER wrote: Hello, I'm new in PostgreSQL. It's very cool. Hello, and yes it is isn't it :-) I would like to know how to return a set of records from a stored procedure. For example, i would like to execute these sql command from a stored procedure : select t.typnum, t.typcom, t.typcat

[SQL] stored procedures and type of returned result.

2004-08-24 Thread Patrice OLIVER
*** Aucun virus n'a été détecté dans la pièce-jointe no filename --- No virus was detected in the attachment no filename Votre courrier a été inspecté par InterScan Messaging Security Suite --- Your mail has been scanned by InterScan MSS. *** Hello, I'm new i

Re: [SQL] Stored procedures and "pseudo" fields

2004-08-10 Thread Christoph Haller
Lars Erik Thorsplass wrote: > On Tue, 20 Jul 2004 09:45:06 -0600, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > > Kinda like this: > > > > > > SELECT *, acl_check( objects.obid, ) AS mode FROM objects > > > WHERE mode > 0; > > > > Here's the problem. In order to do the select, the query first need

Re: [SQL] Stored procedures and "pseudo" fields..

2004-07-20 Thread Markus Bertheau
Ð ÐÑÑ, 20.07.2004, Ð 15:57, Tomasz Myrta ÐÐÑÐÑ: > On 2004-07-20 15:34, UÅytkownik Lars Erik Thorsplass napisaÅ: > > My stored procedure "acl_check()" takes two integers as parameters. > > Param1 is the object id to check acl on, Param 2 is the object id of > > the user currently using the system. T

Re: [SQL] Stored procedures and "pseudo" fields..

2004-07-20 Thread Tomasz Myrta
On 2004-07-20 15:34, UÅytkownik Lars Erik Thorsplass napisaÅ: My stored procedure "acl_check()" takes two integers as parameters. Param1 is the object id to check acl on, Param 2 is the object id of the user currently using the system. The procedure returns a positive number (1 or 3 ) if you have s

[SQL] Stored procedures and "pseudo" fields..

2004-07-20 Thread Lars Erik Thorsplass
I also posted this to the general list, which might not have been a suitable forum. -- I have recently ventured into the exciting world of stored procedures, but I have now become lost. Background: Am currently working on access control in a web application. My goal is to process access control

Re: [SQL] Stored procedures

2004-01-01 Thread Tom Lane
beyaRecords - The home Urban music <[EMAIL PROTECTED]> writes: > I am having problems with a stored procedure (plpgsql) that takes in a > value and returns a record set. > I am calling the procedure as follows: > select clientRec('tmpg60'); Use select * from clientRec('tmpg60') as (colum

[SQL] Stored procedures

2004-01-01 Thread beyaRecords - The home Urban music
Hi, I am having problems with a stored procedure (plpgsql) that takes in a value and returns a record set. my code is as follow: create function pg_clientRec(text) setof record as ' declare customerID ALIAS $1; rec record; begin select into rec * from troubletickets where custID = customerID; ret

Re: [SQL] Stored Procedures

2003-12-28 Thread Christopher Browne
[EMAIL PROTECTED] (beyaRecords - The home Urban music) wrote: > I am new to this list and the world of postgreSQL, and would like to > know how create stored procedures in postgreSQL. Have you considered looking at the documentation? It is fairly well documented there. % man "CREATE FUNCTION"

Re: [SQL] Stored Procedures

2003-12-28 Thread Michael Fuhr
On Mon, Dec 29, 2003 at 01:57:00AM +, beyaRecords - The home Urban music wrote: > > I am new to this list and the world of postgreSQL, and would like to > know how create stored procedures in postgreSQL. If you're new to PostgreSQL then have a look at the documentation: http://www.postgresql

[SQL] Stored Procedures

2003-12-28 Thread beyaRecords - The home Urban music
Hi, I am new to this list and the world of postgreSQL, and would like to know how create stored procedures in postgreSQL. regards Uzo ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining

Re: [SQL] Stored procedures and relations

2003-11-28 Thread Stephan Szabo
On Fri, 28 Nov 2003, FET wrote: > Hi everybody, > I have a stored procedure that drops table A and then creates table A > again. The table A has no constraints on any columns. When I execute > the stored procedure by saying: SELECT sp_myproc(); It gives me an > error saying : Relation 68428 does

[SQL] Stored procedures and relations

2003-11-28 Thread FET
Hi everybody, I have a stored procedure that drops table A and then creates table A again. The table A has no constraints on any columns. When I execute the stored procedure by saying: SELECT sp_myproc(); It gives me an error saying : Relation 68428 does not exist. When I remove the CREATE FUNCTIO

Re: [SQL] Stored procedures

2003-03-29 Thread Franco Bruno Borghesi
As far as I know, you always work with a ResultSet. If you know your stored procedures will always return an Integer and you don't wanna deal with the executeQuery and stuff every time, you could create a class with methods explicitly for accesing your stored procedures, for example: assuming

Re: [SQL] Stored procedures

2003-03-28 Thread Franco Bruno Borghesi
Here is a full example of a java program showing the data from a set returning function: - --IN YOUR DATABASE CREATE TABLE people (name TEXT); INSERT INTO people VALUES ('john'); INSERT INTO people VALUES ('peter'); INSERT INTO people VALUES ('joe'); CREATE FUNCTION getPe

Re: [SQL] Stored Procedures

2002-10-02 Thread Joe Conway
[EMAIL PROTECTED] wrote: > Ok, if this does not apply to versions prior to 7.3beta > then what do I need to do if I am running 7.2.1? When I > try to use the SETOF to retrun a row set, I only get > one column. First, prior to 7.3 there is no SCHEMA support in Postgres. Everything lives in ess

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
Cc: david williams; [EMAIL PROTECTED] Subject: Re: [SQL] Stored Procedures  Ok, if this does not apply to versions prior to 7.3beta then what do I need to do if I am running 7.2.1? When I try to use the SETOF to retrun a row set, I only get one column.Do I need to update Postgres to get things to

Re: [SQL] Stored Procedures

2002-10-02 Thread bcschnei
Ok, if this does not apply to versions prior to 7.3beta then what do I need to do if I am running 7.2.1? When I try to use the SETOF to retrun a row set, I only get one column. Do I need to update Postgres to get things to work? Ben > david williams wrote: > > Also, > > > > the table defini

Re: [SQL] Stored Procedures

2002-10-02 Thread Joe Conway
david williams wrote: > Also, > > the table definition MUST be in the Public Schema. I use my own schema > names but in order for the table to be found by the function it ( the > table ) must be in the public schema. Although it can be empty. (Note: this discussion does not apply to Postgre

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
Also,   the table definition MUST be in the Public Schema. I use my own schema names but in order for the table to be found by the function it ( the table ) must be in the public schema. Although it can be empty.   DaveGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
http://developer.postgresql.org/docs/postgres/xfunc-sql.html#AEN30400   See section   9.2.4. SQL Table Functions   - Original Message - From: [EMAIL PROTECTED] Sent: Tuesday, October 01, 2002 4:25 PM To: [EMAIL PROTECTED] Subject: [SQL] Stored Procedures  Hi all. I'm looking for a l

Re: [SQL] Stored Procedures

2002-10-01 Thread Roberto Mello
On Tue, Oct 01, 2002 at 06:16:57PM +, [EMAIL PROTECTED] wrote: > Hi all. I'm looking for a little help here. I have a > project where I have to write some stored proceedures > and am having some problems. My main issue is, I cannot > figure out how to return a record set containing > multi

[SQL] Stored Procedures

2002-10-01 Thread bcschnei
Hi all. I'm looking for a little help here. I have a project where I have to write some stored proceedures and am having some problems. My main issue is, I cannot figure out how to return a record set containing multipule columns. I am looking for a few examples on how I can do this. Most of

Re: [SQL] stored procedures: sybase -> postgreSQL ?

2002-09-10 Thread Ross J. Reedstrom
On Mon, Sep 09, 2002 at 11:02:27PM +0200, Reinoud van Leeuwen wrote: > On Mon, 9 Sep 2002 18:16:07 + (UTC), [EMAIL PROTECTED] (Charles > Hauser) wrote: > > >I am trying to port a Sybase table create script to one usable for > >postgreSQL. > > > >(note I am not a DBA) > > > >In particular I am

Re: [SQL] stored procedures: sybase -> postgreSQL ?

2002-09-10 Thread Reinoud van Leeuwen
On Mon, 9 Sep 2002 18:16:07 + (UTC), [EMAIL PROTECTED] (Charles Hauser) wrote: >I am trying to port a Sybase table create script to one usable for >postgreSQL. > >(note I am not a DBA) > >In particular I am not well versed on how to use/recode the stored >procedures such as that in the exampl

[SQL] stored procedures: sybase -> postgreSQL ?

2002-09-09 Thread Charles Hauser
I am trying to port a Sybase table create script to one usable for postgreSQL. (note I am not a DBA) In particular I am not well versed on how to use/recode the stored procedures such as that in the example below. ALTER TABLE DnaFragment ADD PRIMARY KEY (dna_fragment_id) go exec sp_p

Re: [SQL] Stored Procedures?

2001-05-24 Thread Tod McQuillin
> I read something about stored procedures in the Great Bridge User's Manual > (Page 74 under "PG_LANGUAGE"). It is only mentioned briefly and there are no > explanations of how it works. > > Can anybody let me know, how I can write a stored procedure and how to run > it? Postgres doesn't have st

[SQL] Stored Procedures?

2001-05-24 Thread Chris Ruprecht
I read something about stored procedures in the Great Bridge User's Manual (Page 74 under "PG_LANGUAGE"). It is only mentioned briefly and there are no explanations of how it works. Can anybody let me know, how I can write a stored procedure and how to run it? Best regards, Chris

[SQL] SQL stored procedures and JDBC problem

2000-07-03 Thread Nitin Bahadur
oes not do it). So how do i declare and use arrays in SQL stored procedures so as to return arrays as OUT paramters and access the same in JDBC kindly reply at [EMAIL PROTECTED] thanks nitin