6 Replies Latest reply on Mar 28, 2013 7:10 PM by 998158

    FDM clarification

    998158
      Hi,

      Is it possible to load/copy records from FDM schema table to a text file and vice versa using FDM script

      Thanks in advance
        • 1. Re: FDM clarification
          LarryR
          There are multiple ways that data can be extracted from FDM. The simplest method is to use the Pull Adapter: http://docs.oracle.com/cd/E12825_01/epm.111/fdm_adapter_readmes/pull_g4_e_adapter_readme.html

          As far as the reverse direction, can you explain in a little more depth as to what you're trying to accomplish?
          • 2. Re: FDM clarification
            998158
            Hi,

            Thanks for your reply.

            Is it possible to pull data from table and load into text file by writing FDM custom script rather than using Pull adapter.
            Regarding, the second point, I just want to know if there is any possibility where in we can create a table in any shcema and pass records from a text file to the table through custom script in FDM.
            • 3. Re: FDM clarification
              LarryR
              The answer to both questions is yes. You can use ADO to execute SQL commands that extract from/write to a database table. There is a script example in the section on Integration Scripts in the FDM Admin Guide that will provide some guidelines. There is also a good deal of info and examples online of using vbScript, ADO, and SQL to manipulate database tables and write to files.
              • 4. Re: FDM clarification
                998158
                Hi Larry

                Thanks for quick response..I tried the logic to copy records from table to text.
                I am able to fetch records from table uisng sql and create record set.
                But, I am having issues in opening the record set for reading and writing records to text file.
                Is there any command to just open record set for reading because I see one for appending and not for just reading

                Thanks
                • 5. Re: FDM clarification
                  LarryR
                  Here's some code that writes a recordset's entire contents to file. A semi-colon is used as the delimeter. Plenty of info on GetString online:
                  Set rs = DW.DataAccess.farsFireHose(strSQL, False)
                  With rs
                       If Not .EOF Then
                            Set fsoFile = fso.OpenTextFile(strFile, 2, True)' Open the file for writing, overwriting if it exists
                            Do While Not .EOF
                                 fsoFile.Write .GetString(2,20,";",vbCrLf)' Write the records to file
                            Loop
                            fsoFile.Close
                       End If
                       .Close
                  End With
                  • 6. Re: FDM clarification
                    998158
                    Hi Larry,

                    This is really helpful.Thanks a lot.