[comp.databases] Questions and suggestions regarding SYBASE

rpburry@ncs.dnd.ca (Paul Burry) (04/01/91)

Here's a couple of questions and implicit suggestions regarding SYBASE...


1. When will is be possible to provide tables as parameters to stored
   procedures?


2. Why is it not possible to evaluate a string containing T-SQL under T-SQL?

   It seems that the evaluation of stored procedures can fail due to reasons
   similar to those that could be encountered during 'dynamic' evaluation (ie.
   referenced procedures or tables not present, etc), thus I cannot imagine any
   reasons why this command could not be implemented.

   I fully realize that such a command could be implemented under Open Server,
   but such a workaround can only be described as kludgy at best.

	ie.

	/** contrived example with typos follows... **/	
        ------------------------ cut here ------------------------------
	create proc P(S varchar(20) = null) as
		declare
			@query		varchar(255),
			@evalresult	int
			@queryresult	int

		/* do some miscellaneous processing, logging, and auditting */
			. . .

		/* construct a query. (and remember to double-up quotes etc) */
		select @query = "select * from " + S

		/*
		** evaluate the constructed query with the proposed "evaluate"
		** command.
		*/
		select @evalresult=evaluate(@queryresult,@query)

		/*
		** or alternatively...
		**
		select @evalresult=evaluate(@queryresult, "select * from " + S)
		*/

		/* do some miscellaneous processing, logging, and auditting */
			. . .

		return @queryresult
        ------------------------ cut here ------------------------------


So, how about it?  Maybe in V5.


PS. I just received V4.2 :-))
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Paul Burry			
Voice: (613)-991-7325		Internet: rpburry@ncs.dnd.ca
Fax:   (613)-991-7323		UUCP:	  ..!{uunet,cunews}!ncs.dnd.ca!rpburry