Skip to content

Tag: types

Using declared variables in SQL Oracle query FOR LOOP

I’m attempting to write a query script where I declare a variable and then use them in a select statement in Oracle SQL. Basically script should check if parent tables’ entries are used in referenced table or not. if not –> delete the entry from REF table. So far I have this So far LOG_MS…

CREATE TYPE on MySQL

I couln’t create a new data type on MySQL. Query is given below How can I do that on MySQL Answer You cannot. MySQL doesn’t have user-defined types. (At least, not in current versions.)

Change PostgreSQL columns used in views

I would like PostegreSQL to relax a bit. Every time I want to change a column used in a view, it seems I have to drop the view, change the field and then recreate the view. Can I waive the extra protection and just tell PostgreSQL to let me change the field and then figure out the adjustment to the

How to use money data type in Java, SQL, ORM

What are best practises in using money data type in Java application? Money should be in double variable? What about rounding, currencies and so on. Are special libraries for this? And what about ORM and SQL in most popular databases. As I know not in all SQL engines is Money data type. In that case NUMERIC(1…