Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > cz.comp.lang.python > #3223

[python] par dotazu od zacatecnika v SQL

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.61.MISMATCH!peer01.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!fx30.am4.POSTED!not-for-mail
Received-SPF none (Address does not pass the Sender Policy Framework) SPF=MAILFROM; sender=python@vogl.cz; remoteip=::ffff:91.232.213.5; remotehost=; helo=smtp.muvb.cz; receiver=hugo.zagamma.cz;
Reply-To python@vogl.cz
From Lubomir Vogl <python@vogl.cz>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-2; format=flowed
Content-Language en-US
Content-Transfer-Encoding 7bit
Received-SPF none (Address does not pass the Sender Policy Framework) SPF=FROM; sender=python@vogl.cz; remoteip=::ffff:91.232.213.5; remotehost=; helo=smtp.muvb.cz; receiver=hugo.zagamma.cz;
Subject [python] par dotazu od zacatecnika v SQL
X-BeenThere python@py.cz
X-Mailman-Version 2.1.24
Precedence list
List-Id Konference PyCZ <python.py.cz>
List-Unsubscribe <http://www.py.cz/mailman/options/python>, <mailto:python-request@py.cz?subject=unsubscribe>
List-Archive <http://www.py.cz/pipermail/python/>
List-Post <mailto:python@py.cz>
List-Help <mailto:python-request@py.cz?subject=help>
List-Subscribe <http://www.py.cz/mailman/listinfo/python>, <mailto:python-request@py.cz?subject=subscribe>
Newsgroups cz.comp.lang.python
Message-ID <mailman.57.1514198505.2736.python@py.cz> (permalink)
X-Mailman-Original-Message-ID <1e5933fa-c491-ea01-9205-c5bb4d2cfc9d@vogl.cz>
References <1e5933fa-c491-ea01-9205-c5bb4d2cfc9d@vogl.cz>
Lines 23
X-Complaints-To abuse@usenet-news.net
NNTP-Posting-Date Mon, 25 Dec 2017 10:41:45 UTC
Organization usenet-news.net
Date Mon, 25 Dec 2017 11:41:41 +0100
X-Received-Bytes 2512
X-Received-Body-CRC 1253049749
Xref csiph.com cz.comp.lang.python:3223

Show key headers only | View raw


Ahoj,

potreboval bych poradit s SQL. Hraju si s MariaDB a zajimalo by me :

- jaka je nejlepsi knihovna pro praci s SQL ? Zatim jsem nasel (PyMySQL, 
SQLAlchemy, MySqlDb) Chtel bych se naucit neco co bude mozne pouzit i na 
slozitejsi projekty
- je ORM vhodne i na jednodussi projekty ?
- pokud budu v SQL chtit pouzivat vice SQL dotazu, je to mozne udelat 
pres jedno spojeni (jeden cursor) nebo je nutne mit vice otevrenych 
spojeni ? Viz nasledujici priklad - jedno otevrene spojeni


  sql = "SELECT * FROM portal WHERE typ_id = " + str(typ)
  self.cursor.execute(sql)
  data = self.cursor.fetchall()
  c = self.cursor.rowcount
  for row in data:
      sql1 = "INSERT INTO values VALUES ('',NOW(),0," + str(row[0]) + ")"
      try:
          self.cursor.execute(sql1)
      except:
          self.db.rollback()

Back to cz.comp.lang.python | Previous | Next | Find similar


Thread

[python] par dotazu od zacatecnika v SQL Lubomir Vogl <python@vogl.cz> - 2017-12-25 11:41 +0100

csiph-web