writer:mySQL ,delete records, add records

More
2 years 6 months ago #23278 by admin
Yes, it is correct

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #23280 by prashant
 
Hi Mike,
I am little stuck now , help would be appreciated .

1 .I have defined the update id 
 
2. I am able to 'add' new records to mySQL table


What I wish to achieve is to 
1. Truncate table 
2. Update Recods

What I've tried
1. if I do user SQL and update statement to below , I can run these manually , they run fine in SQL editor window but I get error in Writer window
Code:
TRUNCATE TABLE `vg_items`; GO insert into `vg_items` (`id`,`OurRef`,`Item` ) values (:F1,:F2,:F3  );  GO


Code:
TRUNCATE TABLE `vg_items`; GO insert into `vg_items` (`id`,`OurRef`,`Item` ) values (:F1,:F2,:F3  ); GO



    



Does this mean 
1. I need to run sql script first and then do addition action? 
2. My query syntax is wrong (I am pretty sure this is it)
Last edit: 2 years 6 months ago by prashant.

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #23282 by prashant
DAMN , I just saw
www.etl-tools.com/wiki/advanced-etl-proc...-targets/sql-script/


SQL script can be run before the writer works it's magic 

LEARNING LESSON
READ AND RE-READ links shared by Mike
 
Last edit: 2 years 6 months ago by prashant.
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #23283 by admin
You do not have to write insert statements you self the software does it for you.

Yes you can use custom insert statements but most of the time you do need need it.

It is rather exceptional case

Mike
ETL Architect
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save