Export data from 4D database / convert 4D-database to free SGBD

287 views Asked by At

Is there a way to convert a 4D database to a free SGBD like MySQL ? If no, is there a way to export tables from a 4D database to a csv file ?

3

There are 3 answers

0
MacGuido On

Convert, no. You can export data using either the export or quick report editor.

0
Yohanmaker On

if you are using a +v15 version you could export every table to json using something like this:

   $jsontext:=JSON Stringify(ds.YourTable.all())


   C_TIME(vhDoc)


   vhDoc:=Create document("";"json")  // Create new document called Note
   If (OK=1)

    SEND PACKET(vhDoc;$jsontext)  // Write one word in the document
    CLOSE DOCUMENT(vhDoc)  // Close the document
    SHOW ON DISK(Document)
   End if 
0
Umberto Migliore On

The answer for the first question: how to export all data from a 4D database to MySQL (or similar SQL DBMS)

SQL EXPORT DATABASE("";0) // the second parameter = 0 to let export ALL tables

This create a structure of folders with names as table names and containing a file named "SQLExport.sql" with SQL dumps. SQL EXPORT DATABASE command page in 4d doc