[freeside] Custom Import Script (custnum)

ivan ivan at 420.am
Fri May 18 18:58:13 PDT 2001


Freeside doesn't currently use the database auto-increment features; it
keeps it's own counters in the filesystem for this.  Just insert your data
using the API documented in the FS::cust_main manpage, etc., and Freeside
will take care of the primary keys. 

On Fri, May 18, 2001 at 03:50:31PM -0700, Wes Weems wrote:
> Ok,
> 
> A little history, I work for an existing ISP using some fairly decrepid
> accounting software. We've FINALLY decided to move away from that, to
> something much better (kudos to ivan). Between my co-workers, and I, we've
> come up with a script that will insert the services (more or less what the
> import script Ivan wrote that parses up the passwd file). In addition to
> that, we've got it pulling name/address/billing info, and are ready to
> insert that into cust_main. My question is this:
> 
> I dont wanna corrupt data... and I can see custnum is a pkey, however, as
> I've noticed as per the database itself, there is no auto incrementation. I
> wanted to loop through this list inserting data into cust_main inserting
> data.
> 
> I looked at Record.pm and cust_main.cgi, but as of yet, I havent seen where
> the actual sql statements are issued for that (to see how ivan accomplished
> this feat). I suspect its using a nextval statement, but as I said, I'd like
> to avoid corruption as much as possible.
> 
> THanks so much
> Wes Weems
> 
> Network Operations Engineer
> The Fix Network.
> 

-- 
meow
_ivan



More information about the freeside-users mailing list