By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

PL/PGSQL function

P: 38
Hi all...
i have two tables roads and routes.
1) roads table which have following columns......
id, start_point, end_point, length.................. it looks like this

id + start_point + end_point + length
1 + 20 + 30 + 10
2 + 12 + 40 + 25
3 + 35 + 75 + 15
4 + 55 + 86 + 42

2) i have routes table which have following columns....
id, start_value, route,
route... datatype is array, which contains road ids...................it looks like this

id + start_value + route
1 + 8 + {1,2}
2 + 28 + {4,3,1}


i want to write a function using pl/pgsql which must serve the following purpose..

when i enter start_value 8 against route {1,2} it should accept. because 8<10 in table of roads.
when when i enter start_value 12 for route {1,2} it should not accept because 12>10 in table of roads..........

similarly against all route..........

this is very urgent problem..... can any one help.....

thnx
@rtist
Dec 18 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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