Feature Requests item #2671706, was opened at 2009-03-07 19:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Nobody/Anonymous (nobody)
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);


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

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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to