db2:如何在导入或加载过程中对列进行重新排序?

问题描述

例如: 表格包含3列:

Name varchar(10),ID   int,Place Varchar(10)

文件的ID,名称和位置与上表的顺序不同:

1|Ram  |Ayodhya              
2|Rahul|Srilanka

解决方法

您可以在INSERT子句的一部分中指定Db2 IMPORT command中的列列表。

`C:\Users\Lenovo\Documents\Django project\project3\fees\views.py changed,reloading.
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\Lenovo\anaconda3\lib\threading.py",line 932,in _bootstrap_inner
    self.run()
  File "C:\Users\Lenovo\anaconda3\lib\threading.py",line 870,in run
    self._target(*self._args,**self._kwargs)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\utils\autoreload.py",line 53,in wrapper
    fn(*args,**kwargs)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\core\management\commands\runserver.py",line 118,in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\core\management\base.py",line 392,in check
    all_issues = checks.run_checks(
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\core\checks\registry.py",line 70,in run_checks
    new_errors = check(app_configs=app_configs,databases=databases)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\contrib\staticfiles\checks.py",line 7,in check_finders
    for finder in get_finders():
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\contrib\staticfiles\finders.py",line 282,in get_finders
    yield get_finder(finder_path)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\contrib\staticfiles\finders.py",line 295,in get_finder
    return Finder()
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\django\contrib\staticfiles\finders.py",line 59,in __init__
    prefix,root = root
ValueError: not enough values to unpack (expected 2,got 1)`

LOAD command也可以执行相同的列重新排序。