head	1.6;
access;
symbols;
locks; strict;
comment	@# @;


1.6
date	92.07.13.17.51.52;	author mer;	state Exp;
branches;
next	1.5;

1.5
date	92.07.12.18.58.48;	author mer;	state Exp;
branches;
next	1.4;

1.4
date	92.07.12.16.45.36;	author mao;	state Exp;
branches;
next	1.3;

1.3
date	91.03.19.15.52.09;	author kemnitz;	state Exp;
branches;
next	1.2;

1.2
date	91.03.19.15.08.55;	author kemnitz;	state Exp;
branches;
next	1.1;

1.1
date	91.03.19.00.25.05;	author kemnitz;	state Exp;
branches;
next	;


desc
@@


1.6
log
@replace an existing emps salary and fix the function to not do a join
@
text
@/* 
 *  postquel functions can also take multiple arguments.  Arguments may
 *  be either base types or complex types (classes).
 */

/*
 *  this function raisers the salary of an employee and returns 'true'.
 *  by convention, the return value of a postquel procedure is the
 *  value produced by the last query in the procedure -- in this case,
 *  the 'retrieve'.
 */

    define function raise_sal (language = "postquel", returntype = bool)
    arg is (char16, int4)
    as "replace e (salary = e.salary + $2) from e in emp
		where e.name = $1
	retrieve (x = \\"t\\"::bool)"

\p
\g

/* give mike a raise -- have to typecast the char16 arg */
retrieve (x = raise_sal("sam"::char16, 100))
\p
\g
@


1.5
log
@oops, need a double backslash when running from the monitor
@
text
@d13 1
a13 1
define function raise_sal (language = "postquel", returntype = bool)
d15 2
a16 2
    as "replace emp (salary = e.salary + $2) from e in emp
		where e.name = $1 and emp.oid = e.oid
d18 1
d23 1
a23 1
retrieve (x = raise_sal("mike"::char16, 100))
@


1.4
log
@fixes for new 4.0 syntax, function support
@
text
@d17 1
a17 1
	retrieve (x = \"t\"::bool)"
@


1.3
log
@demo shuffling
@
text
@d2 2
a3 1
 * and of course it works correctly
d6 17
a22 2
retrieve (emp.manager.name)
where emp.name= "bill"
d24 1
@


1.2
log
@reorganized demo scripts
@
text
@d1 6
a6 1
retrieve (toyemp2.all)
@


1.1
log
@Initial revision
@
text
@d1 1
a1 4
/*
 * and update a newly added instance
 */
replace emp1 (salary = 2500) where emp1.name = "joe" and emp1.dept = "shoe"
@
