Logo Search packages:      
Sourcecode: relational version File versions  Download package

def relational::relation::relation::insert (   self,
  values 
)

Inserts a tuple in the relation.
This function will not insert duplicate tuples.
All the values will be converted in string.
Will return the number of inserted rows.

Definition at line 460 of file relation.py.

00460                            :
        '''Inserts a tuple in the relation.
        This function will not insert duplicate tuples.
        All the values will be converted in string.
        Will return the number of inserted rows.'''
        
        #Returns if tuple doesn't fit the number of attributes
        if len(self.header.attributes) != len(values):
            return 0
            
        #Creating list containing only strings
        t=[]
        for i in values:
            t.append(str(i))
        
        if t not in self.content:
            self.content.append(t)
            return 1
        else:
            return 0
    
    def delete(self,expr):


Generated by  Doxygen 1.6.0   Back to index