Create table name with, for exemple: CREATE TABLE rf1 (id NUMBER PRIMARY KEY, path VARCHAR(255) UNIQUE, ot_format VARCHAR(6));
(self,remoteNameFile)
| 23 | self.ERROR_ODCIEXTTABLEOPEN="ORA-29913: " |
| 24 | |
| 25 | def __createTableForReadFile__(self,remoteNameFile): |
| 26 | ''' |
| 27 | Create table name with, for exemple: |
| 28 | CREATE TABLE rf1 (id NUMBER PRIMARY KEY, path VARCHAR(255) UNIQUE, ot_format VARCHAR(6)); |
| 29 | ''' |
| 30 | logging.info('Create the table: {0}'.format(self.tableName)) |
| 31 | query = "CREATE TABLE {0} (line varchar2(256)) ORGANIZATION EXTERNAL (TYPE oracle_loader DEFAULT DIRECTORY {1} ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE BADFILE 'bad_data.bad' NOLOGFILE FIELDS TERMINATED BY ',' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (line)) LOCATION ('{2}')) PARALLEL REJECT LIMIT 0 NOMONITORING".format(self.tableName, self.directoryName, remoteNameFile) |
| 32 | response = self.__execThisQuery__(query=query,isquery=False) |
| 33 | if isinstance(response,Exception) : |
| 34 | logging.info('Error with the SQL request {0}: {1}'.format(query,str(response))) |
| 35 | return response |
| 36 | else : return True |
| 37 | |
| 38 | def __createTableForExec__(self,remoteNameFile): |
| 39 | ''' |
no test coverage detected