dbTalk Databases Forums  

SELECT with Function

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss SELECT with Function in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paulo Nievierowski
 
Posts: n/a

Default SELECT with Function - 09-28-2004 , 05:27 PM






Hello,

This is my first message to pgsql-novice.

I create plpgsql function "myfunc(integer)" thats returns of type
record with values from table X (the function decides what record must
be select). The parameter is an keyprod existing in table X and in
table A.

It run well sending in psql:
SELECT * FROM myfunc( 10006530 ) as (vret1 numeric, vret2 numeric);

The problem is:
I need return data from table A (this have column 'keyprod'). This
value must be passed as parameter to myfunc(). The result must be a
union of columns selected from table A and result of myfunc().

How to create this query? It's possible?

Thanks

Paulo Nievierowski

PS: Excuses my poor english.



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #2  
Old   
Kumar S
 
Posts: n/a

Default DELETE EMPTY ROWS - 09-29-2004 , 11:03 AM






Hi,
How can I delete empty rows in a table that I have.
f_huge_id | f_huge_name | f_huge_badge | f_huge_city
Quote:
f_huge_edu
-----------+-------------+--------------+-------------+-------------------
1 | Apparao | A12345 | Anakapalli
Quote:
Brown University
2 | Paparao | A23456 | Madugula
Town University
3 | | |

4 | Chinnarao | A34456 | Uppalada
Sink University
5 | Gangaraju | B34657 | Srikakulam
Kulam University
6 | | |

7 | Appalaraju | A34457 | Chodavaram
AMAL college
8 | Kanakarao | A56788 | Pisinikada
Temple University
9 | | |

10 | | |


In this table columns 3,6,9 and 10 are completely
empty. I tried

=>DELETE from my_table where fc_huge_name = ' NULL';
DELTE 0

However nothing is deleted.
Is there some command or statement that I am missing.
Can any one suggest some way.

Thank you.

Kumar.



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #3  
Old   
Devrim GUNDUZ
 
Posts: n/a

Default Re: DELETE EMPTY ROWS - 09-29-2004 , 11:57 AM



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Wed, 29 Sep 2004, Kumar S wrote:

Quote:
How can I delete empty rows in a table that I have.
snip
In this table columns 3,6,9 and 10 are completely
empty. I tried

=>DELETE from my_table where fc_huge_name = ' NULL';
DELETE FROM my_table WHERE fc_huge_name IS NULL;

will work I think.

Regards,
- --
Devrim GUNDUZ
devrim~gunduz.org devrim.gunduz~linux.org.tr
http://www.tdmsoft.com
http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBWulwtl86P3SPfQ4RAhx7AJ9GnQD/9zCbxKDESs3ye2OmAmCoaACaArzF
6JDwhKK4BwyMI9nSI6ez5Tk=
=zghJ
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.