/ ITC Help System
/ Site map
/ NM Tech homepage
Inserting data in specific Sybase columns
At the end of each command press the space-bar or press enter
before continuing the next step.
- To add data in specific columns of your table, type
- Type the name of the table you are entering data into.
- Now you have to tell the server what columns you are entering
data for. These columns need to be grouped by parenthesis, and
if there is more than one, separated by commas.
- To start the grouping, type
- Type the first column name, followed by a comma, then any other
column names, each separated by a comma.
to close the group.
- Since you are entering data for at least one column, the
data needs to be grouped and each value needs to be separate. To
group the values, you enclose them in parenthesis. To separate
them, you use commas.
If you have special characters to enter as values into your tables
(that includes % _ , ( ) < > . : = + - * / ' " and the space
character) you must quote the value. To do that, enclose the value
between single close quotes. For instance, to use fifteen percent,
you would type '15%' To get a ' character, you type it twice.
For example 'it''s' would enter the contraction for ``it is''
as a value.
- To begin the group, type
- Type the data for the first column, followed by a comma, then
the data for the second column, followed by a comma, until you
have values for all the columns. Make sure you enter the data
in the same order as you named the columns above.
- Close the group by typing
- Press Enter.
If everything goes well, you see
(1 row affected)
then the database prompt (a period, the name of the database you
are using, another period, the number one and then the greater
If you see
Msg 102, Level 15, State 1
Server '', Line 1
Incorrect syntax near '89'.
you could have done a lot of things wrong. You could have
entered data that is not the correct type for a column (text in
an integer field for example). You could have used more values
than you have columns. You could have used fewer values than
columns. You could have forgotten the commas. Take a close look
at your insert statement and compare it to your table structure.
When you figure out what went wrong, try it again. This type of
error, which I think is the most likely error to be made, has the
least helpful error code in the entire program.
If you type the data in the wrong order (for instance, putting
a name in a city column) Sybase will not give you an error, but
you will be surprised when you look at the data later because
everything will be wrong. Be very careful. This is a very
common human error that can be very difficult to avoid. When you
have entered data, double-check it by searching the database for
your entries. If you can't find the entry you are searching for,
or there is incorrect data, you can correct it. If you don't do
this, your searches will return incorrect data.
Next: Modifying data in a Sybase column
See also: Adding and modifying data in Sybase
Previous: Example of adding data in Sybase
to help pages
New Mexico Tech Information Technology and Communications: Help System
To report a problem: File a ticket
Send mail to the User consultant
on duty or call them at 575-835-5437
About New Mexico Tech
Maintained by John Shipman, email@example.com;
original by Steve Anderson
Last updated: 1997/06/23 23:05:38 UT