Re: [SQL] TEMP tables

2003-02-02 Thread Bruce Momjian
You need to use EXECUTE. See the FAQ, item 4.26. --- Lex Berezhny wrote: > hi, > > I have a plpgsql procedure that needs to create a temporary table, use > it as a stack internally, and then disgard it when the procedure e

[SQL] TEMP tables

2003-02-02 Thread Lex Berezhny
hi, I have a plpgsql procedure that needs to create a temporary table, use it as a stack internally, and then disgard it when the procedure exits. This works great if I only call this procedure ONCE per session. Calling it a second time within the same session produces: WARNING: Error occurred

[SQL] window version of psql of postgreSQL v7.3.1

2003-02-02 Thread jack
Hi, all Where can I get a window version of psql of postgreSQL v7.3.1? Thank you very much! Jack ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] extracting constraints from schema

2003-02-02 Thread Tomasz Myrta
Agnieszka Rutkowska wrote: Hi, I was just wondering whether you happen to know how to extract what the table and column constraints are using jdbc? The API provides methods for extracting meta data on the table names, column names, primary and foreigh keys as well as column types and sizes. What

Re: [SQL]

2003-02-02 Thread Oliver Elphick
On Sun, 2003-02-02 at 21:47, mail.luckydigital.com wrote: > Can some one please confirm( with a plpgsql function example please ) > a postgres "7.2" function that can return multiple rows to the client. > > I've gone through the docs and can't find anything to support this -it > seems you can onl

Re: [SQL] PL/pgSQL question

2003-02-02 Thread Josh Berkus
Jim, > Yes i'm aware this it is possible in 7.3 - can someone please confirm its > not possible in 7.2 or provide me with an example of how to go about it. It is sort of possible in 7.2, as a function can return a cursor to an interface language capable of handling cursors. However, implementa

[SQL]

2003-02-02 Thread mail.luckydigital.com
Can some one please confirm( with a plpgsql function example please ) a postgres "7.2" function that can return multiple rows to the client.   I've gone through the docs and can't find anything to support this -it seems you can only have one return value or null.   Yes i'm aware this it is

Re: [SQL] COPY use in function with variable file name

2003-02-02 Thread Oliver Elphick
On Wed, 2003-01-29 at 08:05, Sondaar Roelof wrote: > Hello, > > I can't figure out how to make this work, or is not possible? > > In a function i would like to read a file. > The file name is determined by a value from a table. > However the COPY statement does not to accept this? > I tried vario

Re: [SQL] Help with a query for charting

2003-02-02 Thread greg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I'm trying to do a query to count the number of tickets opened on > each day of a month. It'll always be from the 1st to the end of > the month. > ... > But it doesn't give me a zero for the days when no tickets were opened The problem is that S

Re: [SQL] how do i create a date from a substring???

2003-02-02 Thread Tomasz Myrta
joe.guyot wrote: greetings all! [i just became a member] i have a string data from a view that is a packed field. it contains a date, a time and a user's initials. i'm trying to extract the date portion in a pg 7 view. the data originally came from a ms sql 7 table that has since been converted

Re: [SQL] help: pgSQL docs and debug

2003-02-02 Thread Tomasz Myrta
Vic Cekvenich wrote: I need to write some longer pgSQL stored procedures. Can you help? 1. I am looking for a reference of pgSQL functions, etc.? (I have all the books, they have just a few, I also looked all over the web). If you can post a link, tia. Start from "Chapter 19. PL/pgSQL - SQL Proc

Re: [SQL] How to return records from a function

2003-02-02 Thread John Cavacas
Thanks! That's somewhat of what i was looking for. However it seems that what I wanted to do is still not possible. I'm writing a Java application and wanted to use CallableStatement to call a PostgreSQL function. However it seems that the driver does not implement that functionality. I guess I c

[SQL] How to return records from a function

2003-02-02 Thread John Cavacas
Hello everyone. I've spent the last few hours trying to come up with a function that at the most basic returns the result of a SELECT * FROM . This is easy to do in something like MSSQL or Oracle. For example in MSSQL i can do something like: CREATE PROCEDURE proc_name AS BEGIN SELECT * FROM s

[SQL] help: pgSQL docs and debug

2003-02-02 Thread Vic Cekvenich
I need to write some longer pgSQL stored procedures. Can you help? 1. I am looking for a reference of pgSQL functions, etc.? (I have all the books, they have just a few, I also looked all over the web). If you can post a link, tia. For example, what does the || do in pg SQL with a string? I am l

Re: [SQL] Help with a query for charting

2003-02-02 Thread mallah
you could keep a table with list of all possible days in a month. left join that to the results you get from query below this will return NULL for days where there is no data. NULL could then easily converted to 0 using CASE or COALESCE. regds mallah. > I'm trying to do a query to count the n

Re: [SQL] returning table from a function

2003-02-02 Thread mallah
Hmm.. do you mean functions returning sets then http://techdocs.postgresql.org/guides/SetReturningFunctions is for you. regds mallah. - Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.c

Re: [SQL] how can i convert a substring to a date?

2003-02-02 Thread Ross J. Reedstrom
On Thu, Jan 30, 2003 at 11:03:43PM -0800, joe.guyot wrote: > greetings all! > > > and continually get different errors: > "bad date external representation 'createdate'" > or > "bad timestamp external representation 'createdate'" > > i'm sure this has an obvious solution but i can't seem

Re: [SQL] Postgres MD5 Function

2003-02-02 Thread David Durst
Is there anywhere I can get these in binary? Or is my only option to compile Postgres from source?? > Larry Rosenman wrote: >> --On Friday, January 31, 2003 01:34:42 -0800 David Durst >> <[EMAIL PROTECTED]> wrote: >>> Does there exsist a MD5 Function I can call??? >> >> look at /contrib/pgcrypto in

Re: CR/LF conversion (was: [SQL] import error)

2003-02-02 Thread Bruce Momjian
We are supporting Win32 in 7.4, so it is very likely COPY will support carriage returns the next release. --- Tom Lane wrote: > Oliver Vecernik <[EMAIL PROTECTED]> writes: > > It's always the same problem with CR/LF conversi

Re: [SQL] Postgres MD5 Function

2003-02-02 Thread Joe Conway
David Durst wrote: Is there anywhere I can get these in binary? Or is my only option to compile Postgres from source?? Depends on the type of binary. E.g. there is a postgresql-contrib-7.3.1-1PGDG.i386.rpm binary available here: ftp://ftp.us.postgresql.org/binary/v7.3.1/RPMS/redhat-7.3/ Joe