<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Parece que RODBC está "deprecated", tente usar o pacote
      RSQLServer.</p>
    <p><br>
    </p>
    <p>Atenciosamente<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 07/31/2017 01:53 PM, Cesar Rabak via
      R-br wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKrF98kS08K2r1H8CAvmDduhP9OmxN2+5mQceZta5vyGBqB-Ww@mail.gmail.com">
      <div dir="ltr">Correto Pedro!
        <div><br>
        </div>
        <div>Contudo, não entendo porque. . .</div>
        <div><br>
        </div>
        <div>Minha forma de atacar esse problema seria mandar os dados
          para o BD por outra maneira (que ñ via R) e tentar conectar
          apenas para puxar os dados: aí a gente vê se é na criação do
          BD via R que ele deixa em aberto um tamanho default muito
          grande ou se é a chamada que por alguma coincidência cria um
          default exigindo tanta memória (embora nos OSs modernos isso
          não deveria gerar problema porque existem os gerenciadores de
          memória virtual).</div>
        <div><br>
        </div>
        <div>HTH</div>
        <div>--</div>
        <div>Cesar Rabak</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2017-07-31 10:32 GMT-03:00 Pedro
          Emmanuel Alvarenga Americano do Brasil <span dir="ltr"><<a
              href="mailto:emmanuel.brasil@gmail.com" target="_blank"
              moz-do-not-send="true">emmanuel.brasil@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_default" style="font-family:arial
                black,sans-serif;font-size:small;color:#073763">Cesar,</div>
              <div class="gmail_default" style="font-family:arial
                black,sans-serif;font-size:small;color:#073763"><br>
              </div>
              <div class="gmail_default" style="font-family:arial
                black,sans-serif;font-size:small;color:#073763">A função
                RODBC::sqlQuery não tem exemplo, mas já usei diversas
                vezes com outros scripts e funciona. Esse problema está
                acontecendo somente no exemplo dessa conexão em
                específico. Então estou entendendo a partir de agora que
                 alguma configuração da conexão está pedindo pra
                reservar memória mais do que o a máquina possui. </div>
            </div>
            <div class="gmail_extra"><span class="HOEnZb"><font
                  color="#888888"><br clear="all">
                  <div>
                    <div class="m_1601941344025199055gmail_signature"
                      data-smartmail="gmail_signature">
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div dir="ltr"><font
                                style="background-color:rgb(255,255,255)"
                                face="'courier new', monospace"
                                color="#000066">Pedro Brasil</font></div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </font></span>
              <div>
                <div class="h5">
                  <br>
                  <div class="gmail_quote">Em 29 de julho de 2017 20:45,
                    Cesar Rabak <span dir="ltr"><<a
                        href="mailto:cesar.rabak@gmail.com"
                        target="_blank" moz-do-not-send="true">cesar.rabak@gmail.com</a>></span>
                    escreveu:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">Pedro,
                        <div><br>
                        </div>
                        <div>Calloc é uma chamada "primitiva" para o R,
                          uma função da biblioteca C e é uma função
                          feita para "alocar" (reservar) memória e
                          zerá-la.</div>
                        <div><br>
                        </div>
                        <div>O estranho, para mim, é a tentativa do
                          aplicativo de reservar <b>tanta</b> memória
                          assim na chamada da função do R.</div>
                        <div><br>
                        </div>
                        <div>Essa função sqlQuery() pode ser testada
                          fazendo:</div>
                        <div><br>
                        </div>
                        <div>> example(sqlQuery)</div>
                        <div><br>
                        </div>
                        <div>?</div>
                        <div><br>
                        </div>
                        <div>Se o exemplo do próprio pacote funcionar,
                          aí teremos que fazer uma busca para ver de
                          onde vem esse comportamento.</div>
                        <div><br>
                        </div>
                        <div>HTH</div>
                        <div>--</div>
                        <div>Cesar Rabak</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                      </div>
                      <div class="m_1601941344025199055HOEnZb">
                        <div class="m_1601941344025199055h5">
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">2017-07-28 17:12
                              GMT-03:00 Pedro Emmanuel Alvarenga
                              Americano do Brasil <span dir="ltr"><<a
