RE: Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-19 Thread David Raymond
> Are there Python ways to execute queries on PostgreSQL without getting data > over? > > Are there ways just to fire off PostgreSQL queries and not get data into > Python? > > Regards, > > David What is your use case for this? Normally when you do basic things

Re: Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-18 Thread Mats Wichmann
On 10/18/20 5:53 AM, Shaozhong SHI wrote: > Are there Python ways to execute queries on PostgreSQL without getting data > over? > > Are there ways just to fire off PostgreSQL queries and not get data into > Python? > > Regards, > > David > When you "execute

Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-18 Thread Shaozhong SHI
Are there Python ways to execute queries on PostgreSQL without getting data over? Are there ways just to fire off PostgreSQL queries and not get data into Python? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Have you ever wondered why there are so many flavors of python. This post answers all your queries.

2014-03-25 Thread Terry Reedy
On 3/25/2014 6:52 AM, Amit Khomane wrote: http://www.techdarting.com/2014/03/why-different-flavors-of-python.html This is about implementations: CPython, Jython, etc. I am not sure it actually answers Why? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Have you ever wondered why there are so many flavors of python. This post answers all your queries.

2014-03-25 Thread Amit Khomane
http://www.techdarting.com/2014/03/why-different-flavors-of-python.html -- https://mail.python.org/mailman/listinfo/python-list

Re: SQL code generation from table-free boolean queries?

2013-06-27 Thread alex23
On 27/06/2013 9:17 AM, Foo Stack wrote: Given string input such as: foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello' I am going to implement: - boolean understanding (which operator takes precendence) - spliting off of attributes into my function which computes their table in th

Re: SQL code generation from table-free boolean queries?

2013-06-26 Thread Tim Chase
On 2013-06-26 16:17, Foo Stack wrote: > Given string input such as: > foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello' > > I am going to implement: > > - boolean understanding (which operator takes precendence) > - spliting off of attributes into my function which computes their >

SQL code generation from table-free boolean queries?

2013-06-26 Thread Foo Stack
Given string input such as: foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello' I am going to implement: - boolean understanding (which operator takes precendence) - spliting off of attributes into my function which computes their table in the SQL database - piece everything together

Re: More general way of generating PyODBC queries as a dict?

2013-05-22 Thread stackoverflowuser95
On Wednesday, May 22, 2013 9:33:18 AM UTC+10, Dennis Lee Bieber wrote: > On Tue, 21 May 2013 10:27:07 -0700 (PDT), stackoverflowuse...@gmail.com > > declaimed the following in gmane.comp.python.general: > > > > > > > > For example, when multiple tables are queried; some hackish lambdas are >

More general way of generating PyODBC queries as a dict?

2013-05-21 Thread stackoverflowuser95
Here are my averagely general class methods for creating a dictionary from the result of database queries: def make_schema_dict(self): schema = [i[2] for i in self.cursor.tables() if i[2].startswith('tbl_') or i[2].startswith('vw_')] self.schem

multi-result set MySQLdb queries.

2013-02-07 Thread Andrew Robinson
Hi, I'm being forced to use "import MySQLdb" to access a serverand am not getting all my data back. I'm trying to send multiple queries all at once (for time reasons) and then extract the rows in bulk. The queries have different number of columns; For

Quepy, transform questions in natural language into queries in a DB language using python

2013-01-29 Thread Elias Andrawos
We are sharing an open source framework that we made here at Machinalis: Quepy https://github.com/machinalis/quepy Quepy is a Python framework to transform questions in natural language into queries in a database language. It can be easily adapted to different types of questions in natural

Quepy is a framework to transform questions in natural language into queries in a database language.

