% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/advanced.R
\name{mdb_sql}
\alias{mdb_sql}
\title{SQL Interface To MDB Tools}
\usage{
mdb_sql(
  path,
  statement = NULL,
  no_header = FALSE,
  no_footer = FALSE,
  no_pretty_print = FALSE,
  delimiter = "\\t",
  input = NULL,
  output = NULL,
  as_text = FALSE
)
}
\arguments{
\item{path}{Path to \code{.mdb}/\code{.accdb} file.}

\item{statement}{SQL statement text.}

\item{no_header}{Logical, equivalent to \code{-H/--no-header} (for text mode).}

\item{no_footer}{Logical, equivalent to \code{-F/--no-footer} (for text mode).}

\item{no_pretty_print}{Logical, equivalent to \code{-p/--no-pretty-print}.}

\item{delimiter}{Delimiter equivalent to \code{-d/--delimiter} in plain text mode.}

\item{input}{Input file equivalent to \code{-i/--input}.}

\item{output}{Output file equivalent to \code{-o/--output}.}

\item{as_text}{Logical; when \code{TRUE}, returns CLI-like text output.}
}
\value{
\code{data.frame} by default, or character scalar in text mode.
}
\description{
\code{mdb-sql} is a utility program distributed with MDB Tools.
It allows querying of an MDB database using a limited SQL subset language.
The supported SQL is intentionally small: single-table queries, no aggregates,
and limited \code{WHERE} support.
}
\details{
In addition to single statements, this wrapper accepts \code{input} files similar
to \verb{mdb-sql -i file}, strips \code{go} batch terminators, and executes the script
one statement at a time.
}
\examples{
db <- mdbr:::.mdb_example_nwind_path()
if (nzchar(db)) {
  mdb_sql(db, "SELECT [ProductID], [ProductName] FROM [Products] LIMIT 3;")
}
}