href="mailto:emmanuel.brasil@gmail.com" target="_blank"
                                  moz-do-not-send="true">emmanuel.brasil@gmail.com</a>></span>:<br>
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">
                                <div dir="ltr">
                                  <div class="gmail_default"
                                    style="font-family:arial
                                    black,sans-serif;font-size:small;color:#073763">Ei
                                    Cesar,</div>
                                  <div class="gmail_default"
                                    style="font-family:arial
                                    black,sans-serif;font-size:small;color:#073763"><br>
                                  </div>
                                  <div class="gmail_default"
                                    style="font-family:arial
                                    black,sans-serif;font-size:small;color:#073763">Eu
                                    tenho pouco familiaridade com SQL, e
                                    o amigo da TI que tem e faz
                                    manutenção do servidor diz que o
                                    erro é na minha estação com R. Eu
                                    acho que não, mas não tenho certeza
                                    porque eu não sei ao certo o que
                                    quer dizer esse erro. O que seria
                                    essa "Calloc"? É uma coisa natural
                                    do R?</div>
                                  <div class="gmail_default"
                                    style="font-family:arial
                                    black,sans-serif;font-size:small;color:#073763"><br>
                                  </div>
                                  <div class="gmail_default"
                                    style="font-family:arial
                                    black,sans-serif;font-size:small;color:#073763">Abraço,</div>
                                </div>
                                <div class="gmail_extra"><br clear="all">
                                  <div>
                                    <div
class="m_1601941344025199055m_-5566544572137748566m_-2957336891499193865gmail_signature"
                                      data-smartmail="gmail_signature">
                                      <div dir="ltr">
                                        <div>
                                          <div dir="ltr">
                                            <div dir="ltr"><font
                                                style="background-color:rgb(255,255,255)"
                                                face="'courier new',
                                                monospace"
                                                color="#000066">Pedro
                                                Brasil</font></div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div>
                                    <div
                                      class="m_1601941344025199055m_-5566544572137748566h5">
                                      <br>
                                      <div class="gmail_quote">Em 28 de
                                        julho de 2017 16:59, Cesar Rabak
                                        <span dir="ltr"><<a
                                            href="mailto:cesar.rabak@gmail.com"
                                            target="_blank"
                                            moz-do-not-send="true">cesar.rabak@gmail.com</a>></span>
                                        escreveu:<br>
                                        <blockquote class="gmail_quote"
                                          style="margin:0 0 0
                                          .8ex;border-left:1px #ccc
                                          solid;padding-left:1ex">
                                          <div dir="ltr">Pedro,
                                            <div><br>
                                            </div>
                                            <div>Mesmo sem poder fazer
                                              uma tentativa, me parece
                                              que o erro é estranho
                                              demais para não ser
                                              notado: a chamada à
                                              primitiva da ling. C
                                              "calloc" está pedindo 200
                                              Gbytes, que falha e me
                                              parece algo grande demais
                                              para um "default" da
                                              chamada a sqlQuery().</div>
                                            <div><br>
                                            </div>
                                            <div>HTH</div>
                                            <div><br>
                                            </div>
                                          </div>
                                          <div class="gmail_extra"><br>
                                            <div class="gmail_quote">
                                              <div>
                                                <div
class="m_1601941344025199055m_-5566544572137748566m_-2957336891499193865h5">2017-07-28
                                                  9:42 GMT-03:00 Pedro
                                                  Emmanuel Alvarenga
                                                  Americano do Brasil
                                                  via R-br <span
                                                    dir="ltr"><<a
                                                      href="mailto:r-br@listas.c3sl.ufpr.br"
                                                      target="_blank"
                                                      moz-do-not-send="true">r-br@listas.c3sl.ufpr.br</a>></span>:<br>
                                                </div>
                                              </div>
                                              <blockquote
                                                class="gmail_quote"
                                                style="margin:0 0 0
                                                .8ex;border-left:1px
                                                #ccc
                                                solid;padding-left:1ex">
                                                <div>
                                                  <div
class="m_1601941344025199055m_-5566544572137748566m_-2957336891499193865h5">
                                                    <div dir="ltr">
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)">Amigos
                                                        de R,</div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)"><br>
                                                      </div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)">Estou
                                                        envolvido numa
                                                        tarefa que
                                                        importo um banco
                                                        SQL de um
                                                        servidor, faço
                                                        uma modelagem,
                                                        salvo o modelo
                                                        no SQL através
                                                        de uma
                                                        seriliazação, e
                                                        depois carrego
                                                        esse modelo do
                                                        SQL para fazer
                                                        previsões em
                                                        novos dados. </div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)"><br>
                                                      </div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)">Estou
                                                        seguindo um
                                                        exemplo
                                                        disponível nessa
                                                        página:</div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763"><a
