How to pass insert query to datatable

hi guys,

this my query:
INSERT INTO demo.ewb_details (eway_bill_no,nic_eway_bill_date,user_gstin,nic_valid_upto,transportation_mode,nic_actual_distance,supply_type,sub_supply_type,document_type,document_no,document_date,from_gstin,from_address1,to_address1,to_gstin,taxable_value,cgst_value,sgst_value,igst_value,cess_value,fu_9,fu_7,fu_4,transporter_id,transporter_name,transportation_document_no,transportation_document_date,vehicle_no,active,is_active,load_id,udid,ewb_details_batch_id,user_name,gstin_id,company_id,initiated_by,created_by,updated_by,created_date,updated_date,nic_document_status_created_by,nic_eway_bill_date,nic_valid_upto)values (β€˜801004310210’,β€˜2018-05-03 12:37:00’,β€˜18AACCS0144E1ZS’,β€˜2018-05-18 23:59:00’,β€˜Road’,β€˜1430’,'Outward ',β€˜Supply’,β€˜Tax Invoice’,'G0082 β€˜,β€˜2018-05-03’,β€˜18AACCS0144E1ZS’,β€˜GSTIN : 18AAC CS014 4E1ZS M/S GLAXO SMITHKLINE CONSUMER HEALTHCARE LTD. , ASSAM :: Dispatch From :: Industrial Area Mangaldai,ASSAM-784125’,β€˜GSTIN : 18AAC CS014 4E1ZS M/S GLAXO SMITHKLINE CONSUMER HEALTHCARE LTD. , ASSAM :: Dispatch From :: Industrial Area Mangaldai,ASSAM-784125’,β€˜21AACCS0144E1Z5’,β€˜3582381.6’,β€˜0’,β€˜0’,β€˜644828.69’,β€˜0’,β€˜0’,β€˜0’,β€˜4227210.29’,β€˜18AADCP1208P1Z8’,β€˜ACM LOGISTICS PVT.LTD’,β€˜2657’,’ 03/05/2018 ','PB13AW6948 ',β€˜Y’,β€˜Y’,β€˜100010’,β€˜18AACCS0144E1ZS:G0082 :Outward β€˜,β€˜100010’,’’,β€˜189’,β€˜37’,β€˜NIC’,β€˜Generated Offline’,β€˜Engine’,now()::timestamp,now()::timestamp,β€˜Generated Offline’,03/05/2018 12:37:00 PM,β€˜18/05/2018 11:59:00 PM’);

and i am passing

