![]() ![]() ![]() |
Ispirer SQLWays Database Migration Software
Conversion of Oracle %ROWTYPE to MySQL
The Oracle %ROWTYPE attribute provides a record type that represents a row in a database table. If you use %ROWTYPE and any column's type changes or the number of columns in the table is changed, your application code remains correct and uses the latest column and type information. This provides data independence from applications, and allows reducing application maintenance code.
MySQL has no an equivalent of Oracle %ROWTYPE. In MySQL it is necessary to declare a variable for every column.
SQLWays changes Oracle variable declaration with the %ROWTYPE attribute to the MySQL variable declaration list with the same names and data types as column's names and data types in the database table.
If there is variable with reference to a field in the record in the procedure body, SQLWays changes it to appropriate variable. If there is an assignment statement with variable using %ROWTYPE in the procedure body, SQLWays changes the assignment statement to the list of assignment statements for each variable.
Examples of the conversion:
Given the table ora_rt contains two columns: ID of NUMBER(10) and Name of VARCHAR2(10).
Remarks: in the table ora_rt there are two columns: ID of NUMBER(10) and Name of VARCHAR2(10).
![]() ![]() ![]() |