小编Dav*_*073的帖子

ORA-01843无效月份 - 比较日期

尝试从按日期过滤的表中选择数据时出现问题.例如:

SELECT*FROM MYTABLE WHERE MYTABLE.DATEIN = '23/04/49';

Oracle错误是:

SELECT * FROM MYTABLE WHERE MYTABLE.DATEIN = '23/04/49';
Run Code Online (Sandbox Code Playgroud)

表格的源数据可能已损坏,在这种情况下:我该如何解决这个问题?我可以将此日期更改为null吗?

这个选择的结果,从nls_session_parameters中选择*; ,是:

Informe de error:
Error SQL: ORA-01843: mes no válido
01843. 00000 -  "not a valid month"
*Cause:    
*Action:
Run Code Online (Sandbox Code Playgroud)

谢谢!

sql oracle select date

21
推荐指数
3
解决办法
27万
查看次数

克隆或复制UIViewController或UIView

UII需要复制,自我控制或自我查看,我试过:

UIView* viewOfSelf =[self.view copy];
UIViewController* controller = [self copy];

UIView* viewOfSelf =[self.view mutableCopy];
UIViewController* controller = [self mutableCopy];
Run Code Online (Sandbox Code Playgroud)

错误是:

    -[UIViewController mutableCopyWithZone:]: unrecognized selector sent to instance 0xb803490
    -[UIView copyWithZone:]: unrecognized selector sent to instance 0x6e0acb0
Run Code Online (Sandbox Code Playgroud)

clone copy objective-c uiviewcontroller uiview

12
推荐指数
3
解决办法
2万
查看次数

JPA与Hibernate错误:[PersistenceUnit:JPA]无法构建EntityManagerFactory

我有Java Persistence API和Hibernate的问题.我的项目情况是:

在此输入图像描述

我的persistence.xml文件是:

<persistence 
    xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0">
    <persistence-unit name="JPA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <class>com.david.Libro</class>
        <class>com.david.Categoria</class>
        <properties>
            <property name="hibernate.show_sql" value="true" />
            <property name="javax.persistence.transactionType" value="RESOURCE_LOCAL" />
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/arquitecturaJava" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="root" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
        </properties>
    </persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)

我创建了EntityManagerFactory:

private static EntityManagerFactory buildEntityManagerFactory() 
    {
        try 
        {
            return Persistence.createEntityManagerFactory("JPA");
        } 
        catch (Throwable ex) 
        {
                    ex.printStackTrace();
            //throw new RuntimeException("Error al crear la factoria de JPA:->"+ ex.getMessage());
        }
    }
Run Code Online (Sandbox Code Playgroud)

我的错误是关于创建EntityManagerFactory:

    javax.persistence.PersistenceException: [PersistenceUnit: JPA] Unable …
Run Code Online (Sandbox Code Playgroud)

eclipse hibernate entitymanager jpa-2.0

12
推荐指数
1
解决办法
10万
查看次数

NSDateFormatter不会在NSDate中转换我的NSString

我有一个字符串,需要将其转换为日期,但它不能正确转换.我不知道为什么...我的代码是:

NSString * fecha = @"2011-12-07 11:11:29.657";

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.ZZZ"];

NSDate *dateFromString = [[NSDate alloc] init]; 
dateFromString = [dateFormatter dateFromString:fecha]; 

NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
unsigned units = NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;

NSDateComponents *components = [calendar components:units              
                                           fromDate:dateFromString];
 NSInteger* hour = [components hour];
 NSInteger* minute = [components minute];
 NSInteger* second = [components second];  

NSLog(@"Fecha: %@",fecha);
NSLog(@"Format: %@",dateFormatter.dateFormat);
NSLog(@"date: %@",dateFromString);
Run Code Online (Sandbox Code Playgroud)

在我的日志中:

2011-12-07 11:36:11.750 Catalogo-V1[13741:207] Fecha: 2011-12-07 11:11:29.657 …
Run Code Online (Sandbox Code Playgroud)

objective-c nsdate nsstring nsdateformatter

3
推荐指数
1
解决办法
2316
查看次数

Xcode4:从枚举类型'UIBarStyle'到不同枚举类型'UIBarButtonItemStyle'的隐式转换

我有这个代码:

UIBarButtonItem *backButton = [[UIBarButtonItem alloc]initWithTitle: @"Secciones" 
                                                                  style: UIBarStyleDefault
                                                                 target:nil 
                                                                 action:nil];
Run Code Online (Sandbox Code Playgroud)

并且说style: UIBarStyleDefault我收到以下警告:

从枚举类型'UIBarStyle'到不同枚举类型'UIBarButtonItemStyle'的隐式转换

warnings styles objective-c xcode4

1
推荐指数
1
解决办法
1972
查看次数