Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

unable to get output .sql file from db source

Hi ,

Am trying to get the .sql file as output for insert scripts from tmysqlinput as source, but i did not get any solution for this scenario.

how  can i achieve for this method

 

Labels (2)
6 Replies
Jesperrekuh
Specialist
Specialist

Do you want?
"select * from mytable"
response should be:
"INSERT INTO mytable x (a,b,c,d) values (1,2,3,4)
Anonymous
Not applicable
Author

Yes, i want insert scripts.also i have used tsystem component using by this command
"mysqldump -u talenduser -p db name table name > output.sql"
but am not getting the result ,getting error as
mysqldump: Couldn't find table: ">"
can u pls suggest me to resolve this error

Jesperrekuh
Specialist
Specialist

mysqldump is a client utility, to be able to run this command you need to have it on your workstation / server.
you need to use the tSystem component and let it run the mysqldump command
the > output.sql is a piping to a file, suggest specifying destination too.
Next you use the tDBOutputBulk / tMySQLOutputBulk and use the generated file.

Anonymous
Not applicable
Author

i tried this way but am getting empty page help me.
is any other way to generate the .sql file?


Jesperrekuh
Specialist
Specialist

No/Yes
No, not with a different component.
Yes, if you want to do some java-coding and use the tJavaRow component and generate the insert statements entirely by yourself.
Second yes, if its a one time load ... you could ask your DB-Admin to do a backup (which wil generate .sql files).

Third, mysqldump utility should work fine... so you're doing something wrong, Im missing a host specification. Also add the -v for verbose more information.
mysqldump -v -h <database_hostname> -u<database_username> -p'<database_password>' <database_name> > test.sql

https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html
Anonymous
Not applicable
Author

i have used the both ways using java row i gave like this 


context.insert = "INSERT INTO CHECK_IN(CoworkerId,CoworkerFullName ) VALUES (" + row7.CoworkerId+ "," +row7.CoworkerFullName+ ")"; (in tjavarow)

 

tdbinput--->tjavarow

|

|  subjob

tfixedflowinput--tmap--tfileoutputdelimited

 

tfixedflowinput - given context.insert  as fixed in column1 and map to tfileoutputdelimited

 

here i get only one insert statement  but it's not iterate the all records