Jokez Posted June 12, 2008 Posted June 12, 2008 Hi! I am using jdbc to get data out from Filemaker in a "batch" kind of way, many SELECTS in a row. It workes fine until about 200 of my 1000 things to is done. Then I get: SequeLink An Internal Error has occured. What is this and how can I fix it? Its the same questions to the database over and over so If it can do 200 it must surely manage 1000? Can anyone help me plz!!
elo Posted July 13, 2008 Posted July 13, 2008 That's poor driver code... anyhow... Use the ODBC Catalog/JDBC Meta Data functions to get the list of tables/columns. See pages 43-44 of the ODBC Driver documentation PDF that comes with FileMaker Pro. If you checked the values you were about to use against the results of gettables you could error out in your program instead of crashing the server.
elo Posted July 13, 2008 Posted July 13, 2008 I've updated my ADO/ODBC wrapper to provide some functionality for testing the Catalog by using ADOX (another MSFT COM/Win32OLE Database wrapper). So, assuming you put the attachment ADOWrap.txt as ADOWrap.rb in your directory you can get at the FileMaker ODBC Catalog as such: require 'ADOWrap.rb' $strConn = 'DSN=Filemaker;UID=ODBCUser;Pwd=ODBCUser;' connection = ADOWrap.new($strConn) # sample of using ADOX / to query the ODBC Catalog anarray = connection.tablenames anarray.each do |table| ahash = connection.columnnames(table) next unless (table == 'tDockets') p table ahash.keys.each do |k| p k, ahash[k] end print "-----n" end Note, that EACH table occurrence will show up in the list of tables... also FileMaker must be open for this query to work. You'll get output along these lines: "tDockets" "StatusText" {:type=>:adLongVarChar, :datatypeenum=>201} "zCreatedTime" {:type=>:adDBTimeStamp, :datatypeenum=>135} "UnreviewedDisc" {:type=>:adDouble, :datatypeenum=>5} "date_IssueAward" {:type=>:adDBDate, :datatypeenum=>133} "----- Main Fields" {:type=>:adDouble, :datatypeenum=>5} "date_Filed_Number" {:type=>:adLongVarChar, :datatypeenum=>201} "date_Filed" {:type=>:adDBDate, :datatypeenum=>133} Couple of observations, the field names are not nicely sorted and again this is just to give an example of how you could work with the data structures you can get out of FileMaker. The relevant ADOX API usage to get at the SQLTables/SQLColumns catalog data is in ADOWrap and looks like this: # Returns a list of table names in the current connection def tablenames() cat = WIN32OLE.new('ADOX.Catalog') cat.ActiveConnection = @adocn tcount = cat.Tables.Count returnarray = Array.new() for i in 0..(tcount-1) do table = cat.Tables(i) returnarray << table.Name end cat = nil return returnarray end # Returns a hash of column names and column types for the passed table def columnnames(tablename) cat = WIN32OLE.new('ADOX.Catalog') cat.ActiveConnection = @adocn begin table = cat.Tables(tablename) rescue cat = nil return nil end ccount = table.Columns.Count returnhash = Hash.new() for i in 0..(ccount-1) do returnhash[table.Columns(i).Name] = Hash.new() returnhash[table.Columns(i).Name][:datatypeenum] = table.Columns(i).Type returnhash[table.Columns(i).Name][:type] = $DataTypeEnum[table.Columns(i).Type] end return returnhash end ADOWrap.txt
Recommended Posts
This topic is 5979 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now