Re: [SQL] count record in plpgsql

2004-11-29 Thread Tomasz Myrta
how can i know the count of record in plpgsql.example if i'm query with query komponent from delphi i will know the record count of record.but how with plpgsql. any ideas? Is it what you need: GET DIAGNOSTICS n = ROW_COUNT; after executing query ? Regards, Tomasz Myrta

Re: [SQL] count record in plpgsql

2004-11-29 Thread Richard Huxton
Nurdin wrote: how can i know the count of record in plpgsql.example if i'm query with query komponent from delphi i will know the record count of record.but how with plpgsql. GET DIAGNOSTICS integer_var = ROW_COUNT; See the manual for details (plpgsql section, "Obtaining the result status"). HTH --

[SQL] version 7.4 autocommit removed

2004-11-29 Thread Christoph Haller
The Release Notes on 7.4 state Observe the following incompatibilities: The server-side autocommit setting was removed and reimplemented in client applications and languages. Server-side autocommit was causing too many problems with languages and applications that wanted to control their own auto

[SQL] INDEX and LIKE

2004-11-29 Thread T E Schmitz
Hello, I need to be able to perform wildcard searches on a VARCHAR(100) column of the form SELECT * FROM item WHERE serial_no LIKE '%12345678%' Would an index on serial_no do anything at all for this search? -- Regards/Gruß, Tarlika Elisabeth Schmitz ---(end of broadcast)-

Re: [SQL] INDEX and LIKE

2004-11-29 Thread Olivier Hubaut
On Mon, 29 Nov 2004 12:19:12 +, T E Schmitz <[EMAIL PROTECTED]> wrote: Hello, I need to be able to perform wildcard searches on a VARCHAR(100) column of the form SELECT * FROM item WHERE serial_no LIKE '%12345678%' Would an index on serial_no do anything at all for this search? No, It wou

[SQL] Crystal Report + Bytea field

2004-11-29 Thread sreejith s
Hai friends, I stored image in binay format at a field with type bytea. Now i have to display the image(Stored in the bytea field) in a crystal report. is this possible. How? Pls Reply Sreejith ---(end of broadcast)--- TIP 7: don't forget to increase

[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 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

Re: [SQL] PG7.4.5: query not using index on date column

2004-11-29 Thread Dave Steinberg
Sorry for the delay in getting back on this thread, painting my apartment meant no internet over this thanksgiving break... :) How many rows in the table altogether? A rough guess is a few million based on the estimated seqscan cost. That would mean that this query is retrieving about 10% of t

[SQL] create stored procedure from temporary table

2004-11-29 Thread Nurdin
i was wondering, how to create dynamic table like temporary table but create from function and the result from function toocos i want count same calculation from other table migh be a multiple table so i need looping and join table...   thnax   nurdin

Re: [SQL] Way to stop recursion?

2004-11-29 Thread Chris Travers
Jonathan Knopp wrote: Sorry, I should have mentioned that there is a lot more to the design that makes this replication necessary, including another two levels to the tree plus the ability to have orphaned children. My first thought was "Dude, use a VIEW" In database design, the SPOT princip

[SQL] grouping a many to many relation set

2004-11-29 Thread Johan Henselmans
Hi, I am having a problem grouping a many to many relationship with payments and receipts, where a payment can be for multiple receipts, and a receipt can have multiple payments. I got a list of records that are involved in such relations, but now I don't know how to group them so that all paym

Re: [SQL] create stored procedure from temporary table

2004-11-29 Thread Christopher Browne
Oops! [EMAIL PROTECTED] ("Nurdin") was seen spray-painting on a wall: > i was wondering, how to create dynamic table like temporary table > but create from function and the result from function toocos i > want count same calculation from other table migh be a multiple > table so i need looping

Re: [SQL] TEXT::CIDR/INET::CIDR output confusion

2004-11-29 Thread Bruce Momjian
Added to TODO list: * Prevent INET cast to CIDR from droping netmask, SELECT '1.1.1.1'::inet::cidr It is probably related to the TODO item above it: * Prevent INET cast to CIDR if the unmasked bits are not zero, or zero the bits I think the original

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] TEXT::CIDR/INET::CIDR output confusion

2004-11-29 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I think the original code thought CIDR and INET where identical types > that could be cast with no changes but we are finding that was incorrect. That's what it seems to boil down to. We need to rethink the separation between those datatypes. At the ve