Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in August and this forum will be retired.

hey there,

I'm trying to make a http get call from within an after insert trigger by using a stored procedure.

All I can get is an error message

Here is my procedure

ALTER PROCEDURE "dba"."push_dcn"(IN reqid VARCHAR(4), msgid INTEGER)
url 'http://win-utt00kfdfei:8000/dcn/DCNServlet?cmd=wf&security=admin&domain=default&username=supAdmin&password=s3pAdmin&domain=default&package=vacationrequest:1.0&dcn_request={%22op%22:%22:upsert%22,%22id%22:%22!msgid%22,%22to%22:%22supAdmin%22,%22subject%22:%22New%20Vacation%20Request%20%28ID_!reqid%29%22,%22from%22:%22supAdmin%22,%22body%22:%22%22,%22received%22:%222012-07-12T10:07:45+05:00%22,%22read%22:false,%22priority%22:true}' 
type 'HTTP:GET';

And this is my trigger

ALTER TRIGGER "VacationReqTrigger" after INSERT
ON "dba"."VacationRequests"
for each row

CALL "dba"."push_dcn"("reqid" = '100',"msgid" = 2221);


asked 12 Jul '12, 09:46

MartinKraemer's gravatar image

accept rate: 0%

edited 15 Mar '13, 19:49

Mark%20Culp's gravatar image

Mark Culp

I think you need to do something with the result set returned by the procedure call; e.g., SELECT ... FROM push_dcn ( ... ).

See the page 19 in this Techwave presentation:


TYPE attribute: ‘HTTP’, ‘HTTP:GET’, or ‘HTTP:POST’

Function variant

returns the body of the HTTP response

Procedure variant

returns all relevant information, including headers, from the HTTP response as attribute/value pairs in a two-column result set

HTTP status and HTTP body are returned as “Body” and “Status” attributes

Also see this:

For these and other FABULOUS documents, do a search from this page:

permanent link

answered 12 Jul '12, 10:52

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

edited 12 Jul '12, 10:58


i've exact the same problem by trying to do a CALL "http_procedure" on an trigger.

Your solution with

SELECT * FROM "dba"."push_dcn"("reqid" = '100',"msgid" = 2221);


SELECT  "Body" FROM "dba"."push_dcn"("reqid" = '100',"msgid" = 2221);

doesn't work for me as well. the error code i get is 946 (see: Any thoughts on that?

Or is this generally a bad idea to do an http call within a trigger, and do it some other way?

thx in advance! Mario

permanent link

answered 13 Jun '13, 07:14

Mario%20David's gravatar image

Mario David
accept rate: 0%

As Breck has indicated, your trigger cannot generate a result set - you need to consume the result set generated by the procedure call so that it does not propagate from the trigger into the statement context that caused the trigger to be called.

For example:

  INTO #temp
  FROM "dba"."push_dcn"("reqid" = '100',"msgid" = 2221);

This stores the result set from the call to push_dcn into the (automatically generated) temporary table #temp.

(13 Jun '13, 08:35) Mark Culp

ahh, i see - thanks! in the meantime i read the above mentioned artice: where it is done like this: SET xmlResult = (SELECT C2 From sp_GetQuoteYahoo() with (C1 long varchar,C2 long varchar) WHERE C1 = 'Body');

this works out for me as well.


(14 Jun '13, 02:18) Mario David
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Jul '12, 09:46

question was seen: 5,976 times

last updated: 14 Jun '13, 02:18