Home » Open Source » Programming Interfaces » Question regarding OLE2....
icon5.gif  Question regarding OLE2.... [message #377608] Tue, 23 December 2008 20:13 Go to next message
setsuna
Messages: 32
Registered: November 2008
Member
Hi guys,

I am learning to use OLE2 now in PL/SQL and I encountered some strange occurances while loading the data from Excel file into the database.

In some of the column, like 'Date' and 'Quantity'; whenever I load the excel file data into the database, there is a discrepancy between data loaded to the database and those of in Excel file.

E.g: (data in excel)

Date Qty
-------- ---------------- ===> field is formatted into
20081205 100000 general format.

(data in database)

Date Qty
------- -------- ====> (both are varchar2 datatype)
2 1

this problem is solved by using get_num_propety and then convert it to varchar datatype....

My question is, why is there a discrepancy in the data (in database and excel file) and I had used get_num_property instead of get_char_property? why can't the data in excel treated as varchar implicitly? Is there any other method to get the data correctly withouth having to covert from number and to char?


Sorry for the trouble again, especially christmas is near... Embarassed
icon5.gif  Question regarding OLE2.... [message #377609 is a reply to message #377608] Tue, 23 December 2008 20:19 Go to previous message
setsuna
Messages: 32
Registered: November 2008
Member
Hi guys,

I am learning to use OLE2 now in PL/SQL and I encountered some strange occurances while loading the data from Excel file into the database.

In some of the column, like 'Date' and 'Quantity'; whenever I load the excel file data into the database, there is a discrepancy between data loaded to the database and those of in Excel file.

E.g: (data in excel)

  Date       
--------       
 20081205 

  QTY
----------
1000000


->data are formatted in general format.

---------------------------------------------------
(data in database)

  Date            
-------       
  2

  QTY
--------
  1


====> (both are varchar2 datatype)

this problem is solved by using get_num_propety and then convert it to varchar datatype....

My question is, why is there a discrepancy in the data (in database and excel file) and I had used get_num_property instead of get_char_property? why can't the data in excel treated as varchar implicitly? Is there any other method to get the data correctly withouth having to covert from number and to char?

Sorry for the trouble again, especially Christmas is near... Embarassed
Previous Topic: Need help in connecting Oracle with PHP Code
Next Topic: unable to retrieve data from SQL server
Goto Forum:
  


Current Time: Tue Nov 26 20:46:55 CST 2024