-1

I run a powerbuilder app on a asa8 database.

I want to export data from tables to a sql txt file and import into another database db file. I thought of creating a sql insert script but after much research and trial and error not getting anywhere. Then tried creating dynamic datawindows per table and exporting the data that way to a csv file and importing it that way - but feel that will take too much coding time to achieve that. I tried using cybase central to do backup and restore but not getting that right. Issue is that I want clients to generate the export file data and mail them to me for problem analysis. I don't really want them to use cybase central for security and complexity reasons, rather just press a button on my app and export data.

Ok, what I'm asking is what's the best way to go about this? Create sql select from table into file, then insert into tables (can I have some samles pls) or create dynamic dw - export to file - import into dw and update ()

Thanks Alex

1 Answers1

0

Many questions Perhaps NO code necessary. Do you have access to their database using PB?

If so, go to the database painter and open the list of tables in the connection. Select a table and right-mouse on it, then select "edit data".

After the retrieve, click anywhere in the results view (that activates menu options you will need) then Use the "File/SaveRows As" option to get a list of all the ways you can export the data. I prefer tab separated text so I can go back and forth from text file to excel if I need to make adjustments - excel keeps the tab separator save and sometimes you will need to chop off the first column if it is an identity column. The Save-As also offer SQL inserts as an option. Another Right-mouse selection from the table is "export syntax" which will export the table create DDL into the log activity view if it has been selected.

on import - same thing. DB Painter / select table and "edit data". It may be empty, but still click in the results view to activate the menu options for import. Then just select the file you saved and import the text into the tables.

Go into the DB painter in your 2nd DB - create the table if not already there using the log syntax; then select the table and the "edit data" option. Presumably, no data will be there, but just touch the results view and go to the ROWS menu and select import to import from the text file into the new DB.

There are more refined ways, but if you only have a few tables it's a quick NO code solution.

G2-
  • 1