-1

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 ?

bndgte
  • 1
  • 1

3 Answers3

0

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

MacGuido
  • 46
  • 1
0

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 
Yohanmaker
  • 11
  • 1
0

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

Umberto Migliore
  • 317
  • 4
  • 17