2012-12-17 Thread quepyproject
We are sharing an open source framework that we made here at Machinalis: Quepy https://github.com/machinalis/quepy Quepy is a framework to transform questions in natural language into queries in a database language. It can be easily adapted to different types of questions in natural language, so

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-14 Thread alex23
Tim Chase wrote: > I'm not sure it can entirely be chalked up to not looking hard > enough. It's explicitly cited in the feature list: Raw SQL statement mapping SQLA's object relational query facilities can accommodate raw SQL statements as well as plain result sets, and object instances can be

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-12 Thread Tim Chase
On 10/11/11 22:13, alex23 wrote: They look good, but I'm looking for something which can "compile" down to normal SQL code. Then you're not looking hard enough. SQLAlchemy does this. I'm not sure it can entirely be chalked up to not looking hard enough. Because so many keywords of what's de

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-12 Thread Alec Taylor
That's why I said "over the next few days", because learning it for that last assignment would've been too much effort :P On Wed, Oct 12, 2011 at 3:45 PM, wu wei wrote: > Just don't use it for the first time in a demo and then blame me when it > fails ;) > > On Wed, Oct 12, 2011 at 2:05 PM, Alec

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Alec Taylor
Great, I'll learn how to use it over the next few days :] On Wed, Oct 12, 2011 at 2:13 PM, alex23 wrote: > On Oct 12, 1:14 am, Alec Taylor wrote: >> They look good, but I'm looking for something which can "compile" down >> to normal SQL code. > > Then you're not looking hard enough. SQLAlchemy

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread alex23
On Oct 12, 1:14 am, Alec Taylor wrote: > They look good, but I'm looking for something which can "compile" down > to normal SQL code. Then you're not looking hard enough. SQLAlchemy does this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Ben Finney
Alec Taylor writes: > I'm looking for a Python library for generating SQL queries [selects, > alters, inserts and commits]. SQLAlchemy http://www.sqlalchemy.org/> is the leader in this field. It allows your code to interact with the database at different levels: you can write ra

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Adam Tauno Williams
Quoting Alec Taylor They look good, but I'm looking for something which can "compile" down to normal SQL code. So that I can just plug that .sql file into any environment [i.e. non-python env] SQLalchemy will happily give you statements and argument lists if that is what you want. query =

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Alec Taylor
;> I'm looking for a Python library for generating SQL queries >> [selects, alters, inserts and commits]. > > The popular ones are SQLObject and SQLAlchemy, both just a web-search away. > > Additionally, if you're working with Django, it has its own built-in ORM. > &g

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Tim Chase
On 10/11/11 07:08, Alec Taylor wrote: I'm looking for a Python library for generating SQL queries [selects, alters, inserts and commits]. The popular ones are SQLObject and SQLAlchemy, both just a web-search away. Additionally, if you're working with Django, it has its own bu

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Yaşar Arabacı
Are you looking for something like this? http://www.sqlalchemy.org/ 2011/10/11 Alec Taylor > Good afternoon, > > I'm looking for a Python library for generating SQL queries [selects, > alters, inserts and commits]. > > I can write them by hand, but thought it would be mor

Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Alec Taylor
Good afternoon, I'm looking for a Python library for generating SQL queries [selects, alters, inserts and commits]. I can write them by hand, but thought it would be more useful writing them in Python (i.e. client-side referential integrity checking before insert commit + test data gener

Re: Why are String Formatted Queries Considered So Magical? (Spammer analysis)

2010-07-27 Thread John Bokma
John Nagle writes: > On 7/26/2010 4:19 PM, Justin Smith wrote: >> Seeking industry expert candidates >> >> I’m Justin Smith, Director of Tech Recruiting at Express Seattle. I >> am currently seeking candidates to fill Tech Positions for multiple A- >> List Clients: > >Spammer detected. But

Re: Why are String Formatted Queries Considered So Magical? (Spammer analysis)

2010-07-27 Thread John Nagle
On 7/26/2010 4:19 PM, Justin Smith wrote: Seeking industry expert candidates I’m Justin Smith, Director of Tech Recruiting at Express Seattle. I am currently seeking candidates to fill Tech Positions for multiple A- List Clients: Spammer detected. Injection-Info: r27g2000yqb.googlegroup

Re: Why are String Formatted Queries Considered So Magical?

2010-07-26 Thread Ben Finney
Justin Smith writes: > Seeking industry expert candidates Please don't reply in an existing thread with an unrelated message. If you want to start a new discussion, compose a new message, not a reply. For job advertisements, please don't use this forum at all; instead use the Python Jobs Board

Re: Why are String Formatted Queries Considered So Magical?

