What will happen if i do not define length attribute in my hibernate mapping hbm.xml file?
what is the default length value it will take for that column?
Thanks
What will happen if i do not define length attribute in my hibernate mapping hbm.xml file?
what is the default length value it will take for that column?
Thanks
Since you tagged SQL Developer...
You can grab this XML extension from our GitHub repo. In particular, the 'MultiSelectObjectExample'
Once this is added, you can multi-select a ton of tables in the connection tree, right click, and generate your code to run.
Let's say you wan to add a column called STACKOVERFLOW, a VARCHAR2(4000), to a bunch of tables.
Select the tables, do the right click.
Then in the pop-up dialog:
Copy that block of text to a SQL Worksheet.
Run it.
See the button i have in the red box? If you click that, it'll copy the output to a new sql worksheet so you can run it.
This is a lot of steps, but if you want GUI help for dynamically doing something to a lot of objects, it could be very useful.
You could of course alter the code to add that text to a local variable and use EXECUTE IMMEDIATE, but then it would be very easy to mess up 100 tables in one go. I like the DBMS_OUTPUT way as it forces me to look at the code before I execute it.
Loop over the list of tables and execute alter scripts you Need with execute immediate
In this example I rename all tables created under my user
begin
for rec in (select * from user_tables)
execute immediate 'ALTER TABLE '|| rec.table_name|| ' RENAME TO DUP_'|| rec.table_name;
end Loop;
end;
/
You can then dynamically generate the alter command that you need from the data dictionary