0
insert into mst_order_report(Capacity, Clearing_Alpha, Client_ID, Client_Order_ID,
Cumulative_Executed_Size, Date_Of_Expiry, Entry_Time, Exec_Type, Executed_Qty,
Executed_Value, Execution_ID, Hidden_Size, Inactive_Time, Order_ID, Order_Qty, Order_Status, Order_Type, Owner_ID, PAN_ID, Parent_Order_ID, Reason, Remarks, Side, Stop_Price, TIF, Total_Qty, Trade_Report_ID, Trader_ID, Transact_Time, Value, Visible_Size, Trading_Member_ID, Symbol)
select * from order_report(Capacity, Clearing_Alpha, Client_ID, Client_Order_ID, Cumulative_Executed_Size, cast(Date_Of_Expiry as date), cast(Entry_Time as datetime), Exec_Type, Executed_Qty, Executed_Value, Execution_ID, Hidden_Size, cast(Inactive_Time as datetime), Order_ID, Order_Qty, Order_Status, Order_Type, Owner_ID,
PAN_ID, Parent_Order_ID, Reason, Remarks, Side, Stop_Price, TIF, Total_Qty, Trade_Report_ID, Trader_ID, cast(Transact_Time as datetime), Value, Visible_Size, Trading_Member_ID, Symbol)

Here Order_report contain the data
and am inserting into mst_order_report
And my problem is in mst_order_report in which following column is of follwoing type
1)Date_of_Expiry as date
2)Entry_Time as datetime
3)Inactive_Time as datetime
4)Transaction_time as datetime
where the above 4 columns in order_report is varchar
I have casted in the above query
But it still giving casting error

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by crishlay
0

that statement goes like this

INSERT INTO mst_order_report(Capacity, Clearing_Alpha, Client_ID, Client_Order_ID,Cumulative_Executed_Size, Date_Of_Expiry, Entry_Time, Exec_Type, Executed_Qty,Executed_Value, Execution_ID, Hidden_Size, Inactive_Time, Order_ID, Order_Qty, Order_Status, Order_Type, Owner_ID, PAN_ID, Parent_Order_ID, Reason, Remarks, Side, Stop_Price, TIF, Total_Qty, Trade_Report_ID, Trader_ID, Transact_Time, Value, Visible_Size, Trading_Member_ID, Symbol)
SELECT Capacity, Clearing_Alpha, Client_ID, Client_Order_ID, Cumulative_Executed_Size, cast(Date_Of_Expiry AS date), cast(Entry_Time AS datetime), Exec_Type, Executed_Qty, Executed_Value, Execution_ID, Hidden_Size, cast(Inactive_Time AS datetime), Order_ID, Order_Qty, Order_Status, Order_Type, Owner_ID, PAN_ID, Parent_Order_ID, Reason, Remarks, Side, Stop_Price, TIF, Total_Qty, Trade_Report_ID, Trader_ID, cast(Transact_Time AS datetime), Value, Visible_Size, Trading_Member_ID, Symbol FROM order_report

just make sure everything match

Edited by jbisono: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.