[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Sheflug] sybase, anyone?



Thanks to many of you for general helpfulness.  Sounds like I'm going to
have to get technical:

The sybase database is part of a 3rd party product.  As such, the
manufacturers only let us mess with their database by using their own
Special Procedures (a Sybase technical term).  Basically, by using this set
of (documented), precompiled, embedded SQL calls , we ensure that data is
checked before its imported, and that the integrity of the database is
maintained.

So we have to call the SPs, which rules out bcp I think, and possibly some
of your other ideas (?).  I'm using C because the only sure way I know how
to call their SPs is by copying the single example code from their manual,
which is in C.  It uses the Open Client DB library (not the CT one, which i
*think* may rule out python). Believe me I wish I could use a higher level
language.  I know a bit about SybPerl, but suspect it won't help with my
specific problem....with me so far?....

Specifically, my problems are to do with timestamps.  I don't know if these
are a generally used sybase thing or whether they're specific to our
database.  Basically, before you are allowed to call a procedure which puts
stuff into the database, you have to call a procedure which pulls a row of
data off the table you're dealing with.  This row will contain a
'timestamp'.  If when you call the SP for putting you don't use the exact
same 'timestamp' value, the SP will refuse to allow you to update the table.
Fair enough...stops people overwriting data accidentally when somone else
has just updated it.

Even more specifically, these timestamp things seem to be binary numbers,
and I'm not sure exactly how to handle them within C.  However I declare
them, the 'put' SP calls don't accept the update.

If anyone's still with me, I could show them some code to shed a bit more
light.  As I say, I have no idea whether this [timestamp] is a commonly used
technique within Sybase in which case some of you good people might be able
to help, or whether its something specific to our system.

ta,

Steve

> -----Original Message-----
> From: David Holden [mailto:dh [at] iucr.org]
> Sent: 14 May 2002 14:31
> To: shef-lug [at] list.sheflug.org.uk
> Subject: Re: [Sheflug] sybase, anyone?
> 
> 
> If your going to do it in a language that your new to, I 
> would do it in 
> a higher level language, e.g. perl, it has a interface to 
> sybase I think.
> 
>   dave.
> 
> 
> 
> stephen.tozer-loft [at] sth.nhs.uk wrote:
> > hello sheflug
> > 
> > only found out about you lot last week having bought 'linux 
> magazine' for a
> > long train journey.
> > 
> > i'm a physicist at weston park hospital, and, though a 
> relative newbie to
> > linux, have taken on a big project.
> > 
> > this is just on the offchance that someone out there has 
> the relevant skills
> > and wouldn't mind exchanging a few emails to get me going.
> > 
> > i've got redhat 7.1 going on a nice dell poweredge server.
> > i'm writing in C (which I'm new to) trying to get data from 
> a flat ASCII
> > file into a big sybase database, by calling special 
> procedures (from a 3rd
> > party manufacturer) using the sybase Open DB library.  
> > 
> > Is this anyone's bread and butter in sheffield?
> > 
> > thanks anyway, i know its a long shot...
> > 
> > steve
> > 
> > ____________________________________________
> > Dr. Stephen Tozer-Loft
> > Principal Radiotherapy Physicist
> > Medical Physics Department
> > Weston Park Hospital
> > Witham Road
> > Sheffield S10 2SJ
> > 
> > Tel: +44 (0)114 226 5174    Fax: +44 (0)114 226 5521
> > http://www.shef.ac.uk/training/irps
> > 
> >  
> >  
> > ___________________________________________________________________
> > 
> > Sheffield Linux User's Group -
> > http://www.sheflug.co.uk/mailfaq.html
> > 
> >   GNU the choice of a complete generation.
> > 
> 
> 
> -- 
> Dr. David Holden. (Systems Developer)
> check-out : crystallography journals online <http://journals.iucr.org>
> 
> Thanks in advance:-
> Please avoid sending me Word or PowerPoint attachments.
> See: <http://www.fsf.org/philosophy/no-word-attachments.html>
> 
> Personal Links:-
> Recommended reading : http://www.oreilly.com/catalog/dbnationtp/
> UK Privacy (R.I.P)  : http://www.stand.org.uk/commentary.php3
> Public GPG key available on request.
> --------------------
> 
> ___________________________________________________________________
> 
> Sheffield Linux User's Group -
> http://www.sheflug.co.uk/mailfaq.html
> 
>   GNU the choice of a complete generation.
> 
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.