Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. % Set preferences with setdbprefs
  2. ===================================================================================================
  3. s.DataReturnFormat = 'cellarray';
  4. s.ErrorHandling = 'store';
  5. s.NullNumberRead = 'NaN';
  6. s.NullNumberWrite = 'NaN';
  7. s.NullStringRead = 'null';
  8. s.NullStringWrite = 'null';
  9. s.JDBCDataSourceFile = 'C:\Users\lakshmiyeswanth\Desktop\grey algos\database_mfiles_20070321\dbcon.mat';
  10. s.UseRegistryForSources = 'yes';
  11. s.TempDirForRegistryOutput = '';
  12. setdbprefs(s)
  13.  
  14. % Make connection to database. Note that the password has been omitted.
  15. % Using JDBC driver.
  16. conn = database('test','scott','password','oracle.jdbc.driver.OracleDriver','jdbc:oracle:thin:');
  17.  
  18.  
  19. error
  20.  
  21. % Read data from database.
  22. e = exec(conn,'SELECT ALL JOB FROM SCOTT.EMP');
  23. e = fetch(e);
  24. close(e)
  25.  
  26. % Close database connection.
  27. close(conn)
  28.  
  29. ===================================================================================================
  30.  
  31. error:
  32.  
  33. ??? Undefined function or method 'fetch' for input arguments of type 'struct'.
  34.  
  35. Error in ==> dbconn at 21
  36. e = fetch(e);
  37. ===================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement