def to_sql(frame, name, con, schema=None, if_exists='<STR_LIT>', index=True,<EOL>index_label=None, chunksize=None, dtype=None, method=None):
if if_exists not in ('<STR_LIT>', '<STR_LIT:replace>', '<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>".format(if_exists))<EOL><DEDENT>pandas_sql = pandasSQL_builder(con, schema=schema)<EOL>if isinstance(frame, Series):<EOL><INDENT>frame = frame.to_frame()<EOL><DEDENT>elif not isinstance(frame, DataFrame):<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index,<EOL>index_label=index_label, schema=schema,<EOL>chunksize=chunksize, dtype=dtype, method=method)<EOL>
Write records stored in a DataFrame to a SQL database.

Parameters
----------
frame : DataFrame, Series
name : string
    Name of SQL table.
con : SQLAlchemy connectable(engine/connection) or database string URI
    or sqlite3 DBAPI2 connection
    Using SQLAlchemy makes it possible to use any DB supported by that
    library.
    If a DBAPI2 object, only sqlite3 is supported.
schema : string, default None
    Name of SQL schema in database to write to (if database flavor
    supports this). If None, use default schema (default).
if_exists : {'fail', 'replace', 'append'}, default 'fail'
    - fail: If table exists, do nothing.
    - replace: If table exists, drop it, recreate it, and insert data.
    - append: If table exists, insert data. Create if does not exist.
index : boolean, default True
    Write DataFrame index as a column.
index_label : string or sequence, default None
    Column label for index column(s). If None is given (default) and
    `index` is True, then the index names are used.
    A sequence should be given if the DataFrame uses MultiIndex.
chunksize : int, default None
    If not None, then rows will be written in batches of this size at a
    time.  If None, all rows will be written at once.
dtype : single SQLtype or dict of column name to SQL type, default None
    Optional specifying the datatype for columns. The SQL type should
    be a SQLAlchemy type, or a string for sqlite3 fallback connection.
    If all columns are of the same type, one single value can be used.
method : {None, 'multi', callable}, default None
    Controls the SQL insertion clause used:

    - None : Uses standard SQL ``INSERT`` clause (one per row).
    - 'multi': Pass multiple values in a single ``INSERT`` clause.
    - callable with signature ``(pd_table, conn, keys, data_iter)``.

    Details and a sample callable implementation can be found in the
    section :ref:`insert method <io.sql.method>`.

    .. versionadded:: 0.24.0