1 2 Previous Next 15 Replies Latest reply on Oct 16, 2018 10:49 AM by rareddy

    reading csv in writing db

    glprobot
      • source -> I connected my physical database
      • schemas?
      • functions?
      • views?
      • web_services?

      on other folders I do not know what they are and what needs to be done.My problem since there is a new topic for me is there is little documentation for the web.my project must be as follows:

      1. I have to read a csv file from any folder
      2. I have to write this csv file from the physical database
      3. create the virtual database

      little documentation on the web I can not find examples of this kind

        • 1. Re: reading csv in writing db
          rareddy

          This is a somewhat old example [1] update all the versions to latest but does show how to read from the CSV and convert into Table. Once you have into table, you just need to select from and insert into physical table.

           

          [1] Text to Table with Teiid

          • 2. Re: reading csv in writing db
            glprobot

            is there a guide or video tutorial that explains in detail how to do it?

            since I can not use teiid design

             

             

            In practice I have to realize the back end that in any folder I have to upload the csv file and write in the mysql database

             

             

            How you do it?

             

             

             

             

            Thank you

            • 3. Re: reading csv in writing db
              rareddy

              Have you read the link I gave? it is step by step guide to do what you are asking. There are no videos, unfortunately. When you go through the exercise, ask specific questions if you do not follow, we will try to answer them.

               

              Ramesh..

              • 4. Re: reading csv in writing db
                glprobot

                the guide you gave me, start talking about the TEXTTABLE function.

                When I created my database connection on the source folder.

                How do I create the TEXTTABLE function to import the csv file? of the back end part

                • 5. Re: reading csv in writing db
                  rareddy

                  Maybe it is beneficial for you to learn the basics of how Teiid works.  You can read the document here About Teiid · Teiid  Also you can look at another quick start guide here Connect to a Flat File using Teiid  using Designer.

                  • 6. Re: reading csv in writing db
                    glprobot

                    I followed this guide:

                    Connect to a flat file using Teiid.

                    But what I want to do, preparing the back-end, any csv file taken in any folder, that the file is not going to take in the same fixed folder, because the folders are anywhere in windows, I read the csv file and later of which I save it in another folder.

                    The guide that you gave me the following step by step, but I would like to achieve this purpose, but I need more guides with graphics that I can do this way.

                     

                    besides this I have to prepare the rest and post services, that I have to build the front end part to recall the back end part

                    • 7. Re: reading csv in writing db
                      rareddy

                      I think what you need is to use Apache Camel, not Teiid. That will give you ways to save your file to a different directory and let you feed data from csv into database.

                       

                      Ramesh..

                      • 8. Re: reading csv in writing db
                        glprobot

                        I have to use Teiid

                        unfortunately I have the obligation to use the winfly server.

                        Since this teiid technology I do not know at all, I need your help.

                        Kindly can you make me this exercise? so that I can study

                        if you can kindly send me an attachment of this exercise so that I can import

                        • 9. Re: reading csv in writing db
                          rareddy

                          I am sorry, I gave you all the information we have on your use case and how it works. You would need to spend time learning the technology, there is not much I can help with that. If you have specific questions along the way we will try to answer.

                           

                          Ramesh..

                          • 10. Re: reading csv in writing db
                            glprobot

                            In my project I realized this way:

                            1) I only connected to my physical PostgreSql database that imported all the tables, and created the database.xmi file

                            2) I created the view and sourcemodel of the guide that you gave me the import of the csv file

                            3) question?

                            how can I tell this csv file that I imported to write in my database?

                            • 11. Re: reading csv in writing db
                              rareddy

                              It won't. Once you deploy the VDB, you can issue a SQL command like below using either JDBC or ODBC

                               

                              insert into pg.table select col1,col2.. from csv_view

                               

                              that will read from csv and insert into pg table. Note that Teiid will never delete the CSV file or move it to another directory.

                              • 12. Re: reading csv in writing db
                                glprobot

                                you have a graphical guide that does this, so I do not know where to put my hands.

                                 

                                In practice I have 4 files that I have created:

                                1) database.xmi -> physical connection to the postgresql database

                                2) sourcemodel.xmi and sourceView.xmi -> import of the csv file

                                3) source.vdb -> that I have created at the moment the virtual database

                                4) to write in the database give me a graphic guide as before, kindly.

                                 

                                I thank you and sorry for disturbing you a lot

                                • 13. Re: reading csv in writing db
                                  glprobot

                                  As I could understand once I created the vdb file which became a virtual database, which in the creation I inserted 4 files

                                  1) database.xmi -> physical connection to the postgresql database

                                  2) sourcemodel.xmi and sourceView.xmi -> import of the csv file

                                  3) source.vdb -> that I have created at the moment the virtual database

                                   

                                   

                                  creating my vdb

                                   

                                   

                                  I would like to know using jdbc in java or rest in java how do I access my virtual database vdb?

                                  you have a good guide, which explains to me step by step

                                  • 14. Re: reading csv in writing db
                                    glprobot

                                    How can I make the relationship between the imported csv file and the tables by constructing a sql stored procedure?

                                    1 2 Previous Next