MySQL Forums
Forum List  »  Views

Specific column type
Posted by: Tony Nelson
Date: July 12, 2011 03:54PM

I'm trying to create a simple view like this:

mysql> create or replace view foo as select 1 as col1 union select 2;
Query OK, 0 rows affected (0.00 sec)

I'm using this view with hibernate and I really need col1 to be an int(11).

mysql> describe foo;
+-------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| col1 | bigint(20) | NO | | 0 | |
+-------+------------+------+-----+---------+-------+
1 row in set (0.00 sec)

Is there any syntax I can use to influence the data type for this column?

Thanks in advance
Tony

Options: ReplyQuote


Subject
Views
Written By
Posted
Specific column type
2160
July 12, 2011 03:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.