Index: openacs-4/packages/notes/sql/oracle/notes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notes/sql/oracle/notes-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/notes/sql/oracle/notes-create.sql 3 May 2001 18:23:34 -0000 1.2 +++ openacs-4/packages/notes/sql/oracle/notes-create.sql 10 Oct 2001 05:16:23 -0000 1.3 @@ -13,7 +13,8 @@ pretty_name => 'Note', pretty_plural => 'Notes', table_name => 'NOTES', - id_column => 'NOTE_ID' + id_column => 'NOTE_ID', + name_method => 'NOTE.NAME' ); end; / @@ -68,6 +69,10 @@ procedure delete ( note_id in notes.note_id%TYPE ); + + function name ( + note_id in notes.note_id%TYPE + ) return notes.title%TYPE; end note; / show errors @@ -128,6 +133,18 @@ acs_object.delete(note_id); end delete; + function name ( + note_id in notes.note_id%TYPE + ) return notes.title%TYPE + is + v_note_name notes.title%TYPE; + begin + select title into v_note_name + from notes + where note_id = name.note_id; + + return v_note_name; + end name; end note; / show errors; Index: openacs-4/packages/notes/sql/postgresql/notes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notes/sql/postgresql/notes-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/notes/sql/postgresql/notes-create.sql 3 Sep 2001 17:55:51 -0000 1.3 +++ openacs-4/packages/notes/sql/postgresql/notes-create.sql 10 Oct 2001 05:16:23 -0000 1.4 @@ -21,7 +21,7 @@ null, -- package_name ''f'', -- abstract_p null, -- type_extension_table - null -- name_method + ''note.name'' -- name_method ); return 0; @@ -144,14 +144,20 @@ end;' language 'plpgsql'; +create function note__name (integer) +returns varchar as ' +declare + p_note_id alias for $1; + v_note_name notes.title%TYPE; +begin + select title into v_note_name + from notes + where note_id = p_note_id; --- neophytosd -\i notes-sc-create.sql + return v_note_name; +end; +' language 'plpgsql'; - - - - - - +-- neophytosd +\i notes-sc-create.sql Index: openacs-4/packages/notes/sql/postgresql/notes-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notes/sql/postgresql/notes-drop.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/notes/sql/postgresql/notes-drop.sql 3 Sep 2001 17:55:51 -0000 1.4 +++ openacs-4/packages/notes/sql/postgresql/notes-drop.sql 10 Oct 2001 05:16:23 -0000 1.5 @@ -9,6 +9,7 @@ --drop functions drop function note__new (integer,integer,varchar,varchar,varchar,timestamp,integer,varchar,integer); drop function note__delete (integer); +drop function note__name (integer); --drop permissions delete from acs_permissions where object_id in (select note_id from notes);