Sybernet / Supplied Procedures Reference
Release 3.00
Mar 03, 2005
backwards forwards

HTTP.SP_GETPREFERENCE

This is one of three procedures for maintaining user preferences in Sybernet. Its primary purpose is to save user preferences for building the HTML body tag using SP_HTML_PREFERENCES. You can also use these procedures to temporarily (or permanently) store variables that may be shared between processes. These temporary variables, however, are user specific and persist until explicitly deleted with sp_delPreference. Two users logged into the same schema name share the same preference.

This procedure is used to retrieve a preference that was assigned when you called sp_putPreference.

Syntax

Procedure sp_getPreference
(
    @NAME                          VARCHAR(30)
,   @VALUE                         VARCHAR(255) OUTPUT
,   @PREFERENCE                    VARCHAR(255)
)   ;

Parameters

Parameter Description
name
 
The case-sensitive user preference that is to be retrieved.
value
 
The value corresponding to this preference.
preference
 
The value to return if no preference is defined.

Example 1

The following example illustrates how to create a user preference:

exec http.dbo.sp_putPreference 'FavoriteFood','Lasagne'

Example 2

The following example illustrates how to retrieve a user preference:

declare
    @favoriteFood varchar(255)
begin
    exec http.dbo.sp_getPreference 'FavoriteFood',@FavoriteFood,'Pizza'
    select 'Your favorite food is ' || @FavoriteFood
end

Example 3

The following example illustrates how to delete a user preference:

exec http.dbo.sp_delPreference 'FavoriteFood'

See Also

SP_DELPREFERENCE
SP_PUTPREFERENCE


Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/