473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Mapping select results through a function

I want to apply a function to each of the values returned by another select statement.

i.e if my fuction delete_subtree takes an integer and performs an operation (in this case deleting a node from a tree view), I want to do (this doesn't work)

select delete_subtree(select node from tree where subject ~ 'poker'));

to delete all records whose subject contains the term poker.

What's the magic incantation?
Jul 26 '07 #1
1 1959
michaelb
534 Expert 512MB
... ... ...
my fuction delete_subtree takes an integer and performs an operation ...
this doesn't work
Expand|Select|Wrap|Line Numbers
  1. select delete_subtree
  2.   (select node from tree where subject ~ 'poker');
  3.  
... ... ...
As you said, your function takes an integer, but looking at your subquery I suspect it may also return nothing or any number of rows.
See if you can work with the function that takes a varchar, so you can pass something like 'poker' and it'll do the rest.
Aug 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
6
by: naruto | last post by:
Hi all, I have the following being defined in a A.cxx file. // define in source file. Not exported to the outside world (this cannot be // moved to the header file ) #define CHANNEL_0 0...
4
by: Alonso | last post by:
Hello everybody! :-D I am trying to validate a select object in a form. It does not work fine in Explorer 6.0 because it always send the form, but in Netscape 7.0 it works really fine. The code...
3
by: rh0dium | last post by:
Hi all, Another newbie question. So you can't use signals on threads but you can use select. The reason I want to do this in the first place it I need a timeout. Fundamentally I want to run a...
3
by: Evan Smith | last post by:
I have a federated database (7.2 FP11, AIX 4.3) that seems to work fine in most aspects. Today I'm trying to add a new user mapping with the following statement: create user mapping for mngdrq01...
4
by: BentleyInc | last post by:
I'm trying to find a way to add a whildcard application mapping to aspnet_isapi.dll in IIS programmatically.... been looking into IIS administrator reference but didn't find the right function to...
4
by: Vemund Halvorsen | last post by:
Hello, What is the best way of mapping a string to function/sub? See ex bellow - probably not the best way - especially when it comes to maintenance ;) Does anybody have a better way of doing...
15
by: Paddy | last post by:
Iam wondering why the peculiar behavior of map when the function in given as None: Help on built-in function map in module __builtin__: map(...) map(function, sequence) -list Return a list...
13
by: sulyokpeti | last post by:
I have made a simple python module to handle SQL databases: https://fedorahosted.org/pySQLFace/wiki Its goal to separate relational database stuff (SQL) from algorythmic code (python). A SQLFace...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.