β€œINSERT INTO demo.ewb_details (eway_bill_no,nic_eway_bill_date,user_gstin,nic_valid_upto,transportation_mode,nic_actual_distance,supply_type,sub_supply_type,document_type,document_no,document_date,from_gstin,from_address1,to_address1,to_gstin,taxable_value,cgst_value,sgst_value,igst_value,cess_value,fu_9,fu_7,fu_4,transporter_id,transporter_name,transportation_document_no,transportation_document_date,vehicle_no,active,is_active,load_id,udid,ewb_details_batch_id,user_name,gstin_id,company_id,initiated_by,created_by,updated_by,created_date,updated_date,nic_document_status_created_by,nic_eway_bill_date,nic_valid_upto)values (”+β€œ'” ewbno"β€˜β€œ+”,β€œ+β€β€™β€œstr1β€β€˜β€œ+”,β€œ+β€β€™β€œusergstinβ€β€˜β€œ+”,β€œ+β€β€™β€œnicvaliduptoβ€β€˜β€œ+”,β€œ+β€β€™β€œModeβ€β€˜β€œ+”,β€œ+β€β€™β€œdistanceβ€β€˜β€œ+”,β€œ+β€β€™β€œtypβ€β€˜β€œ+”,β€œ+β€β€™β€œsubsupplytypeβ€β€˜β€œ+”,β€œ+β€β€™β€œdoctypeβ€β€˜β€œ+”,β€œ+β€β€™β€œdocnoβ€β€˜β€œ+”,β€œ+β€β€™β€œdocdatetrimβ€β€˜β€œ+”,β€œ+β€β€™β€œgstβ€β€˜β€œ+”,β€œ+β€β€™β€œFromAddressβ€β€˜β€œ+”,β€œ+β€β€™β€œtoaddrβ€β€˜β€œ+”,β€œ+β€β€™β€œtogstβ€β€˜β€œ+”,β€œ+β€β€™β€œTotTaxableAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œCGSTAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œSGSTAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œIGSTAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œCESSAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œfu9β€β€˜β€œ+”,β€œ+β€β€™β€œOtherAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œTotalInvAmtβ€β€˜β€œ+”,β€œ+β€β€™β€œtransidβ€β€˜β€œ+”,β€œ+β€β€™β€œtransidnameβ€β€˜β€œ+”,β€œ+β€β€™β€œtransdocnoβ€β€˜β€œ+”,β€œ+β€β€™β€œtransdocdateβ€β€˜β€œ+”,β€œ+β€β€™β€œvehnoβ€β€˜β€œ+”,β€œ+β€β€˜Yβ€™β€œ+”,β€œ+β€β€˜Yβ€™β€œ+”,β€œ+β€β€˜100010β€™β€œ+”,β€œ+β€β€™β€œudβ€β€˜β€œ+”,β€œ+β€β€™β€œ100010β€β€˜β€œ+”,β€œ+β€β€™β€œ+”,β€œ+β€β€˜β€œ189β€β€™β€œ+”,β€œ+β€β€˜β€œ37β€β€™β€œ+”,β€œ+β€β€˜β€œNICβ€β€™β€œ+”,β€œ+β€β€˜β€œGenerated Offlineβ€β€™β€œ+”,β€œ+β€β€˜β€œEngineβ€β€™β€œ+”,β€œ+β€œnow()::timestamp”+”,β€œ+β€œnow()::timestamp”+”,β€œ+β€β€˜β€œGenerated Offlineβ€β€™β€œ+”,β€œ+β€β€˜β€œnicewbnoβ€β€™β€œ+”,β€œ+β€β€˜β€œnicuptoβ€β€™β€œ+”);"

Getting end of expression missing

1 Like

Buddy @smita.mobifly

–you can use execute query activity to insert this to your db

pass the query in string format
like this

Use the connection wizard to enter your details and you can even test the connection whether it got connected to the db or not…

this activity can be obtained from package like uipath.database.activities in manage packages menu in design tab

Only thing you need is to have the server name, username and password for the same

Or if you have a datatable with you instead of a query you can use insert query to insert that datatable to the db and you have to mention the datatable name and db name as input
Cheers

1 Like

Is that working buddy

Cheers

thanku you so much , this is very easy technique but i have done another way.
this is my query and its works.

β€œINSERT INTO demo.ewb_details (eway_bill_no,nic_eway_bill_date,user_gstin,nic_valid_upto,transportation_mode,nic_actual_distance,supply_type,sub_supply_type,document_type,document_no,document_date,from_gstin,from_address1,to_address1,to_gstin,taxable_value,cgst_value,sgst_value,igst_value,cess_value,fu_9,fu_7,fu_4,transporter_id,transporter_name,transportation_document_no,transportation_document_date,vehicle_no,active,is_active,load_id,udid,ewb_details_batch_id,user_name,gstin_id,company_id,initiated_by,created_by,updated_by,created_date,updated_date,nic_document_status_created_by,nic_eway_bill_date,nic_valid_upto)values ('”+ ewbno + β€œβ€˜,’” +str1 + β€œβ€˜,’” +usergstin+β€œβ€˜,’” +nicvalidupto + β€œβ€˜,’” +Mode+β€œβ€˜,’” +distance+ β€œβ€˜,’” +typ+β€œβ€˜,’” +subsupplytype+ β€œβ€˜,’” +doctype+β€œβ€˜,’” +docno+β€œβ€˜,’” +docdatetrim+ β€œβ€˜,’” +gst+β€œβ€˜,’” +FromAddress+β€œβ€˜,’” +toaddr+β€œβ€˜,’” +togst+β€œβ€˜,’” +TotTaxableAmt+ β€œβ€˜,’” +CGSTAmt+β€œβ€˜,’” +SGSTAmt+ β€œβ€˜,’” +IGSTAmt+β€œβ€˜,’” +CESSAmt+ β€œβ€˜,’” +fu9+β€œβ€˜,’” +OtherAmt+ β€œβ€˜,’” +TotalInvAmt+β€œβ€˜,’” +transid+ β€œβ€˜,’” +transidname+β€œβ€˜,’” +transdocno+ β€œβ€˜,’” +transdocdate+β€œβ€˜,’” +vehnoe+β€œβ€˜,β€˜Y’,β€˜Y’,β€˜100010’,β€™β€œud+β€β€˜,β€˜100010’,’',β€˜189’,β€˜37’,β€˜NIC’,β€˜Generated Offline’, '” +distance+β€œβ€˜,β€˜Engine’,now()::timestamp, now()::timestamp, now()::timestamp, β€˜Generated Offline’,’” +nicewbno+ β€œβ€˜,’” +nicupto+β€œ');”

1 Like

Great…

Cheers buddy

thanku so much…

1 Like

Kindly close this topic buddy with comment marked solution

Cheers @smita.mobifly

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.