Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0708B182BC for ; Tue, 14 Jul 2015 15:32:27 +0000 (UTC) Received: (qmail 80117 invoked by uid 500); 14 Jul 2015 15:32:05 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 80094 invoked by uid 500); 14 Jul 2015 15:32:04 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 80081 invoked by uid 99); 14 Jul 2015 15:32:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2015 15:32:04 +0000 Date: Tue, 14 Jul 2015 15:32:04 +0000 (UTC) From: "Dmitry Tolpeko (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-11254) Process result sets returned by a stored procedure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-11254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14626485#comment-14626485 ] Dmitry Tolpeko commented on HIVE-11254: --------------------------------------- An example of a stored procedure returning a result set (DB2, Teradata syntax): {code} CREATE PROCEDURE spResultSet1 DYNAMIC RESULT SETS 1 BEGIN DECLARE cur1 CURSOR WITH RETURN FOR SELECT 'A', 'A1' FROM src LIMIT 3; OPEN cur1; END; {code} Then this procedure can be called and results fetched as follows: {code} DECLARE v1 VARCHAR(10); DECLARE v2 VARCHAR(10); CALL spResultSet1; ALLOCATE c1 CURSOR FOR PROCEDURE spResultSet1; -- Teradata syntax FETCH c1 INTO v1, v2; WHILE (SQLCODE = 0) DO -- ... FETCH c1 INTO v1, v2; END WHILE; CLOSE c1; {code} > Process result sets returned by a stored procedure > -------------------------------------------------- > > Key: HIVE-11254 > URL: https://issues.apache.org/jira/browse/HIVE-11254 > Project: Hive > Issue Type: Improvement > Components: hpl/sql > Reporter: Dmitry Tolpeko > Assignee: Dmitry Tolpeko > > Stored procedure can return one or more result sets. A caller should be able to process them. > -- This message was sent by Atlassian JIRA (v6.3.4#6332)