Question: I'm looking for information about how to age data in a db, generally related to Oracle and Sql 
 Server, but any database would be good. Any examples or books containing examples of how the best 
 techniques would be cool.

Bob

Answer: 
I've made this function based on earlier answers in this post.
I share it here because some of previous examples has been thrown me segfaults

```
const char* str_repeat(char* str, size_t times)
{
    if (times < 1) return NULL;
    char *ret = malloc(sizeof(str) * times + 1);
    if (ret == NULL) return NULL;
    strcpy(ret, &str);
    while (--times > 0) {
        strcat(ret, &str);
    }
    return ret;
}

```
Here's a way to repeat a string in C, N times. 

That is have a string "abc" 
and I want a string of length 7 that is comprised of this string repeated. 

N = 7;
result: "abcabca" 

```
 while(Index != N){

    repeatedString[Index] = oldString[Index%strlen(oldString)];
    Index++;
 }

```

Where repeated String would be "abcabca" at the end, and oldString is "abc".