使用单个语句将多个行值与日期一起插入到oracle11g数据库中

时间:2015-10-19 09:43:36

标签: database oracle

我已经在单个语句中插入多行值来编写查询。当我插入它显示的日期' 01821。 00000 - "日期格式无法识别"'。请在此处找到

的查询
  INSERT ALL 
INTO SUPP (ACC_NO,S_NAME,PRICE,DOS) VALUES (3010,'MARIA_CURIE',130,to_date('2011103','YYYYMMDD'))
INTO SUPP (ACC_NO,S_NAME,PRICE,DOS) VALUES (4010,'GALILO_GALILE',180,to_date('20121116','YYYYMMMDD'))
INTO SUPP (ACC_NO,S_NAME,PRICE,DOS)  VALUES (5010,'BLAISE_PASCAL',101,to_date('2010101','YYYYMMDD')) 
SELECT * FROM DUAL;

但是当我一次插入一个时,它执行完整的样本,如下所示

   INSERT ALL 
INTO SUPP (ACC_NO,S_NAME,PRICE,DOS) VALUES (3010,'MARIA_CURIE',130,to_date('2011103','YYYYMMDD'))
SELECT * FROM DUAL;

1 个答案:

答案 0 :(得分:1)

问题在于第二次插入的日期格式,日期格式中有一个额外的m ...试试这个:

namespace Oro\Bundle\DataGridBundle\Extension\Toolbar;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

use Oro\Bundle\ConfigBundle\Config\ConfigManager;

class Configuration implements ConfigurationInterface
{
    /** @var int */
    private $defaultPerPage;

    /**
     * @param ConfigManager $cm
     */
    public function __construct(ConfigManager $cm)
    {
        $this->defaultPerPage = $cm->get('oro_data_grid.default_per_page');
    }

    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();

        $builder->root('toolbarOptions')
            ->children()
                ->booleanNode('hide')->defaultFalse()->end()
                ->booleanNode('addResetAction')->defaultTrue()->end()
                ->booleanNode('addRefreshAction')->defaultTrue()->end()
                ->integerNode('turnOffToolbarRecordsNumber')->defaultValue(0)->end()
                ->arrayNode('pageSize')->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('hide')->defaultFalse()->end()
                        ->scalarNode('default_per_page')->defaultValue($this->defaultPerPage)->end()
                        ->arrayNode('items')
                            ->defaultValue([10, 25, 50, 100])
                            ->prototype('variable')->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('pagination')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('hide')->defaultFalse()->end()
                    ->end()
                ->end()
            ->end();

        return $builder;
    }
}