User Tools

Site Tools


podoc:number_of_location_references_sql_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
podoc:number_of_location_references_sql_function [2007/04/12 12:26] Luudpodoc:number_of_location_references_sql_function [2007/04/23 14:31] (current) Luud
Line 1: Line 1:
-===== Database Function Description =====+===== Database Function Description of "number_of_location_references" =====
  
 === Name === === Name ===
 +
 +number_of_location_references
  
 === Description === === Description ===
 +
 +Counts the number of references to a particular location.
 +
 +Tentative (is this correct?): this represents the number of photos in the database captured at the specified location.
  
 === Purpose === === Purpose ===
 +
 +To retrieve the number of references to a particular location.
  
 === Schema === === Schema ===
 +
 +<code sql>
 +create function number_of_location_references(integer) returns bigint
 +as 'select count(photo.identifier)
 +      from photo, location
 +     where photo.location=location.identifier
 +       and location.identifier = $1' language 'sql';
 +</code>
  
 === Related tables === === Related tables ===
  
-=== Related views === +  * [[location sql table|location]] 
- +  * [[photo sql table|photo]]
-=== Related sequences === +
- +
-=== Related indexes ===+
  
 === History === === History ===
Line 31: Line 44:
 = Version 2.5 = = Version 2.5 =
  
-  create function ... +<code sql> 
-    ...   +create function number_of_location_references(integer) returns bigint 
-  );+as 'select count(photo.identifier) 
 +      from photo, location 
 +     where photo.location=location.identifier 
 +       and location.identifier = $1' language 'sql'; 
 +</code> 
podoc/number_of_location_references_sql_function.1176380765.txt.gz · Last modified: 2007/04/12 12:26 by Luud