+ (let ((query
+ (if owner
+ (format nil
+ "select user_tab_columns.column_name from user_tab_columns,all_tables where user_tab_columns.table_name='~A' and all_tables.table_name=user_tab_columns.table_name and all_tables.owner='~:@(~A~)'"
+ table owner)
+ (format nil
+ "select column_name from user_tab_columns where table_name='~A'"
+ table))))
+ (mapcar #'car (database-query query database nil nil))))
+
+(defmethod database-attribute-type (attribute (table string)
+ (database oracle-database)
+ &key (owner nil))
+ (let ((query
+ (if owner
+ (format nil
+ "select data_type,data_length,data_scale,nullable from user_tab_columns,all_tables where user_tab_columns.table_name='~A' and column_name='~A' and all_tables.table_name=user_tab_columns.table_name and all_tables.owner='~:@(~A~)'"
+ table attribute owner)
+ (format nil
+ "select data_type,data_length,data_scale,nullable from user_tab_columns where table_name='~A' and column_name='~A'"
+ table attribute))))
+ (destructuring-bind (type length scale nullable) (car (database-query query database :auto nil))
+ (values (ensure-keyword type) length scale
+ (if (char-equal #\Y (schar nullable 0)) 1 0)))))
+