Method |
DELETE |
Path |
/res/{resName} |
Query Params |
None |
Request body |
One or more rows to delete. |
Request.xsd |
Content-Type: application/xml or application/json |
Response body |
Number of rows deleted. |
Response.xsd |
Content-Type: application/xml or application/json |
Description
Deletes one of the following:
- one or more rows of a flat SQL Resource
- parents and children of a one-to-many hierarchial SQL Resource
- parents and associations to children of a many-to-many hierarchical SQL Resource
- children of a hierarchical SQL Resource
XML Examples
A flat SQL Resource:
DELETE /restsql/res/Actor HTTP/1.1
Content-Type: application/xml
Accept: application/xml
<request>
<actor actor_id="123" first_name="JULIANNE" last_name="DENCH" />
<actor actor_id="124" first_name="SCARLETT" last_name="BENING" />
<actor actor_id="125" first_name="ALBERT" last_name="NOLTE" />
</request>
HTTP/1.1 200 OK
Content-Type: application/xml
<writeResponse rowsAffected="3" />
A delete to parents and children of a one-to-many hierarchical SQL Resource:
DELETE /restsql/res/LanguageFilm HTTP/1.1
Content-Type: application/xml
Accept: application/xml
<request>
<language language_id="2" >
<language language_id="3" />
</request>
HTTP/1.1 200 OK
Content-Type: application/xml
<writeResponse rowsAffected="26" />
A delete to children of a one-to-many hierarchical SQL Resource:
DELETE /restsql/res/LanguageFilm HTTP/1.1
Content-Type: application/xml
Accept: application/xml
<request>
<language language_id="1" >
<film film_id="3" />
<film film_id="43" />
<film film_id="67" />
</language>
<language language_id="2" />
<film film_id="3" />
<film film_id="43" />
</language>
</request>
HTTP/1.1 200 OK
Content-Type: application/xml
<writeResponse rowsAffected="5" />
A delete to parents of a many-to-many hierarchical SQL Resource (parent rows are deleted, and child rows are disassociated):
DELETE /restsql/res/ActorFilm HTTP/1.1
Content-Type: application/xml
Accept: application/xml
<request>
<actor actor_id="123" />
<actor actor_id="124" />
</request>
HTTP/1.1 200 OK
Content-Type: application/xml
<writeResponse rowsAffected="18" />
JSON Examples
A flat SQL Resource:
DELETE /restsql/res/Actor HTTP/1.1
Content-Type: application/json
Accept: application/json
{ "actors": [
{ "actor_id": 123, "first_name": "JULIANNE", "surname": "DENCH" },
{ "actor_id": 124, "first_name": "SCARLETT", "surname": "BENING" },
{ "actor_id": 125, "first_name": "ALBERT", "surname": "NOLTE" }
[
}
HTTP/1.1 200 OK
Content-Type: application/json
{ "rowsAffected": 3 }
A delete to parents and children of a one-to-many hierarchical SQL Resource:
DELETE /restsql/res/LanguageFilm HTTP/1.1
Content-Type: application/json
Accept: application/json
{ "languages": [
{ "language_id": 2 },
{ "language_id": 3 }
[
}
HTTP/1.1 200 OK
Content-Type: application/json
{ "rowsAffected": 26 }
A delete to children of a one-to-many hierarchical SQL Resource:
DELETE /restsql/res/LanguageFilm HTTP/1.1
Content-Type: application/json
Accept: application/json
{ "languages": [
{ "language_id": 1,
"films": [
{ "film_id": 3 },
{ "film_id": 43 },
{ "film_id": 67 }
]
},
{ "language_id": 2
"films": [
{ "film_id": 3 },
{ "film_id": 43 }
]
}
[
}
HTTP/1.1 200 OK
Content-Type: application/json
{ "rowsAffected": 5 }
A delete to parents of a many-to-many hierarchical SQL Resource (parent rows are deleted, and child rows are disassociated):
DELETE /restsql/res/ActorFilm HTTP/1.1
Content-Type: application/json
Accept: application/json
{ "actors": [
{ "actor_id": 123 },
{ "actor_id": 124 }
[
}
HTTP/1.1 200 OK
Content-Type: application/json
{ "rowsAffected": 18 }