Feature Requests item #2671706, was opened at 2009-03-07 19:21
Message generated for change (Settings changed) made by skinkie
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2671706&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL - general
Group: Next Release (example)
>Status: Closed
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Niels Nes (nielsnes)
Summary: @@IDENTITY like extension for MonetDB

Initial Comment:
This implements 'in SQL' access to the last_id.

Index: src/backends/monet5/sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.319.2.1
diff -u -r1.319.2.1 sql.mx
--- src/backends/monet5/sql.mx  15 Feb 2009 10:44:34 -0000      1.319.2.1
+++ src/backends/monet5/sql.mx  7 Mar 2009 18:19:37 -0000
@@ -1330,6 +1330,7 @@
 
                if (seq && seq_next_value(seq, res)) {
                        m->last_id = *res;
+                       stack_set_number(m, "last_id", m->last_id); /* MSSQL 
defined extension @@IDENTITY */
                        return MAL_SUCCEED;
                }
        }
Index: src/backends/monet5/sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.334.2.2
diff -u -r1.334.2.2 sql_scenario.mx
--- src/backends/monet5/sql_scenario.mx 27 Feb 2009 19:26:08 -0000      
1.334.2.2
+++ src/backends/monet5/sql_scenario.mx 7 Mar 2009 18:19:38 -0000
@@ -273,7 +273,7 @@
        sql_subtype ctype;
        char *typename;
        stmt *r = NULL;
-       lng sec = 0;
+       lng sec = 0, last_id = -1;
        bit T = TRUE;
        bit F = FALSE;
        ValRecord src;
@@ -281,6 +281,7 @@
        typename = "int";
        sql_find_subtype(&ctype, typename, 0, 0);
        SQLglobal("debug", &sql->debug);
+       SQLglobal("last_id", &last_id);
 
        typename = "varchar";
        sql_find_subtype(&ctype, typename, 1024, 0);


----------------------------------------------------------------------

>Comment By: Stefan de Konink (skinkie)
Date: 2009-03-12 10:19

Message:
It is in.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2671706&group_id=56967

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to