# Is the ODBC.load function implemented?

**URL:** https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330
**Category:** Data
**Created:** [August 8, 2019, 8:15pm UTC](https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330 "2019-08-08T20:15:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)
#### Post date: [August 8, 2019, 8:15pm UTC](https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330/1 "2019-08-08T20:15:27Z")

</div>

I am trying to load data from a very small dataframe into an MS SQL server database. This is documented in the ODBC.jl documentation, albeit as experimental. However it does not find the load function at all when I try to use it.

In any case, the present documentation definitely is not correct.

Note that I am using Julia 1.2-rc2 on Windows.

---

<div class="post-metadata">

### Author: ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)
#### Post date: [August 8, 2019, 9:26pm UTC](https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330/2 "2019-08-08T21:26:15Z")

</div>

Partially answering my own question – it appears as if the ODBC.load! function is exported but not the ODBC.load ones. This does not work for me as I really need the append=true functionality.

Looks like I’ll have to use INSERT instead. Just considerably more work to set up.

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [August 12, 2019, 4:00am UTC](https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330/3 "2019-08-12T04:00:43Z")

</div>

Sorry for the slow response here; yes, I think the docs need updating, the current function is called `ODBC.load!`, but as you noticed, it doesn’t really support appending (this is an odbc limitation, not a julia package limitation). So yes, doing your own INSERT statements is best for now. Note that ODBC does provide for statement “preparation” with parameterized values, which can then be executed multiple times; this is more efficient that just running `ODBC.query(conn, sql)` or `ODBC.execute!(conn, sql)` over and over. For preparing you call `ODBC.prepare(dsn::DSN, query::AbstractString)`, which returns a prepared `Statement` object, then you can call `ODBC.execute!(statement::Statement, values)` repeatedly, passing in values each time. So for an INSERT, doing:

```julia
stmt = ODBC.prepare(conn, "INSERT INTO tablename (col1, col2) VALUES(?, ?)")
for row in Tables.rows(table)
    ODBC.execute!(stmt, (row.a, row.b))
end

```

---

<div class="post-metadata">

### Author: ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)
#### Post date: [August 12, 2019, 4:12am UTC](https://discourse.julialang.org/t/is-the-odbc-load-function-implemented/27330/4 "2019-08-12T04:12:39Z")

</div>

Thank you, I came to the same conclusion as what you suggest here.
