functions.hlp
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:1k
- .pgaw:Help.f.t insert end "Functions" {title} "
- The Functions tab is used to inspect the user defined functions in the
- database, to define new functions and to alter the existing ones.
- Press the "New" button to define a new function. You should enter the
- function name, the function parameters (if any) separated by comma.
- If function returns a value, you should specify the " {}
- "PostgreSQL data type" {link data_types} " that function will return.
- You must also specify the language that will be used to parse the defined
- function. You could specify SQL, plpgsql, pgtcl or C. Then you should enter the
- function body. Press "Save" button in order to save it
- " {} "Example:" {italic} "
- We have a table called "products" that is indexed on "id" (int4) field and
- contains the float8 field "price". We will define a new function "get_product_price"
- that will return the product price for a given id.
- You should enter " {} "get_product_price" {code} " as the function name, " {}
- "int4" {code} " in parameters entry, " {} "float8" {code} " for returns, " {}
- "SQL" {code} " for the language. Then go to the function body definition and type:" {} "
- SELECT price FROM products where id = $1" {code} "
- To delete a function, select it from the list box and use the menu command
- Object/Delete.
- For more information see SQL commands " {} "CREATE FUNCTION" {link create_function} " and " {}
- "DROP FUNCTION" {link drop_function}