2008 Feb 22 3:55 AM
Dear Experts,
What is the differnce b/w the INSERT, MODIFY, UPDATE ?
Thanx,
Sridhar.
2008 Feb 22 4:21 AM
Hi,
Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows
1:INSERT: Adding Lines to Database Tables
2:UPDATE: Changing Lines in Database Tables
3:MODIFY: Adding or Changing Lines
1:Insert statement
INSERT statement inserts a single record into the database table.
Syntax
Tables: sflight.
Sflight-carrid = LH.
Sflight-connid = 234.
Insert sflight.
Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.
2:Update statement
To update database table UPDATE statement is used. This allows you to change either a single record or several records.
You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the
3:MODIFY statement.
The MODIFY statement changes existing lines and inserts lines which do not exist.
Sflight-carrid = MN.
Sflight-connid = 454.
UPDATE SFLIGHT where CARRID = LH.
Or
TABLES SFLIGHT.
UPDATE SFLIGHT SET PRICE = 1100
WHERE CARRID = LH.
Here price of sflight will get updated with new price 1100.
Regards
Fareedas
Hi,
Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows
1:INSERT: Adding Lines to Database Tables
2:UPDATE: Changing Lines in Database Tables
3:MODIFY: Adding or Changing Lines
1:Insert statement
INSERT statement inserts a single record into the database table.
Syntax
Tables: sflight.
Sflight-carrid = LH.
Sflight-connid = 234.
Insert sflight.
Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.
2:Update statement
To update database table UPDATE statement is used. This allows you to change either a single record or several records.
You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the
3:MODIFY statement.
The MODIFY statement changes existing lines and inserts lines which do not exist.
Sflight-carrid = MN.
Sflight-connid = 454.
UPDATE SFLIGHT where CARRID = LH.
Or
TABLES SFLIGHT.
UPDATE SFLIGHT SET PRICE = 1100
WHERE CARRID = LH.
Here price of sflight will get updated with new price 1100.
Regards
Fareedas
2008 Feb 22 4:21 AM
Hi,
Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows
1:INSERT: Adding Lines to Database Tables
2:UPDATE: Changing Lines in Database Tables
3:MODIFY: Adding or Changing Lines
1:Insert statement
INSERT statement inserts a single record into the database table.
Syntax
Tables: sflight.
Sflight-carrid = LH.
Sflight-connid = 234.
Insert sflight.
Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.
2:Update statement
To update database table UPDATE statement is used. This allows you to change either a single record or several records.
You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the
3:MODIFY statement.
The MODIFY statement changes existing lines and inserts lines which do not exist.
Sflight-carrid = MN.
Sflight-connid = 454.
UPDATE SFLIGHT where CARRID = LH.
Or
TABLES SFLIGHT.
UPDATE SFLIGHT SET PRICE = 1100
WHERE CARRID = LH.
Here price of sflight will get updated with new price 1100.
Regards
Fareedas
2008 Feb 22 4:25 AM
Hi
UPDATE updates the existing record
MODIFY updates the existing record if record not found it creates new record
INSERT insert new record between existing records
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |