Thread

  1. Extending SQL with a C function

    Christoph Lorenz <chlorenz@csi.com> — 1998-05-22T09:59:48Z

    Hi,
    
    how can I write a SQL extention in C, which works with "unusual" data
    types?
    
    I've managed to write a c function, which accepts int4 as input parameter
    and has got int4 as output parameter.
    
    My problem now is, that I want to use a char(10) as input parameter, since
    the input for that function is a colum, which is a char(10) type.
    How do I do this?
    
    (In the manuals, it is said, one should create an own data type in C - I've
    already done this, called it "char10", but of course, I cannot use this
    data type in SQL...)
    
    Thank you very much
      Christoph
    -- 
    ** http://ourworld.compuserve.com/homepages/ChLorenz/ ** ChLorenz@csi.com **
     ** No Spam ! ** No Adverts ! ** No Junk-Mails ! ** No unwanted Mails ! **
    
    
    
    
    
  2. Again: [GENERAL] Extending SQL with a C function

    Christoph Lorenz <chlorenz@csi.com> — 1998-06-02T08:26:49Z

    Hi,
    
    I still haven't found it out, so here's my question again:
    
    > how can I write a SQL extention in C, which works with "unusual" data
    > types?
    > 
    > I've managed to write a c function, which accepts int4 as input parameter
    > and has got int4 as output parameter.
    > 
    > My problem now is, that I want to use a char(10) as input parameter, since
    > the input for that function is a colum, which is a char(10) type.
    > How do I do this?
    > 
    > (In the manuals, it is said, one should create an own data type in C - I've
    > already done this, called it "char10", but of course, I cannot use this
    > data type in SQL...)
    > 
    Thank you very much 
      Christoph
    -- 
    ** http://ourworld.compuserve.com/homepages/ChLorenz/ ** ChLorenz@csi.com **
     ** No Spam ! ** No Adverts ! ** No Junk-Mails ! ** No unwanted Mails ! **
    
    
    
    
    
  3. Re: Again: [GENERAL] Extending SQL with a C function

    Herouth Maoz <herouth@oumail.openu.ac.il> — 1998-06-02T08:50:17Z

    At 11:26 +0300 on 2/6/98, Christoph Lorenz wrote:
    
    
    > > how can I write a SQL extention in C, which works with "unusual" data
    > > types?
    > >
    > > I've managed to write a c function, which accepts int4 as input parameter
    > > and has got int4 as output parameter.
    > >
    > > My problem now is, that I want to use a char(10) as input parameter, since
    > > the input for that function is a colum, which is a char(10) type.
    > > How do I do this?
    > >
    > > (In the manuals, it is said, one should create an own data type in C - I've
    > > already done this, called it "char10", but of course, I cannot use this
    > > data type in SQL...)
    
    char(10) is not, in fact, an "unusual" datatype. It's what postgres calls
    "bpchar" (blank-padded char). I think there is an interface for dealing
    with bpchar fields, which carry their own maximum length which you have to
    decode before using.
    
    Herouth
    
    --
    Herouth Maoz, Internet developer.
    Open University of Israel - Telem project
    http://telem.openu.ac.il/~herutma