[Zope] Zope DTML zSQL Select from Oracle insert into MS Access

Julian Clark Julian.Clarke@b-online.com.au
Tue, 08 Jul 2003 08:45:47 +0800


Hi Tino,
Firstly....
Which is the most ancient way of defining dtml tags?
Is it the <!--# -->
or is it the <dtmlvar >
I like the look of <!--# makes me think of html comments :) --> , this was
what I was shown when I took over this role.
When I knew absolutely nothing about zope/python/dtml (I still know nothing
about python).


Hrmmm- Python scripts eh?
This will mean I'll have to put some brainpower behind this (must learn
python now)

I guess that this will become a bigger project than I initially thought.

Thanks for your prompt reply,

Julian Clark



----- Original Message -----
From: "Tino Wildenhain" <tino@wildenhain.de>
To: "Julian Clark" <Julian.Clarke@b-online.com.au>
Cc: <zope@zope.org>
Sent: Monday, July 07, 2003 5:32 PM
Subject: Re: [Zope] Zope DTML zSQL Select from Oracle insert into MS Access


Hi Julian,

Julian Clark wrote:
> Hi,
>
> I've been trying (rather unsuccessfully i might add) to select some
> data from an oracle table, and insert it into another MS Access table.
>
> I'm trying to do this  via a dtml method and a couple of zSQL queries.
>
> Has anyone here found a good way of achieving this?


If this must be done via web, you should consider small python scripts
for this, since it is more clear how to script them.

Say, where did you find the most ancient way of defining dtml-tags? ;))

in a python-script and somewhat similar in dtml,
you would do something like that:

for item in context.yourOracleQuery(param1=someparam1,param2=someparam2):

context.yourAccessQueryWithSingleLineInsert(insertvalue1=item.value1,insertv
alue2=item.value2)


this was it. Your mail-client may break the lines appart, but you can
have a look into your favourite python manual to get this right.

Inside your ZSQL-Methods you use param1, param2
and insertvalue1,insertvalue2 and so on.

HTH
Tino Wildenhain

> I've been trying many variants...
>
> this is my latest...
>
> TheForm
> <form name='form1' action='meth_step'>
> <tr>
> <td>Start Date</td>
> <td><input type='text' name='start_date'></input>
> <td>End Date <input type='text' name='end_date'></input>
> <input type='submit' name='Go'></input></td>
> </form>
>
>
> Oracle Select
> select
> H.mobile_no as mobile_number,
> H.DEALER_NO as dealer_code,
> SCD.ENTRY_DATE as date_added
> from
> jan.sc_detail SCD,
> jan.handset H
> where
> SCD.handset_code = H.code and
> SCD.comments = 'SERVICE ADDED' and
> SCD.ENTRY_DATE > ('<dtml-var start_date>') and
> SCD.ENTRY_DATE < ('<dtml-var end_date>') and
> (H.status = 'A' or H.status = 'B') and
> (H.DEALER_NO NOT BETWEEN '0000' and '0004')
>
> Dtml method ('meth_step')
> <!--#call insert_all_connects -->
>
>



MS Access Insert
INSERT into mConnectList
(
dealer_code,
mobile_number,
date_added
)
values
(
   <dtml-sqlvar insertvalue1>,<dtml-sqlvar insertvalue2>,<dtml-sqlvar
insertvalue3>
)



(you can of yourse have other names for your insertvalues, this is just
an example)


>
> Thanks
> Julian.
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>