Mailing List Archive

modifications on a query
Hello,

I use zope2.9.4 with postgresql8.1, in my database i have some tables are the result of a query on other tables.
exe: table1 is the result of table2 with table3

My
user can connect to the database and he can modify the table1, this
modification should done on the orginals tables table2 and table3
my
problem is how i can specify the origin of the column in table for
verifing that table2 and table3 may this modifications?

thanks for all suggetions.

G.




Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.






Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.







Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.









___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
Re: modifications on a query [ In reply to ]
--On 26. Januar 2007 07:37:25 +0000 Graziella Toutoungis
<graztoutoungis@yahoo.fr> wrote:

>
>
> Hello,
>
> I use zope2.9.4 with postgresql8.1, in my database i have some tables are
> the result of a query on other tables. exe: table1 is the result of
> table2 with table3
>
> My
> user can connect to the database and he can modify the table1, this
> modification should done on the orginals tables table2 and table3
> my
> problem is how i can specify the origin of the column in table for
> verifing that table2 and table3 may this modifications?
>

Please rephrase your question and point out the Zope specific part of the
question.

-aj
Re: modifications on a query [ In reply to ]
> I use zope2.9.4 with postgresql8.1, in my database i have some tables
> are the result of a query on other tables.
> exe: table1 is the result of table2 with table3
>
> My user can connect to the database and he can modify the table1,
> this modification should done on the orginals tables table2 and table3
> my problem is how i can specify the origin of the column in table
> for verifing that table2 and table3 may this modifications?
>
> thanks for all suggetions.
Is table1 a view?
What does 'table2 with table3' mean?
If you have SQL statement like:

select col1, col2, col3 from ....

then you know where columns come from... don't you?

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: modifications on a query [ In reply to ]
Am 26.01.2007, 08:37 Uhr, schrieb Graziella Toutoungis
<graztoutoungis@yahoo.fr>:

>
> Hello,
> I use zope2.9.4 with postgresql8.1, in my database i have some tables
> are the result of a query on other tables.
> exe: table1 is the result of table2 with table3
> My
> user can connect to the database and he can modify the table1, this
> modification should done on the orginals tables table2 and table3
> my
> problem is how i can specify the origin of the column in table for
> verifing that table2 and table3 may this modifications?

I am not exactly sure what you wish to do: is table1 simply a view based
on a query of table2 and table3? It certainly sounds like it should be.
But I am not sure if you update views in PostgreSQL that the original
tables get updated.

You might wish to ask your question again in French as some of us will at
least understand it like that.

Anway if you wish to update tables based on the results of queries in Zope
you are probably best using a PythonScript to link the appropriate queries
if this is not directly possible in SQL.

ie.

results = context.SQL.someQuery()
for result in results:
context.SQL.anotherQuery(result) # you probably wish to pass a
dictionary based on the first query in

Charlie

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
RE : Re: modifications on a query [ In reply to ]
in my database i want to create a table1 who is the
result of a query on table2 and table3 like select
x2,y2,x3,y3 from table2 and table3...
-i want now to create the table1.
-evrey time the user try to insert into table1, i must
insert this data in the original table and verify the
possibility of the insertion.

my code now return a list of column name's like
['id', 'title','phon',...]
i want to create table1 from this list, i don't know
how i can do it, my code is:

query ="SELECT id, name, value, shipping FROM
customer, invoice, orderinfo WHERE customer.id =
invoice.customer_id AND
invoice.order_id=orderinfo.order_id;"

print query

curs.execute(query)

names= [f[0] for f in curs.description]
print 'names%s' %names
tableColumn = []
for name in names:
tableColumn.append(name)


value = []
for row in curs.fetchall():
for pair in zip(row):
value.append(pair)
print '%s' %pair
print

print value

i = 0
column=[]

for x in tableColumn:
test = tableColumn[i].strip()
i += 1
print test
column.append(test)
print column



# createQuery = 'CREATE TABLE test_fetch
%s'%tableColumn
# print createQuery

curs.execute("DROP TABLE test_fetch")
# curs.execute(createQuery)

i will integrate in zope this code to create a form in
order to give the users the capability to manage my
database.

any suggestions?

--- Maciej Wisniowski
<maciej.wisniowski@coig.katowice.pl> a écrit :

>
> > I use zope2.9.4 with postgresql8.1, in my database
> i have some tables
> > are the result of a query on other tables.
> > exe: table1 is the result of table2 with table3
> >
> > My user can connect to the database and he can
> modify the table1,
> > this modification should done on the orginals
> tables table2 and table3
> > my problem is how i can specify the origin of
> the column in table
> > for verifing that table2 and table3 may this
> modifications?
> >
> > thanks for all suggetions.
> Is table1 a view?
> What does 'table2 with table3' mean?
> If you have SQL statement like:
>
> select col1, col2, col3 from ....
>
> then you know where columns come from... don't you?
>
> --
> Maciej Wisniowski
>







___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: RE : Re: modifications on a query [ In reply to ]
Am 26.01.2007, 14:17 Uhr, schrieb Graziella Toutoungis
<graztoutoungis@yahoo.fr>:

> curs.execute("DROP TABLE test_fetch")
> # curs.execute(createQuery)
> i will integrate in zope this code to create a form in
> order to give the users the capability to manage my
> database.
> any suggestions?

Yes, you might want to look at existing products for managing
tables/queries in Zope. Otherwise you should consider creating a Zope file
system product and check that you can access the execute() method of the
DA. This is certainly possible for our mxOBDC Zope DA but I think the
ZpyscopgDA also supports it.

Charlie
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: RE : Re: modifications on a query [ In reply to ]
> any suggestions?
Write a procedure in the database that
does this and just call this procedure from Zope.

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db