mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 15:12:23 +01:00
100 lines
3.0 KiB
XML
100 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 855bfee2f3db70d7dbb4c60c7c4a4efa567f1c60 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="sqlite3stmt.getsql" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SQLite3Stmt::getSQL</refname>
|
|
<refpurpose>Obtém o SQL da instrução</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SQLite3Stmt">
|
|
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>SQLite3Stmt::getSQL</methodname>
|
|
<methodparam choice="opt"><type>bool</type><parameter>expand</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Recupera o SQL da instrução preparada. Se <parameter>expand</parameter> for
|
|
&false;, o SQL não modificado é recuperado. Se <parameter>expand</parameter>
|
|
for &true;, todos os parâmetros da consulta são substituídos por seus valores
|
|
vinculados, ou por um SQL <literal>NULL</literal>, se ainda não estiverem vinculados.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>expand</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Se deseja recuperar o SQL expandido. Passar &true; só é suportado a partir
|
|
do libsqlite 3.14.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna o SQL da instrução preparada, &return.falseforfailure;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Se <parameter>expand</parameter> for &true;, mas a versão do libsqlite for inferior
|
|
a 3.14, um erro de nível <constant>E_WARNING</constant> ou uma <classname>Exception</classname>
|
|
é emitido, de acordo com <methodname>SQLite3::enableExceptions</methodname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="sqlite3stmt.getsql.example.expanded">
|
|
<title>Inspeção do SQL expandido</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$db = new SQLite3(':memory:');
|
|
$stmt = $db->prepare("SELECT :a, ?, :c");
|
|
$stmt->bindValue(':a', 'foo');
|
|
$answer = 42;
|
|
$stmt->bindParam(2, $answer);
|
|
var_dump($stmt->getSQL(true));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
string(24) "SELECT 'foo', '42', NULL"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|