Inserting constant numbers into table with LogParser

时间:2019-01-18 18:22:46

标签: oracle logparser

I am trying to use LogParser to push data from an IIS log file to an Oracle SQL database that was setup with Oracle SQL Developer. I am trying to figure out how to insert a constant number into a column with the data type NUMBER with NOT NULL ENABLED.

Whenever I use the following command line:

LogParser "SELECT 45 AS SERV_ID FROM %logfile% TO %tablename%" -o:SQL -oConnString: "Driver={Oracle in OraClient11g_home1};DBQ=%database%;Uid=%userID%;Pwd=%password%"

I get the following error:

SQL table column "SERV_ID" data type is not compatible with SELECT clause
  item "SERV_ID" (type INTEGER)

I tried using TO_NUMBER('45') and get an unknown field error and using 45.0. 45.0 runs with no errors, but when I refresh the database in Oracle, the SERV_ID is 0. I'm not sure how to convert an INTEGER to a NUMBER, or if it is even possible. Any help would be appreciated.

0 个答案:

没有答案