Returns the next HTTP header name.
NEXT_HTTP_HEADER( header-name )
LONG VARCHAR.
This function is used to iterate over the HTTP request headers returning the next HTTP header name. Calling it with NULL causes it to return the name of the first header. Subsequent headers are retrieved by passing the name of the previous header to the function. This function returns NULL when called with the name of the last header, or when not called from a web service.
Calling this function repeatedly returns all the header fields exactly once, but not necessarily in the order they appear in the HTTP request.
The following statement displays the name and values of the HTTP request headers in the database server messages window when used within a stored procedure that is called by an HTTP web service:
BEGIN declare header_name long varchar; declare header_value long varchar; set header_name = NULL; header_loop: LOOP SET header_name = NEXT_HTTP_HEADER( header_name ); IF header_name IS NULL THEN LEAVE header_loop END IF; SET header_value = HTTP_HEADER( header_name ); MESSAGE 'HEADER: ', header_name, '=', header_value TO CONSOLE; END LOOP; END;