href="https://docs.microsoft.com/pt-br/sql/advanced-analytics/tutorials/walkthrough-deploy-and-use-the-model"
target="_blank" moz-do-not-send="true">https://docs.microsoft.com/pt-<wbr>br/sql/advanced-analytics/tuto<wbr>rials/walkthrough-deploy-and-u<wbr>se-the-model</a></font><br>
                                                      </div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763"><br>
                                                        </font></div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763">Sei
                                                          que esse
                                                          exemplo não é
                                                          reproduzível
                                                          porque depende
                                                          da conexão com
                                                          o servidor e
                                                          credenciais
                                                          que não posso
                                                          divulgar. Mas
                                                          se alguem já
                                                          passou por
                                                          esse problema
                                                          poderia pelo
                                                          menos indicar
                                                          aonde está o
                                                          problema que
                                                          não estou
                                                          sabendo
                                                          identificar?
                                                          Acho que muito
                                                          provavelmente
                                                          seria uma
                                                          configuração
                                                          do SQL no
                                                          servidor... </font></div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763"><br>
                                                        </font></div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763">
                                                          <div
                                                          class="gmail_default">library(RODBC) </div>
                                                          <div
                                                          class="gmail_default"><br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">#
                                                          define
                                                          database
                                                          connection
                                                          string</div>
                                                          <div
                                                          class="gmail_default">dbconn
                                                          <-
                                                          'Driver={SQL
                                                          Server};Server=BLABLABLA;Datab<wbr>ase=BLABLABLA;Trusted_Connecti<wbr>on=yes;' </div>
                                                          <div
                                                          class="gmail_default"><br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">#
                                                          define a
                                                          connection</div>
                                                          <div
                                                          class="gmail_default">conn
                                                          <-
                                                          odbcDriverConnect(connection
                                                          = dbconn) </div>
                                                        </font></div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763"><br>
                                                        </font></div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763">#
                                                          Estou fazendo
                                                          o exemplo com
                                                          o objeto
                                                          LETTERS só pra
                                                          ter certeza
                                                          que é um
                                                          objeto pequeno
                                                          e que não
                                                          deveria ser um
                                                          problema de
                                                          memória do R.</font></div>
                                                      <div
                                                        class="gmail_default"><span
style="color:rgb(7,55,99);font-family:"arial
                                                          black",sans-serif">>
                                                          LETTERS</span><br>
                                                      </div>
                                                      <div
                                                        class="gmail_default"><font
                                                          face="arial
                                                          black,
                                                          sans-serif"
                                                          color="#073763">
                                                          <div
                                                          class="gmail_default"> [1]
                                                          "A" "B" "C"
                                                          "D" "E" "F"
                                                          "G" "H" "I"
                                                          "J" "K" "L"
                                                          "M" "N" "O"
                                                          "P" "Q" "R"
                                                          "S" "T" "U"
                                                          "V" "W" "X"</div>
                                                          <div
                                                          class="gmail_default">[25]
                                                          "Y" "Z"</div>
                                                          <div
                                                          class="gmail_default">>
                                                          teste_pequeno
                                                          <-
                                                          serialize(LETTERS,
                                                          connection =
                                                          NULL)</div>
                                                          <div
                                                          class="gmail_default">>
                                                          teste_pequeno
                                                          <-
                                                          paste(teste_pequeno,
                                                          collapse = "")</div>
                                                          <div
                                                          class="gmail_default"><br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">#
                                                          o EXEC
                                                          PersistModel
                                                          faz </div>
                                                          <div
                                                          class="gmail_default">#
                                                          insert into
                                                          [tempo_permanencia_models]
                                                          (model,
                                                          [description])
                                                          values
                                                          (convert(varbinary(max),@m,2),
                                                          @description)</div>
                                                          <div
                                                          class="gmail_default">#
                                                          insere o
                                                          modelo e uma
                                                          descricao</div>
                                                          <div
                                                          class="gmail_default"><br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">>
                                                          p <-
                                                          paste("EXEC
                                                          PersistModel
                                                          @m='",
                                                          teste_pequeno,"',
                                                          @description =
                                                          'Teste de
                                                          serialização
                                                          objeto
                                                          pequeno'", sep
                                                          = "")</div>
                                                          <div
                                                          class="gmail_default">>
                                                          sqlQuery(conn,
                                                          p)</div>
                                                          <div
                                                          class="gmail_default">character(0)</div>
                                                          <div
                                                          class="gmail_default">>
