TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Subject:
From:
"Brakewood, Marcus x12479a2" <[log in to unmask]>
Date:
Tue, 25 Apr 2000 15:44:08 -0400
Content-Type:
text/plain
MIME-Version:
1.0
Reply-To:
"Brakewood, Marcus x12479a2" <[log in to unmask]>
Parts/Attachments:
text/plain (35 lines)
I am using the ODBC package by Sune Falck and I am having problems inserting
into my database.  I figured out how to select, there was a select example,
but I did not see any documentation on how to insert, update, etc.

Here is as far as I can get in trying to figure out how to insert:
In the Declare section:

      Dbc  : Connection_Handle;
      --I am not sure how to set up a cursor for an insert command.
      Cur  : Cursor_Type (0, 12);

somewhere after begin:

         --I am not sure if I have to bind input, or something like that?
         --C_ODBCNAME, C_USERNAME, and C_PASSWORD are
        constants and I know that they work
         Connect (Dbc, C_ODBCNAME, C_USERNAME, C_PASSWORD,
        False);
         --Values is a string of the values that I am inserting and I know
that
        the "insert into..." string works because I outputted that string
and
        tried it in an sql manager.
         Open (Cur, Dbc, "insert into cadets values (" & S(Values) & ");",
        Read_Only => False);
         Execute (Cur);
         Close (Cur);
         Disconnect (Dbc);

What am I missing here?  Thanks for any help on this and to Sune Falck for
making this package and to David Wheeler for the CGI package.

Respectfully,
Marcus Brakewood

ATOM RSS1 RSS2