Database Migration in C++ and Oracle
-
I have a very general question on database migration. Am pretty new to database development and have no ideas at all, so please bear with me.
I am working on a VC++ MFC application using Visual Studio. This has a Oracle backend database.
There's a table called T_SIGN_IN that has the following columns,
- USR_NAME
- USR_ID
- USR_ACCT_NUMBER
- USR_ADDRESS
- USR_SSN
- USR_LAST_LOG_IN
- USR_LAST_LOG_OFF
............and so on...
Now as part of a new feature enhancement, we want to create a new table called T_SIGN_LOG and migrate some of the existing column data from T_SIGN_IN.
For e.g., we want to move data from USR_ID, USR_LAST_LOG_IN and USR_LAST_LOG_OFF to the new table.
How can this be achieved?
I hear that there're 2 ways of achieving this.
- Stored Procedures.
- C++ function.
Can someone give me a example of how this can be done via the above 2 approaches? Code snippet will be great!
And also, which is the best way of doing it?
-
I have a very general question on database migration. Am pretty new to database development and have no ideas at all, so please bear with me.
I am working on a VC++ MFC application using Visual Studio. This has a Oracle backend database.
There's a table called T_SIGN_IN that has the following columns,
- USR_NAME
- USR_ID
- USR_ACCT_NUMBER
- USR_ADDRESS
- USR_SSN
- USR_LAST_LOG_IN
- USR_LAST_LOG_OFF
............and so on...
Now as part of a new feature enhancement, we want to create a new table called T_SIGN_LOG and migrate some of the existing column data from T_SIGN_IN.
For e.g., we want to move data from USR_ID, USR_LAST_LOG_IN and USR_LAST_LOG_OFF to the new table.
How can this be achieved?
I hear that there're 2 ways of achieving this.
- Stored Procedures.
- C++ function.
Can someone give me a example of how this can be done via the above 2 approaches? Code snippet will be great!
And also, which is the best way of doing it?