rm(teste_pequeno)</div>
                                                          <div
                                                          class="gmail_default">>
                                                          p <-
                                                          "SELECT model
                                                          FROM
                                                          [tempo_permanencia_models]
                                                          WHERE id_model
                                                          = 1022"</div>
                                                          <div
                                                          class="gmail_default">>
                                                          mod.teste.peq
                                                          <-
                                                          sqlQuery(conn,
                                                          p)</div>
                                                          <div
                                                          class="gmail_default">Error
                                                          in
                                                          odbcQuery(channel,
                                                          query,
                                                          rows_at_time)
                                                          : </div>
                                                          <div
                                                          class="gmail_default"> 
                                                          'Calloc' could
                                                          not allocate
                                                          memory
                                                          (214748364800
                                                          of 1 bytes)</div>
                                                          <div
                                                          class="gmail_default">>
                                                          p <-
                                                          paste0("SELECT
                                                          id_model,
                                                          description
                                                          FROM
                                                          [tempo_permanencia_models]
                                                          WHERE id_model
                                                          = 1022")<br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">>
                                                          sqlQuery(conn,
                                                          p) #</div>
                                                          <div
                                                          class="gmail_default"> 
                                                           id_model    
                                                                       
                                                                       
                                                                     
                                                           description</div>
                                                          <div
                                                          class="gmail_default">1
                                                               1022    
                                                                       
                                                            Teste de
                                                          serialização
                                                          objeto pequeno<br>
                                                          </div>
                                                          <div
                                                          class="gmail_default"><br>
                                                          </div>
                                                          <div
                                                          class="gmail_default">Reparem
                                                          que o objeto
                                                          está salvo no
                                                          servidor. Foi
                                                          salvo a partir
                                                          do R, mas não
                                                          retorna para o
                                                          R por conta do
                                                          erro de
                                                          memoria. Eu
                                                          não estou
                                                          sabendo nem
                                                          por onde
                                                          começar.</div>
                                                        </font></div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)"><br>
                                                      </div>
                                                      <div
                                                        class="gmail_default"
style="font-family:"arial
                                                        black",sans-serif;font-size:small;color:rgb(7,55,99)">Que
                                                        a força esteja
                                                        sempre com vocês
                                                        e abraço forte. </div>
                                                      <span
class="m_1601941344025199055m_-5566544572137748566m_-2957336891499193865m_-5822651748509058777HOEnZb"><font
color="#888888">
                                                          <div
                                                          class="gmail_default"
style="font-family:"arial
                                                          black",sans-serif;font-size:small;color:rgb(7,55,99)"><br>
                                                          </div>
                                                          <div>
                                                          <div
class="m_1601941344025199055m_-5566544572137748566m_-2957336891499193865m_-5822651748509058777m_2794565606116428888gmail_signature">
                                                          <div dir="ltr">
                                                          <div>
                                                          <div dir="ltr">
                                                          <div dir="ltr"><font
style="background-color:rgb(255,255,255)" face="'courier new',
                                                          monospace"
                                                          color="#000066">Pedro
                                                          Brasil</font></div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </font></span></div>
                                                    <br>
                                                  </div>
                                                </div>
______________________________<wbr>_________________<br>
                                                R-br mailing list<br>
                                                <a
                                                  href="mailto:R-br@listas.c3sl.ufpr.br"
                                                  target="_blank"
                                                  moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</a><br>
                                                <a
                                                  href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                                                  rel="noreferrer"
                                                  target="_blank"
                                                  moz-do-not-send="true">https://listas.inf.ufpr.br/cgi<wbr>-bin/mailman/listinfo/r-br</a><br>
                                                Leia o guia de postagem
                                                (<a
                                                  href="http://www.leg.ufpr.br/r-br-guia"
                                                  rel="noreferrer"
                                                  target="_blank"
                                                  moz-do-not-send="true">http://www.leg.ufpr.br/r-br-g<wbr>uia</a>)
                                                e forneça código mínimo
                                                reproduzível.<br>
                                              </blockquote>
                                            </div>
                                            <br>
                                          </div>
                                        </blockquote>
                                      </div>
                                      <br>
                                    </div>
                                  </div>
                                </div>
                              </blockquote>
                            </div>
                            <br>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
R-br mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a class="moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</pre>
    </blockquote>
    <br>
  </body>
</html>