maholt Posted April 30, 2002 Share Posted April 30, 2002 I have a small FileMake Database that I want to send to an ODBC datasource. On the FileMaker side I have an id (number) and name (text with maximum length of 255) in a database called 'ttt'. On the other side I have id (int) name (varchar(255)) in a database called' test'. How can push the data I have up to the server? I am trying to use "Execute SQL" to do it. The problem is I do not know how to pull the data of the current record into the query. I want to do something like: Execute SQL [No dialog, "DSN:MyTest","INSERT INTO test (id,name) VALUES(ttt.id,ttt.name"] However, the STRING ttt.id (and name) get sent not the values from the current record. Thanks Quote Link to comment Share on other sites More sharing options...
Doug Posted May 2, 2002 Share Posted May 2, 2002 One way to do this is create a calculation field in your database which compiles the SQL statement and Values for each record ---- c_SQL_statement = "Insert into TEST ( id, name) VALUES ( " & (id field name) & "," & (name field name) & " )" [ You may want (need) to put single quotes around your field data -- i.e & "'" & (id field name) & "'" & ] Then create a script to loop through the records you wish to upload ---- Go to Record/Request/Page [first] Loop Execute SQL [No dialog, "DSN:MyTest", "c_SQL_statement"] Go to Record/Request/Page [Exit after last, Next] End Loop Of course you will probably want to put in some error checking and what-not in your script to prevent endless loops , etc... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.