Re: create and insert

[prev] [thread] [next] [Date index for 2005/01/20]

From: Peter Speltz
Subject: Re: create and insert
Date: 17:53 on 20 Jan 2005
--- Jay Strauss <me@xxxxxx.xxx> wrote:

> Hartmaier Alexander wrote:
> > Hi list!
> > 
> >  
> > 
> > I’ve 2 questions:
> > 
> >  
> > 
> > -          How can I create an object in memory without a primary key 
> > and insert it if needed (or not)? (partially answered by my second 
> > question...)
> > 
> > -          How can I insert an object created by a 
> > Class::DBI->search_[METHOD_NAME]?
> > 
> >  
> > 
> > Thanks, Alex
> 
> 
> I think you may want to change your perspective.  When you call ->create 
>   it will create an object in memory and insert a row in the database. 

> You don't have to commit that row if you don't want to.

IE: Turn auto commit off and then commit when you know you want too. 

> 
> Your second question doesn't make sense to me.  If you have values for 
> an object, you create it with ->create, it doesn't matter how you 
> obtained those values
> 

If you get an object via search then it is already in the database. The
question doesn't make sense.  The only thing i can imagine is you are making
rows in one table from a query that gets data from one or more different
tables.  If this is the case you don't use "search_" cause that returns object
and you use the "sql_*" prefix as that gets stament handle so you can get raw
data. Then just pass the data to a create.



=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

(message missing)

create and insert
Hartmaier Alexander 16:00 on 20 Jan 2005

Re: create and insert
Dana Hudes 16:06 on 20 Jan 2005

Re: create and insert
Hartmaier Alexander 16:24 on 20 Jan 2005

Re: create and insert
Jay Strauss 17:45 on 20 Jan 2005

Re: create and insert
Perrin Harkins 18:46 on 20 Jan 2005

Re: create and insert
Jay Strauss 19:33 on 20 Jan 2005

Re: create and insert
Perrin Harkins 19:51 on 20 Jan 2005

Re: create and insert
Jay Strauss 17:39 on 20 Jan 2005

Re: create and insert
Peter Speltz 17:53 on 20 Jan 2005

Re: create and insert
Peter Speltz 18:06 on 20 Jan 2005

Re: create and insert
Hartmaier Alexander 09:40 on 21 Jan 2005

Re: create and insert
Jay Strauss 15:41 on 21 Jan 2005

Re: create and insert
Perrin Harkins 19:35 on 21 Jan 2005

Re: create and insert
Peter Speltz 05:50 on 22 Jan 2005

Re: create and insert
Perrin Harkins 17:19 on 22 Jan 2005

Re: create and insert
Peter Speltz 17:43 on 22 Jan 2005

Re: create and insert
Perrin Harkins 19:09 on 22 Jan 2005

Re: create and insert
Peter Speltz 22:22 on 22 Jan 2005

Re: create and insert
Perrin Harkins 00:18 on 23 Jan 2005

Re: create and insert
Hartmaier Alexander 14:07 on 24 Jan 2005

Re: create and insert
William McKee 16:15 on 24 Jan 2005

Re: create and insert
Peter Speltz 16:28 on 24 Jan 2005

Re: create and insert
Hartmaier Alexander 16:38 on 24 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52