[Zope-DB] how to insert values from select in one shot?
Jaroslav Lukesh
lukesh at seznam.cz
Mon Mar 14 21:28:01 EST 2005
Dne pondělí, 14. března 2005 14:38 Charlie Clark napsal(a):
> > Would you like to know me, how I can successfully clone some filed values
> > insde SQL sequence, please? Note, that jobs.Job_id is automatic index.
> > Many thanks for your help.
>
> Hi Jaroslav,
>
> depending on your DB this is quite easy using SELECT from within your
> INSERT, ie. invert the order of your statements. SQL is confusing and
> inconsistent like that. Check your documentation for complete details.
>
> Charlie
>
> INSERT INTO jobs
>
> (Customer_Id, jobs.Problem,)
>
> SELECT
> jobs.Job_id,
> jobs.Customer_Id,
> jobs.Problem,
>
> FROM
> jobs
>
> WHERE
> jobs.job_id = <dtml-sqlvar job_id type="int">
Many thanks for your help, it but it does not work with MSSQL, so I must split
it into two ZSQL methods+dtml :(
--
Jaroslav Lukesh
-----------------------------------------------------------
This e-mail can not contain any viruses because I use Linux
More information about the Zope-DB
mailing list