2010-07-26 Thread Justin Smith
Seeking industry expert candidates I’m Justin Smith, Director of Tech Recruiting at Express Seattle. I am currently seeking candidates to fill Tech Positions for multiple A- List Clients: • Quality Assurance Engineer, • Senior Data Engineer, Search Experience • Senior Software D

Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Rami Chowdhury
On Saturday 03 July 2010 19:33:44 Lawrence D'Oliveiro wrote: > In message , Nobody wrote: > > On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: > >>> Seriously, almost every other kind of library uses a binary API. What > >>> makes databases so special that they need a string-command b

Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: > >>> Seriously, almost every other kind of library uses a binary API. What >>> makes databases so special that they need a string-command based API? >> >> HTML is also effectively a string-based API. >

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Stephen Hansen
On 7/1/10 5:11 AM, Roy Smith wrote: Stephen Hansen wrote: The quote does not deny the power of regular expressions; it challenges widely held assumption and belief that comes from *somewhere* that they are the best way to approach any problem that is text related. Well, that assumption comes

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Stephen Hansen
On 7/1/10 3:03 AM, Jean-Michel Pichavant wrote: Re is part of the python standard library, for some purpose I guess. No, *really*? So all those people who have been advocating its useless and shouldn't be are already too late? Damn. Well, there goes *that* whole crusade we were all out on.

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Roy Smith
Stephen Hansen wrote: > The quote does not deny the power of regular expressions; it challenges > widely held assumption and belief that comes from *somewhere* that they > are the best way to approach any problem that is text related. Well, that assumption comes from historical unix usage wher

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Jean-Michel Pichavant
Stephen Hansen wrote: On 6/30/10 11:58 PM, Jorgen Grahn wrote: On Wed, 2010-06-30, Steven D'Aprano wrote: On Wed, 30 Jun 2010 14:14:38 +, Jorgen Grahn wrote: On Tue, 2010-06-29, Stephen Hansen wrote: There's nothing silly about it. It is an exaggeration though: but it does represent a g

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Stephen Hansen
On 6/30/10 11:58 PM, Jorgen Grahn wrote: On Wed, 2010-06-30, Steven D'Aprano wrote: On Wed, 30 Jun 2010 14:14:38 +, Jorgen Grahn wrote: On Tue, 2010-06-29, Stephen Hansen wrote: There's nothing silly about it. It is an exaggeration though: but it does represent a good thing to keep in mi

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Jorgen Grahn
On Wed, 2010-06-30, Steven D'Aprano wrote: > On Wed, 30 Jun 2010 14:14:38 +, Jorgen Grahn wrote: > >> On Tue, 2010-06-29, Stephen Hansen wrote: >>> On 6/29/10 5:41 AM, Roy Smith wrote: Nobody wrote: >> And what about regular expressions? > > What about them? As the saying

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Steven D'Aprano
On Wed, 30 Jun 2010 14:14:38 +, Jorgen Grahn wrote: > On Tue, 2010-06-29, Stephen Hansen wrote: >> On 6/29/10 5:41 AM, Roy Smith wrote: >>> Nobody wrote: >>> > And what about regular expressions? What about them? As the saying goes: Some people, when confronted with

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Ethan Furman
Terry Reedy wrote: On 6/30/2010 8:22 AM, Nobody wrote: I've noticed over the years a significant anti-RE sentiment in the Python community. IMHO, the sentiment isn't so much against REs per se, but against excessive or inappropriate use. Apart from making it easy to write illegible code, they

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Terry Reedy
On 6/30/2010 8:22 AM, Nobody wrote: I've noticed over the years a significant anti-RE sentiment in the Python community. IMHO, the sentiment isn't so much against REs per se, but against excessive or inappropriate use. Apart from making it easy to write illegible code, they also make it easy t

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Stephen Hansen
On 6/30/10 7:14 AM, Jorgen Grahn wrote: On Tue, 2010-06-29, Stephen Hansen wrote: On 6/29/10 5:41 AM, Roy Smith wrote: Nobody wrote: And what about regular expressions? What about them? As the saying goes: Some people, when confronted with a problem, think "I know, I'll u

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Jorgen Grahn
On Tue, 2010-06-29, Stephen Hansen wrote: > On 6/29/10 5:41 AM, Roy Smith wrote: >> Nobody wrote: >> And what about regular expressions? >>> >>> What about them? As the saying goes: >>> >>> Some people, when confronted with a problem, think >>> "I know, I'll use regular expressions."

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Nobody
On Tue, 29 Jun 2010 08:41:03 -0400, Roy Smith wrote: >> > And what about regular expressions? >> >> What about them? As the saying goes: >> >> Some people, when confronted with a problem, think >> "I know, I'll use regular expressions." >> Now they have two problems. > > That's s

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Carl Banks
On Jun 28, 3:07 am, Dennis Lee Bieber wrote: > On Sun, 27 Jun 2010 21:02:57 -0700, Stephen Hansen > declaimed the following in > gmane.comp.python.general: > > > (This is an area where parametrized queries is even more important: but > > I'm not sure if MySQL doe

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Stephen Hansen
On 6/29/10 5:41 AM, Roy Smith wrote: Nobody wrote: And what about regular expressions? What about them? As the saying goes: Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. That's silly. RE is a

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Roy Smith
Nobody wrote: > > And what about regular expressions? > > What about them? As the saying goes: > > Some people, when confronted with a problem, think > "I know, I'll use regular expressions." > Now they have two problems. That's silly. RE is a good tool. Like all good tools

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Duncan Booth
Owen Jacobson wrote: > However, not every programming language has > the kind of structural flexibility to do that well: a library similar > to SQLalchemy would be incredibly clunky (if it worked at all) in, say, > Java or C#, and it'd be nearly impossible to pull off in C. I guess you've ne

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Nobody
On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: >> Seriously, almost every other kind of library uses a binary API. What >> makes databases so special that they need a string-command based API? > > HTML is also effectively a string-based API. HTML is a data format. The sane way to

Re: Why are String Formatted Queries Considered So Magical?

2010-06-28 Thread Peter H. Coffin
On Mon, 28 Jun 2010 03:07:29 -0700, Dennis Lee Bieber wrote: > Coding for something like a DBTG network database did not allow for > easy changes in queries... What would be a simple join in SQL was > traversing a circular linked list in the DBTG database my college > taught.

Re: Why are String Formatted Queries Considered So Magical?

2010-06-28 Thread Lawrence D'Oliveiro
In message <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>, Carl Banks wrote: > Seriously, almost every other kind of library uses a binary API. What > makes databases so special that they need a string-command based API? HTML is also effectively a string-based API. And what a

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > On Jun 27, 8:33 pm, Ben Finney wrote: > > Carl Banks writes: > > > I'm disappointed, usually when you sit on your reinforced soapbox and > > > pretense the air of infinite expertise you at least use reasonable > > > logic. > > > > Kindly stop inventing straw men to attack;

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 9:02 pm, Stephen Hansen wrote: > On 6/27/10 8:48 PM, Carl Banks wrote: > > > I don't know the exact details of all of these, but I'm going to opine > > that at least some of these are easily expressible with a function > > call API.  Perhaps more

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 8:33 pm, Ben Finney wrote: > Carl Banks writes: > > I'm disappointed, usually when you sit on your reinforced soapbox and > > pretense the air of infinite expertise you at least use reasonable > > logic. > > Kindly stop inventing straw men to attack; I deny the position you're > painti

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
On 2010-06-28 00:02:57 -0400, Stephen Hansen said: On 6/27/10 8:48 PM, Carl Banks wrote: I don't know the exact details of all of these, but I'm going to opine that at least some of these are easily expressible with a function call API. Perhaps more naturally than with string que

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
er while building up a result set for you. All right, I get it. I'm not talking about SQL, I'm talking about RDBs. But I guess it is important for serious RDBs to support queries complex enough that a language like SQL is really needed to express it--even if being called from an expre

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Stephen Hansen
On 6/27/10 8:48 PM, Carl Banks wrote: I don't know the exact details of all of these, but I'm going to opine that at least some of these are easily expressible with a function call API. Perhaps more naturally than with string queries. For instance, set operations: query1 =

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Stephen Hansen
On 6/27/10 7:51 PM, Carl Banks wrote: I'm not the biggest expert on SQL ever, but the only thing I can think of is expressions. Statements don't express anything very complex, and could straightforwardly be represented by function calls. See, there's really two kinds of SQL out there. There's

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
y be represented by function calls.  But > > it's a fair point. > > Off the top of my head, I can think of a few things that would be > tricky to turn into an API: > >  * Aggregation (GROUP BY, aggregate functions over arbitrary > expressions, HAVING clauses). >  *

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > On Jun 27, 4:35 pm, Ben Finney wrote: > > Carl Banks writes: > > > Seriously, almost every other kind of library uses a binary API. > > > > Except for the huge number that deal with text protocols or languages. > > No, not really. Almost all types of libraries have binary

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
the top of my head, I can think of a few things that would be tricky to turn into an API: * Aggregation (GROUP BY, aggregate functions over arbitrary expressions, HAVING clauses). * CASE expressions. * Subqueries. * Recursive queries (in DBMSes that support them). * Window clauses (likewise). *

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
the top of my head, I can think of a few things that would be tricky to turn into an API: * Aggregation (GROUP BY, aggregate functions over arbitrary expressions, HAVING clauses). * CASE expressions. * Subqueries. * Recursive queries (in DBMSes that support them). * Window clauses (likewise). *

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
on't express anything very complex, and could straightforwardly be represented by function calls. But it's a fair point. > The problem is not so much that SQL queries are described as text > strings, No, it is the problem, or part of it. String commands are inherently prone to

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 4:35 pm, Ben Finney wrote: > Carl Banks writes: > > Seriously, almost every other kind of library uses a binary API. > > Except for the huge number that deal with text protocols or languages. No, not really. Almost all types of libraries have binary APIs, including those that deal wi

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > Seriously, almost every other kind of library uses a binary API. Except for the huge number that deal with text protocols or languages. > What makes databases so special that they need a string-command based > API? Because SQL is a text language. -- \ “In t

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Roy Smith
eally a good fit for what it can do. The problem is not so much that SQL queries are described as text strings, but that the distinction between program and data gets lost if you build the query as one big string. What you need (and which the Python API supplies) is the ability to clearly di

Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 24, 6:02 pm, Roy Smith wrote: > In article , >  Lawrence D'Oliveiro wrote: > > > I construct ad-hoc queries all the time. It really isn’t that hard to do > > safely. All you have to do is read the documentation > > I get worried when people talk abou

Re: queries about exceptions(newbie)

2010-06-04 Thread Payal
On Thu, Jun 03, 2010 at 11:42:16PM -0700, Chris Rebert wrote: > >>> try: > ... x[1] > ... except IndexError as e: > ... print "Got error:", e.args[0] # grab the error message > ... > Got error: list index out of range Thanks a lot. This example solved what the tutorial could not. With war

Re: queries about exceptions(newbie)

2010-06-03 Thread Chris Rebert
On Thu, Jun 3, 2010 at 11:31 PM, Payal wrote: > Hi all, > I am trying to learn exceptions and have few small doubts from > http://docs.python.org/tutorial/errors.html > There are many statements there of the form, > > ... except Exception as inst: >        do something > > ... except ZeroDivisionE

queries about exceptions(newbie)

2010-06-03 Thread Payal
Hi all, I am trying to learn exceptions and have few small doubts from http://docs.python.org/tutorial/errors.html There are many statements there of the form, ... except Exception as inst: do something ... except ZeroDivisionError as detail: do something ... except MyError as e:

Ann: Nucular full text search 0.5 +boolean queries +unicode fixes

2009-05-20 Thread Aaron Watters
Announcing Nucular 0.5 This release adds streamlined interfaces for boolean queries. Search for "dogs" or "cats" but not "smelly" like this: dicts = session.dictionaries("(dogs|cats) ~smelly") Also included are some other features and bug fixes,

Generating User Search Queries

2009-04-10 Thread Lawrence D'Oliveiro
I implemented a form in a Web-based database-management application that lets the user search on a whole lot of different fields. I hate writing repetitive code. But here's part of the sequence I came up with for translating entered field values into MySQL query phrases: condition = \ (

Re: Queries

2009-02-28 Thread mmcclaf
T, etc, replace those with the relational algebra symbols, hence needing to make a relational algebra expression. >> So in short of the responses given, I need to study further: GROUP BY, >> HAVING, AS, COUNT, and subselect queries, right? >Since it's homework, we (thi

Re: Queries

2009-02-27 Thread Steve Holden
Dennis Lee Bieber wrote: > On Fri, 27 Feb 2009 15:39:13 -0800 (PST), mmcclaf > declaimed the following in gmane.comp.python.general: > >> This came in the Python groups, and I put one up in the database >> group, since I will later have to use Python to access the SQL file, [...] >> The relationa

Re: Queries

2009-02-27 Thread mmcclaf
to the other. > Another gmail user found only by back referencing responses... What is meant by this statement? So in short of the responses given, I need to study further: GROUP BY, HAVING, AS, COUNT, and subselect queries, right? The relational algebra, I am able to translate it i

Re: Queries

2009-02-27 Thread Steve Holden
d is the the united *queries* have the same number and type of columns. I assume that the OP was selecting *, though ... regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Queries

2009-02-26 Thread mmcclaf
Another problem with this assignment... I have to list all the ships mentioned in the database. All the ships may not appear in the Ships relations... I said the following in algebraic expression SELECT name(Ships UNION (SELECT ship (Outcome UNION(SELECT class (Classes))) Would that work? -- http

Re: Queries

2009-02-26 Thread mmcclaf
On Feb 26, 7:51 am, Steve Holden wrote: > Murray wrote: > > [top-posting corrected] > > > > > -Original Message- > > From: Gary Herron [mailto:gher...@islandtraining.com] > > Sent: Thursday, February 26, 2009 1:46 AM > > To: mmcclaf; pytho

Re: Queries

2009-02-26 Thread Bret Fledderjohn
2009/2/26 Steve Holden > Murray wrote: > [top-posting corrected] > > > -Original Message- > > From: Gary Herron [mailto:gher...@islandtraining.com] > > Sent: Thursday, February 26, 2009 1:46 AM > > To: mmcclaf; python-list@python.org > > Subject: Re

Re: Queries

2009-02-26 Thread Steve Holden
Murray wrote: [top-posting corrected] > -Original Message- > From: Gary Herron [mailto:gher...@islandtraining.com] > Sent: Thursday, February 26, 2009 1:46 AM > To: mmcclaf; python-list@python.org > Subject: Re: Queries > > mmcclaf wrote: >> I have to make

RE: Queries

2009-02-26 Thread Murray
, 2009 1:46 AM To: mmcclaf; python-list@python.org Subject: Re: Queries mmcclaf wrote: > I have to make some queries for 4 tables I have. The following > relations are: > > Classes(class, type, country, numGuns, bore, displacement) > Ships (name, class, launched) > Battles (name

Re: Queries

2009-02-25 Thread Gary Herron
mmcclaf wrote: I have to make some queries for 4 tables I have. The following relations are: Classes(class, type, country, numGuns, bore, displacement) Ships (name, class, launched) Battles (name, date) Outcomes (ship, battle, result) The three queries I'm stuck on are the following: 1.

Queries

2009-02-25 Thread mmcclaf
I have to make some queries for 4 tables I have. The following relations are: Classes(class, type, country, numGuns, bore, displacement) Ships (name, class, launched) Battles (name, date) Outcomes (ship, battle, result) The three queries I'm stuck on are the following: 1. Find the classes

Re: Reuse of DB-API 2.0 cursors for multiple queries?

2009-01-28 Thread Carsten Haese
a cursor for subsequent > queries. The PEP doesn't specify either way, that I can see. The PEP doesn't say explicitly that a cursor can execute multiple queries, but it's definitely implied by the second paragraph: """ .execute(operation[,parameters])

Re: Reuse of DB-API 2.0 cursors for multiple queries?

2009-01-28 Thread Дамјан Георгиевски
> Today, I used the adodbapi module against an SQL Server Express > database. I was surprised to get an exception, when I attempted to > submit a second query with my cursor object. The full session is > below. >>> curs.execute('select * from localview_roles') >>> curs.execute('select * from loc

Reuse of DB-API 2.0 cursors for multiple queries?

2009-01-28 Thread moreati
Today, I used the adodbapi module against an SQL Server Express database. I was surprised to get an exception, when I attempted to submit a second query with my cursor object. The full session is below. With cx_Oracle I've become used to reusing a cursor for subsequent queries. The PEP do

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2009-01-14 Thread Aahz
In article <82372457-2503-4682-96b3-37540328b...@w39g2000prb.googlegroups.com>, <5lvqbw...@sneakemail.com> wrote: > >I have Section 4.4.1 of SICP rattling around in my head (database >queries), and I'm trying to come up with a simple dictionary-based >database i

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2009-01-01 Thread Jonathan Gardner
the fly to do the search. > More on this at the very end. Just smile to know that you're very close. > > course. Instead, it transforms the query (the WHAT) into a set of > > procedures that describe HOW to get the result. > > For now I'm not parsing actua

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread 5lvqbwl02
ional database theory' is what I should start looking around for... otherwise googling on sql, queries, etc., just returns how to execute a query, but says nothing about how a fish works. > > In a typical SQL database, when you type in "SELECT foo FROM bar WHERE > baz='bo

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread Jonathan Gardner
On Dec 30, 12:35 pm, 5lvqbw...@sneakemail.com wrote: > I have Section 4.4.1 of SICP rattling around in my head (database > queries), and I'm trying to come up with a simple dictionary-based > database in Python to represent circuit diagrams.  My main confusion > isn't one of

Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread 5lvqbwl02
I have Section 4.4.1 of SICP rattling around in my head (database queries), and I'm trying to come up with a simple dictionary-based database in Python to represent circuit diagrams. My main confusion isn't one of implementation, but a matter of "big thinking", fundamentall

Re: psycopg2 and large queries

2008-12-18 Thread Laszlo Nagy
They do have a description attribute, but it is only populated after you fetch a row. eg try cur = conn.cursor(name='mycursor') cur.execute('select name from blah') cur.fetchone() print cur.description Oh, great. I should have known. Thanks. Maybe I can live with psycopg2, because combining

Re: psycopg2 and large queries

2008-12-18 Thread alito
On Dec 19, 2:34 am, Laszlo Nagy wrote: > > I was looking for psycopg2 documentation, but I found nothing. However, > I found some posts telling that named cursors do support fetching a > single row at a time. Here is how to create a named cursor: > > cur = conn.cursor('mycursor') > > This is very

Re: psycopg2 and large queries

2008-12-18 Thread Paul Boddie
On 18 Des, 22:28, Laszlo Nagy wrote: > > I'm just looking for something that can replace psycopg2, because of the > bug mentioned in my original post. Here are my options: > > - psycopg1: development stalled > - psycopg2: memory bug and/or not db api compilant (see my original post) If you want,

Re: psycopg2 and large queries

2008-12-18 Thread M.-A. Lemburg
On 2008-12-18 22:28, Laszlo Nagy wrote: > >> Well, there are plenty of PostgreSQL modules around these days, and >> even if pyPgSQL isn't suitable, I'm sure that there must be one which >> can be made to work on Windows and to support server-side cursors. See >> here for more: >> >> http://wiki.py

Re: psycopg2 and large queries

2008-12-18 Thread D'Arcy J.M. Cain
On Thu, 18 Dec 2008 22:28:23 +0100 Laszlo Nagy wrote: > - PyGresSQL: apparently, it does not support fetching one row, only > fetching all rows (see: > http://www.pygresql.org/pg.html#getresult-get-query-values-as-list-of-tuples), > > so this is not an option. (Yes, it also has a db api compil

Re: psycopg2 and large queries

2008-12-18 Thread Laszlo Nagy
Well, there are plenty of PostgreSQL modules around these days, and even if pyPgSQL isn't suitable, I'm sure that there must be one which can be made to work on Windows and to support server-side cursors. See here for more: http://wiki.python.org/moin/PostgreSQL I'm just looking for somethin

Re: psycopg2 and large queries

2008-12-18 Thread Paul Boddie
On 18 Des, 19:09, Steve Holden wrote: > > Hmm, pypgsql doesn't provide a 2.5 Windows installer. I take it you > aren't a Windows user ... ? Well, there are plenty of PostgreSQL modules around these days, and even if pyPgSQL isn't suitable, I'm sure that there must be one which can be made to work

Re: psycopg2 and large queries

2008-12-18 Thread Steve Holden
Paul Boddie wrote: [...]> > You really don't want to be traversing large data sets using fetchone, > anyway. My approach (using pyPgSQL) involves fetchmany and then > looping over each batch of results, if I really have to process the > data in Python; most of the time I can do the processing in t

Re: psycopg2 and large queries

2008-12-18 Thread Paul Boddie
On 18 Des, 16:34, Laszlo Nagy wrote: > psycopg2 is said to be db api 2.0 compilant, but apparent it is buggy. > By default, when I create a cursor with > > cur = conn.cursor() > > then it creates a cursor that will fetch all rows into memory, even if > you call cur.fetchone() on it. (I tested it,

psycopg2 and large queries

2008-12-18 Thread Laszlo Nagy
psycopg2 is said to be db api 2.0 compilant, but apparent it is buggy. By default, when I create a cursor with cur = conn.cursor() then it creates a cursor that will fetch all rows into memory, even if you call cur.fetchone() on it. (I tested it, see below.) I was looking for psycopg2 documenta

Re: Some Berkeley DB questions (being maintained? queries?)

2008-01-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Terry Jones <[EMAIL PROTECTED]> wrote: > >I'm also interested in any ongoing or planned work on the Python interface. Someone recently volunteered to take over primary maintenance, but I can't find the mailing list post. -- Aahz ([EMAIL PROTECTED]) <*>

  1   2   >