Search Results

Search found 1523 results on 61 pages for 'assignment'.

Page 1/61 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • behaviour of the implicit copy constructor / assignment operator

    - by Tobias Langner
    Hello, I have a question regarding the C++ Standard. Suppose you have a base class with user defined copy constructor and assignment operator. The derived class uses the implicit one generated by the compiler. Does copying / assignment of the derived class call the user defined copy constructor / assignment operator? Or do you need to implement user defined versions that call the base class? Thank you for your help.

    Read the article

  • Overloading assignment operator in C++

    - by jasonline
    As I've understand, when overloading operator=, the return value should should be a non-const reference. A& A::operator=( const A& ) { // check for self-assignment, do assignment return *this; } It is non-const to allow non-const member functions to be called in cases like: ( a = b ).f(); But why should it return a reference? In what instance will it give a problem if the return value is not declared a reference, let's say return by value?

    Read the article

  • Freeradius on Linux with dynamic VLAN assignment via AD

    - by choki
    I've been trying to configure my freeradius server on Linux to authenticate users from an existing Active Directory (windows server 2003) and i've already done that. Now i need to assign VLANs to those users and i dont know how to :(. The logical procedure should be with an AD attribute but i haven't found which one nor how to read it from the AD to use it on the freeradius server... Can anyone help me with this or tell me where can i find a solution? Thanks in advance

    Read the article

  • [Ruby] Object assignment and pointers

    - by Jergason
    I am a little confused about object assignment and pointers in Ruby, and coded up this snippet to test my assumptions. class Foo attr_accessor :one, :two def initialize(one, two) @one = one @two = two end end bar = Foo.new(1, 2) beans = bar puts bar puts beans beans.one = 2 puts bar puts beans puts beans.one puts bar.one I had assumed that when I assigned bar to beans, it would create a copy of the object, and modifying one would not affect the other. Alas, the output shows otherwise. ^_^[jergason:~]$ ruby test.rb #<Foo:0x100155c60> #<Foo:0x100155c60> #<Foo:0x100155c60> #<Foo:0x100155c60> 2 2 I believe that the numbers have something to do with the address of the object, and they are the same for both beans and bar, and when I modify beans, bar gets changed as well, which is not what I had expected. It appears that I am only creating a pointer to the object, not a copy of it. What do I need to do to copy the object on assignment, instead of creating a pointer? Tests with the Array class shows some strange behavior as well. foo = [0, 1, 2, 3, 4, 5] baz = foo puts "foo is #{foo}" puts "baz is #{baz}" foo.pop puts "foo is #{foo}" puts "baz is #{baz}" foo += ["a hill of beans is a wonderful thing"] puts "foo is #{foo}" puts "baz is #{baz}" This produces the following wonky output: foo is 012345 baz is 012345 foo is 01234 baz is 01234 foo is 01234a hill of beans is a wonderful thing baz is 01234 This blows my mind. Calling pop on foo affects baz as well, so it isn't a copy, but concatenating something onto foo only affects foo, and not baz. So when am I dealing with the original object, and when am I dealing with a copy? In my own classes, how can I make sure that assignment copies, and doesn't make pointers? Help this confused guy out.

    Read the article

  • Overload assignment operator for assigning sql::ResultSet to struct tm

    - by Luke Mcneice
    Are there exceptions for types which can't have thier assignment operator overloaded? Specifically, I'm wanting to overload the assignment operator of a struct tm (from time.h) so I can assign a sql::ResultSet to it. I already have the conversion logic: sscanf(sqlresult->getString("StoredAt").c_str(), "%d-%d-%d %d:%d:%d", &TempTimeStruct->tm_year, &TempTimeStruct->tm_mon, &TempTimeStruct->tm_mday, &TempTimeStruct->tm_hour, &TempTimeStruct->tm_min, &TempTimeStruct->tm_sec); I tried the overload with this: tm& tm::operator=(sql::ResultSet & results) { /*CODE*/ return *this; } However VS08 reports: error C2511: 'tm &tm::operator =(sql::ResultSet &)' : overloaded member function not found in 'tm'

    Read the article

  • struct assignment operator on arrays

    - by Django fan
    Suppose I defined a structure like this: struct person { char name [10]; int age; }; and declared two person variables: person Bob; person John; where Bob.name = "Bob", Bob.age = 30 and John.name = "John",John.age = 25. and I called Bob = John; struct person would do a Memberwise assignment and assign Johns's member values to Bob's. But arrays can't assign to arrays, so how does the assignment of the "name" array work?

    Read the article

  • PLPGSQL array assignment not working, "array subscript in assignment must not be null"

    - by Koen Schmeets
    Hello there, When assigning mobilenumbers to a varchar[] in a loop through results it gives me the following error: "array subscript in assignment must not be null" Also, i think the query that joins member uuids, and group member uuids, into one, grouped on the user_id, i think it can be done better, or maybe this is even why it is going wrong in the first place! Any help is very appreciated.. Thank you very much! CREATE OR REPLACE FUNCTION create_membermessage(in_company_uuid uuid, in_user_uuid uuid, in_destinationmemberuuids uuid[], in_destinationgroupuuids uuid[], in_title character varying, in_messagecontents character varying, in_timedelta interval, in_messagecosts numeric, OUT out_status integer, OUT out_status_description character varying, OUT out_value VARCHAR[], OUT out_trigger uuid[]) RETURNS record LANGUAGE plpgsql AS $$ DECLARE temp_count INTEGER; temp_costs NUMERIC; temp_balance NUMERIC; temp_campaign_uuid UUID; temp_record RECORD; temp_mobilenumbers VARCHAR[]; temp_destination_uuids UUID[]; temp_iterator INTEGER; BEGIN out_status := NULL; out_status_description := NULL; out_value := NULL; out_trigger := NULL; SELECT INTO temp_count COUNT(*) FROM costs WHERE costtype = 'MEMBERMESSAGE' AND company_uuid = in_company_uuid AND startdatetime < NOW() AND (enddatetime > NOW() OR enddatetime IS NULL); IF temp_count > 1 THEN out_status := 1; out_status_description := 'Invalid rows in costs table!'; RETURN; ELSEIF temp_count = 1 THEN SELECT INTO temp_costs costs FROM costs WHERE costtype = 'MEMBERMESSAGE' AND company_uuid = in_company_uuid AND startdatetime < NOW() AND (enddatetime > NOW() OR enddatetime IS NULL); ELSE SELECT INTO temp_costs costs FROM costs WHERE costtype = 'MEMBERMESSAGE' AND company_uuid IS NULL AND startdatetime < NOW() AND (enddatetime > NOW() OR enddatetime IS NULL); END IF; IF temp_costs != in_messagecosts THEN out_status := 2; out_status_description := 'Message costs have changed during sending of the message'; RETURN; ELSE SELECT INTO temp_balance balance FROM companies WHERE company_uuid = in_company_uuid; SELECT INTO temp_count COUNT(*) FROM users WHERE (user_uuid = ANY(in_destinationmemberuuids)) OR (user_uuid IN (SELECT user_uuid FROM targetgroupusers WHERE targetgroup_uuid = ANY(in_destinationgroupuuids)) ) GROUP BY user_uuid; temp_campaign_uuid := generate_uuid('campaigns', 'campaign_uuid'); INSERT INTO campaigns (company_uuid, campaign_uuid, title, senddatetime, startdatetime, enddatetime, messagetype, state, message) VALUES (in_company_uuid, temp_campaign_uuid, in_title, NOW() + in_timedelta, NOW() + in_timedelta, NOW() + in_timedelta, 'MEMBERMESSAGE', 'DRAFT', in_messagecontents); IF in_timedelta > '00:00:00' THEN ELSE IF temp_balance < (temp_costs * temp_count) THEN UPDATE campaigns SET state = 'INACTIVE' WHERE campaign_uuid = temp_campaign_uuid; out_status := 2; out_status_description := 'Insufficient balance'; RETURN; ELSE UPDATE campaigns SET state = 'ACTIVE' WHERE campaign_uuid = temp_campaign_uuid; UPDATE companies SET balance = (temp_balance - (temp_costs * temp_count)) WHERE company_uuid = in_company_uuid; SELECT INTO temp_destination_uuids array_agg(DISTINCT(user_uuid)) FROM users WHERE (user_uuid = ANY(in_destinationmemberuuids)) OR (user_uuid IN(SELECT user_uuid FROM targetgroupusers WHERE targetgroup_uuid = ANY(in_destinationgroupuuids))); RAISE NOTICE 'Array is %', temp_destination_uuids; FOR temp_record IN (SELECT u.firstname, m.mobilenumber FROM users AS u LEFT JOIN mobilenumbers AS m ON m.user_uuid = u.user_uuid WHERE u.user_uuid = ANY(temp_destination_uuids)) LOOP IF temp_record.mobilenumber IS NOT NULL AND temp_record.mobilenumber != '' THEN --THIS IS WHERE IT GOES WRONG temp_mobilenumbers[temp_iterator] := ARRAY[temp_record.firstname::VARCHAR, temp_record.mobilenumber::VARCHAR]; temp_iterator := temp_iterator + 1; END IF; END LOOP; out_status := 0; out_status_description := 'Message created successfully'; out_value := temp_mobilenumbers; RETURN; END IF; END IF; END IF; END$$;

    Read the article

  • Constructor or Assignment Operator

    - by ju
    Can you help me is there definition in C++ standard that describes which one will be called constructor or assignment operator in this case: #include <iostream> using namespace std; class CTest { public: CTest() : m_nTest(0) { cout << "Default constructor" << endl; } CTest(int a) : m_nTest(a) { cout << "Int constructor" << endl; } CTest(const CTest& obj) { m_nTest = obj.m_nTest; cout << "Copy constructor" << endl; } CTest& operatorint rhs) { m_nTest = rhs; cout << "Assignment" << endl; return *this; } protected: int m_nTest; }; int _tmain(int argc, _TCHAR* argv[]) { CTest b = 5; return 0; } Or is it just a matter of compiler optimization?

    Read the article

  • Seed has_many relation using mass assignment

    - by rnd
    Here are my two models: class Article < ActiveRecord::Base attr_accessible :content has_many :comments end class Comment < ActiveRecord::Base attr_accessible :content belongs_to :article end And I'm trying to seed the database in seed.rb using this code: Article.create( [{ content: "Hi! This is my first article!", comments: [{content: "It sucks"}, {content: "Best article ever!"}] }], without_protection: true) However rake db:seed gives me the following error message: rake aborted! Comment(#28467560) expected, got Hash(#13868840) Tasks: TOP => db:seed (See full trace by running task with --trace) It is possible to seed the database like this? If yes a follow-up question: I've searched some and it seems that to do this kind of (nested?) mass assignment I need to add 'accepts_nested_attributes_for' for the attributes I want to assign. (Possibly something like 'accepts_nested_attributes_for :article' for the Comment model) Is there a way to allow this similar to the 'without_protection: true'? Because I only want to accept this kind of mass assignment when seeding the database.

    Read the article

  • Must parameter of assignment operator be reference?

    - by Tim
    When overloading assignment operator of a class in C++, must its parameter be reference? For example, class MyClass { public: ... MyClass & operator=(const MyClass &rhs); ... } Can it be class MyClass { public: ... MyClass & operator=(const MyClass rhs); ... } ? Thanks!

    Read the article

  • Matlab matrix replacement assignment gives error

    - by Gulcan
    Hello, when i tried to update some part of a matrix, i got the following error message: ??? Assignment has fewer non-singleton rhs dimensions than non-singleton subscripts My code tries to update some values of a matrix that represent a binary image. My code is as follows: outImage(3:5,2:4,1) = max(imBinary(3:5,2:4,1)); When I delete last parameter (1), this time I get the same error. I guess there is a mismatch between dimensions but I could not get it. outImage is a new object that is created at that time (I tried to create it before, but nothing changed). What may be wrong? Thanks in advance, Gulcan

    Read the article

  • MATLAB matrix replacement assignment gives error

    - by Gulcan
    I tried to update some part of a matrix, I got the following error message: ??? Assignment has fewer non-singleton rhs dimensions than non-singleton subscripts My code tries to update some values of a matrix that represent a binary image. My code is as follows: outImage(3:5,2:4,1) = max(imBinary(3:5,2:4,1)); When I delete last parameter (1), this time I get the same error. I guess there is a mismatch between dimensions but I could not get it. outImage is a new object that is created at that time (I tried to create it before, but nothing changed). What may be wrong?

    Read the article

  • [C#] Is variable assignment and reading atomic operation (threading)

    - by AStrangerGuy
    I was unable to find any reference to this in the documentations... Is assigning to a double (or any other simple type, including boolean) an atomic operation viewed from the perspective of threads? double value = 0; public void First() { while(true) { value = (new Random()).NextDouble(); } } public void Second() { while(true) { Console.WriteLine(value); } } In this code sample, first method is called in one thread, and the second in another. Can the second method get a messed up value if it gets its execution during assignment to the variable in another thread? I don't care if I recieve the old value, it's only important to receive a valid value (not one where 2 out of 8 bytes are set). I know it's a stupid question, but I want to be sure, cause I don't know how CLR actually sets the variables. Thanks

    Read the article

  • Java: define terms initialization, declaration and assignment

    - by HH
    I find the defs circular statements, the subjects are defined by their verbs but the verbs are undefined! So how do you define them? The question is central to understand the term final, related. The Circular Definitions itialization: to initilise a variable. It can be can be done at the time of declaration. assignment: to assign value to a variable. It can be done anywhere. declaration: to declare value to a variable.

    Read the article

  • flex/actionscript assignment failing?

    - by user346713
    I'm seeing something weird in my actionscript code I have two classes foo and bar, bar extends foo. In a model class I have a foo member variable, I assign an bar object to the foo variable. But after the assignment the foo variable is null. [Bindable] public var f:foo; public function someFunc(arr:ArrayCollection):void { if(arr.length > 0) { var tempBar:bar = arr.getItemAt(0) as bar; if(tempBar != null) { tempBar.someProp++; f = tempBar; // f is now null } } } Any ideas on what I could be doing wrong?

    Read the article

  • Logical value of an assignment in C

    - by Andy Shulman
    while (curr_data[1] != (unsigned int)NULL && ((curr_ptr = (void*)curr_data[1]) || 1)) Two part question. What will (curr_ptr = (void*)curr_data[1]) evaluate to, logically. TRUE? Also, I know its rather hack-ish, but is the while statement legal C? I would have to go through great contortions to put the assignment elsewhere in the code, so I'd be really nice if I could leave it there, but if it's so egregious that it makes everyone's eyeballs burst into flames, I'll change it.

    Read the article

  • Destructuring assignment in JavaScript

    - by Anders Rune Jensen
    As can be seen in the Mozilla changlog for JavaScript 1.7 they have added destructuring assignment. Sadly I'm not very fond of the syntax (why write a and b twice?): var a, b; [a, b] = f(); Something like this would have been a lot better: var [a, b] = f(); That would still be backwards compatible. Python-like destructuring would not be backwards compatible. Anyway the best solution for JavaScript 1.5 that I have been able to come up with is: function assign(array, map) { var o = Object(); var i = 0; $.each(map, function(e, _) { o[e] = array[i++]; }); return o; } Which works like: var array = [1,2]; var _ = assign[array, { var1: null, var2: null }); _.var1; // prints 1 _.var2; // prints 2 But this really sucks because _ has no meaning. It's just an empty shell to store the names. But sadly it's needed because JavaScript doesn't have pointers. On the plus side you can assign default values in the case the values are not matched. Also note that this solution doesn't try to slice the array. So you can't do something like {first: 0, rest: 0}. But that could easily be done, if one wanted that behavior. What is a better solution?

    Read the article

  • Class Assignment Operators

    - by Maxpm
    I made the following operator overloading test: #include <iostream> #include <string> using namespace std; class TestClass { string ClassName; public: TestClass(string Name) { ClassName = Name; cout << ClassName << " constructed." << endl; } ~TestClass() { cout << ClassName << " destructed." << endl; } void operator=(TestClass Other) { cout << ClassName << " in operator=" << endl; cout << "The address of the other class is " << &Other << "." << endl; } }; int main() { TestClass FirstInstance("FirstInstance"); TestClass SecondInstance("SecondInstance"); FirstInstance = SecondInstance; SecondInstance = FirstInstance; return 0; } The assignment operator behaves as-expected, outputting the address of the other class. Now, how would I actually assign something from the other class? For example, something like this: void operator=(TestClass Other) { ClassName = Other.ClassName; }

    Read the article

  • Invalid assignment left hand side

    - by JoelM
    I'm getting an invalid assignment left hand side. What I'm trying to do is, to use jscolor http://jscolor.com to define the color of polygons im drawing via Mapbender http://mapbender.org. What I do: Select a polygon by clicking on it, then open the options dialog (seperate window) where I have several options including the color. MyCode: if (isTransactional) {str += "\t\t<tr>\n"; var options = ["insert", "update", "delete", "abort", "pick"]; for (var i = 0 ; i < options.length ; i++) { var onClickText = "this.disabled=true;var result = window.opener.formCorrect(document, '"+featureTypeElementFormId+"');"; onClickText += "if (result.isCorrect) {"; onClickText += "window.opener.dbGeom('"+options[i]+"', "+memberIndex+"); "; // onClickText += "window.close();"; onClickText += "}"; onClickText += "else {"; onClickText += "alert(result.errorMessage);this.disabled=false;" onClickText += "}"; if (options[i] == "insert" && hasGeometryColumn && (!fid || showSaveButtonForExistingGeometries)) { str += "\t\t\t<td><input type='button' name='saveButton' value='"+msgObj.buttonLabelSaveGeometry+"' onclick=\""+onClickText+"\" /></td>\n"; } if (!featureTypeMismatch && fid) { if (options[i] == "update" && hasGeometryColumn) { str += "\t\t\t<td><input type='button' name='updateButton' value='"+msgObj.buttonLabelUpdateGeometry+"' onclick=\""+onClickText+"\"/></td>\n"; } if (options[i] == "delete"){ var deleteOnClickText = "var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');"; deleteOnClickText += "if (deltrans){"; deleteOnClickText += onClickText + "}"; str += "\t\t\t<td><input type='button' name='deleteButton' value='"+msgObj.buttonLabelDeleteGeometry+"' onclick=\""+deleteOnClickText+"\"/></td>\n"; }} if (options[i] == "abort") { str += "\t\t\t<td><input type='button' name='abortButton' value='"+msgObj.buttonLabelAbort+"' onclick=\"window.close();\" /></td>\n"; } if (options[i] == "pick") { var color; str += "<td><input class='color' name='color' id='cPick' onchange="+color+"></td>"; str += "<td><input type='text' id='text' value="+color+"></td>"; //color = document.getElementById('cPick').value; //var color2 = color; //alert(color2); } }str += "\t\t</tr>\n";}str += "\t</table>\n";str += "<input type='hidden' id='fid' value='"+fid+"'>"; //str += "<input type='text' name='mb_wfs_conf'>"; str += "</form>\n";}return str;} The Application: It is a Mapbender application to display maps and draw on it. You can draw points, lines and polygons also merge and split them. You can also select the polygons that you have drawn to alter them. Using: PHP, JavaScript, HTML, CSS, Mapbender, jQuery, Geoserver, PostgreSQL, WMS, WFS-T Sorry guys, but I think I'm wasting your time. Will ask this question in GIS specified Q&A. Thank you for the input. Greetings Joël

    Read the article

  • Assignment operator that calls a constructor is broken

    - by Delan Azabani
    I've implemented some of the changes suggested in this question, and (thanks very much) it works quite well, however... in the process I've seemed to break the post-declaration assignment operator. With the following code: #include <cstdio> #include "ucpp" main() { ustring a = "test"; ustring b = "ing"; ustring c = "- -"; ustring d = "cafe\xcc\x81"; printf("%s\n", (a + b + c[1] + d).encode()); } I get a nice "testing cafe´" message. However, if I modify the code slightly so that the const char * conversion is done separately, post-declaration: #include <cstdio> #include "ucpp" main() { ustring a = "test"; ustring b = "ing"; ustring c = "- -"; ustring d; d = "cafe\xcc\x81"; printf("%s\n", (a + b + c[1] + d).encode()); } the ustring named d becomes blank, and all that is output is "testing ". My new code has three constructors, one void (which is probably the one being incorrectly used, and is used in the operator+ function), one that takes a const ustring &, and one that takes a const char *. The following is my new library code: #include <cstdlib> #include <cstring> class ustring { int * values; long len; public: long length() { return len; } ustring() { len = 0; values = (int *) malloc(0); } ustring(const ustring &input) { len = input.len; values = (int *) malloc(sizeof(int) * len); for (long i = 0; i < len; i++) values[i] = input.values[i]; } ustring operator=(ustring input) { ustring result(input); return result; } ustring(const char * input) { values = (int *) malloc(0); long s = 0; // s = number of parsed chars int a, b, c, d, contNeed = 0, cont = 0; for (long i = 0; input[i]; i++) if (input[i] < 0x80) { // ASCII, direct copy (00-7f) values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = input[i]; } else if (input[i] < 0xc0) { // this is a continuation (80-bf) if (cont == contNeed) { // no need for continuation, use U+fffd values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = 0xfffd; } cont = cont + 1; values[s - 1] = values[s - 1] | ((input[i] & 0x3f) << ((contNeed - cont) * 6)); if (cont == contNeed) cont = contNeed = 0; } else if (input[i] < 0xc2) { // invalid byte, use U+fffd (c0-c1) values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = 0xfffd; } else if (input[i] < 0xe0) { // start of 2-byte sequence (c2-df) contNeed = 1; values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = (input[i] & 0x1f) << 6; } else if (input[i] < 0xf0) { // start of 3-byte sequence (e0-ef) contNeed = 2; values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = (input[i] & 0x0f) << 12; } else if (input[i] < 0xf5) { // start of 4-byte sequence (f0-f4) contNeed = 3; values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = (input[i] & 0x07) << 18; } else { // restricted or invalid (f5-ff) values = (int *) realloc(values, sizeof(int) * ++s); values[s - 1] = 0xfffd; } len = s; } ustring operator=(const char * input) { ustring result(input); return result; } ustring operator+(ustring input) { ustring result; result.len = len + input.len; result.values = (int *) malloc(sizeof(int) * result.len); for (long i = 0; i < len; i++) result.values[i] = values[i]; for (long i = 0; i < input.len; i++) result.values[i + len] = input.values[i]; return result; } ustring operator[](long index) { ustring result; result.len = 1; result.values = (int *) malloc(sizeof(int)); result.values[0] = values[index]; return result; } char * encode() { char * r = (char *) malloc(0); long s = 0; for (long i = 0; i < len; i++) { if (values[i] < 0x80) r = (char *) realloc(r, s + 1), r[s + 0] = char(values[i]), s += 1; else if (values[i] < 0x800) r = (char *) realloc(r, s + 2), r[s + 0] = char(values[i] >> 6 | 0x60), r[s + 1] = char(values[i] & 0x3f | 0x80), s += 2; else if (values[i] < 0x10000) r = (char *) realloc(r, s + 3), r[s + 0] = char(values[i] >> 12 | 0xe0), r[s + 1] = char(values[i] >> 6 & 0x3f | 0x80), r[s + 2] = char(values[i] & 0x3f | 0x80), s += 3; else r = (char *) realloc(r, s + 4), r[s + 0] = char(values[i] >> 18 | 0xf0), r[s + 1] = char(values[i] >> 12 & 0x3f | 0x80), r[s + 2] = char(values[i] >> 6 & 0x3f | 0x80), r[s + 3] = char(values[i] & 0x3f | 0x80), s += 4; } return r; } };

    Read the article

  • UnboundLocalError: local variable 'rows' referenced before assignment

    - by patrick
    i'm trying to make a database connection by an other script. But the script didn't work propperly. and if I do a 'print' on the rows then I get the value 'null' But if I use a 'select * from incidents' query then i get the result from the table incidents. import database rows = database.database("INSERT INTO incidents VALUES(3 ,'test_title1', 'test', TO_DATE('25-07-2012', 'DD-MM-YYYY'), CURRENT_TIMESTAMP, 'sector', 50, 60)") #print database.database() print rows database.py script: import psycopg2 import sys import logfile def database(query): logfile.log(20, 'database.py', 'Executing...') con = None try: con = psycopg2.connect(database='incidents', user='ipfit5', password='tester') cur = con.cursor() #print query cur.execute(query) rows = cur.fetchall() con.commit() #test row does work #cur.execute("INSERT INTO incidents VALUES(3 ,'test_titel1', 'test', TO_DATE('25-07-2012', 'DD-MM-YYYY'), CURRENT_TIMESTAMP, 'sector', 50, 60)") except: logfile.log(40, 'database.py', 'Er is iets mis gegaan') logfile.log(40, 'database.py', str(sys.exc_info())) finally: if con: con.close() return rows

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >