Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!prls!pyramid!infmx!perk From: perk@infmx.UUCP (Paul Perkovic) Newsgroups: comp.databases Subject: Re: Asynchronous SQL and Ingres Message-ID: <3510@infmx.UUCP> Date: 1 Mar 90 21:31:55 GMT References: <2438@ncr-sd.SanDiego.NCR.COM> <745@dgis.dtic.dla.mil> Reply-To: perk@infmx.UUCP (Paul Perkovic) Distribution: usa Organization: Informix, Menlo Park, Ca. U.S.A. Lines: 58 In article <745@dgis.dtic.dla.mil> jkrueger@dgis.dtic.dla.mil (Jon) writes: >loreen@otl.SanDiego.NCR.COM (Loreen Prinz) writes: > >>Does Ingres support asynchronous SQL???? > >I give up. What is asynchronous SQL? >SQL that returns without waiting for the query to execute? Exactly. In the current ANSI working draft for SQL3, any executable SQL statement can be prefixed by an ASYNC clause, which supplies a statement identifier and indicates that the DBMS may execute the statement asynchronously. For example: ASYNC 5 UPDATE EMP SET SALARY = SALARY * 1.06 WHERE STATUS = 'A'; might give each employee with an acceptable status a 6% raise. The user or application can then do other things while the database engine performs the update. Later, the application can use the to determine whether the update has completed, e.g.: TEST (5) COMPLETION; which returns an exception (SQL statement not yet complete) if asynchronous statement 5 is still executing, and returns normally if it is finished. An alternative form allows your application to wait until the asynchronous statement completes: WAIT (5) COMPLETION; A COMMIT WORK waits for all outstanding asynchronous statements to complete; a ROLLBACK WORK terminates any outstanding asynchronous statements. Thus, the scope of potential overlap among asynchronous executions is limited to a single transaction. If this facility remains in the document by the time SQL3 is standardized (mid 1990's), it will permit a standard-conforming application program to take advantage of available parallelism in the environment, such as might be available in a distributed network of database servers. Otherwise, each SQL statement blocks until it completes, and overlapped processing is not possible within the single application context. Sorry, I cannot answer Loreen's original question; perhaps someone from Ingres can? Oh, in case you're wondering . . . is an ? Yes, of course. Does that mean you can write: ASYNC 6 WAIT (6) COMPLETION; which obviously means to wait for itself to complete? Why not? / perk perk@informix.com ...{pyramid|uunet}!infmx!perk Paul Perkovic (415) 591-7700 anytime Informix Software, Inc. (415) 926-6821 17 Rinconada Cir./ Belmont, CA 94002 4100 Bohannon Dr./ Menlo Park, CA 94025