in reply to Maintaining state through storable.pm?
#Freeze the object my $data = eval { unpack ('h*', Storable::nfreeze($object))} ; # ORACLE SPECIFIC # create a hash containing specifying to Oracle what # sort of data it will need to store. 112 is the value # for a CLOB, 113 is the value for a BLOB. # FIXME: make this a BLOB when DBD::Oracle supports that my %hash = (ora_types => 112, ora_field => 'data'); # END ORACLE # insert our values into the table my $query = "INSERT INTO $table (jobID, data) VALUES ('$jid','$data')" +; $db_handle->execute($query, \%hash); # To thaw (after retrieving from the DB) my $object = eval { Storable::thaw(pack('h*',$data)) }
This may not be the best for your situation, especially since others have suggested off the shelf solutions that appear to address your needs, but this approach does work.
Update: perrin++. I came up with this scheme in early '00, and at that time BLOBS weren't implemented, or at least not in the version of DBD::Oracle we were using. I guess now I can go back and fix the FIXME's :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Maintaining state through storable.pm?
by perrin (Chancellor) on Jun 26, 2002 at 07:21 UTC | |
|
Re: Re: Maintaining state through storable.pm?
by redsquirrel (Hermit) on Jun 27, 2002 at 16:26 UTC |