0

I tried to insert a sql query using esql code:

INSERT INTO Database.dbo.CUSTOMERS Values (9330,'Sai',7);

It is working fine but it was show error when it tried to insert code using xml format like:

INSERT INTO Database.dbo.CUSTOMERS(ID,NAME,AGE) Values (InputRoot.XMLNSC.emps.emp.id,InputRoot.XMLNSC.emps.emp.name,InputRoot.XMLNSC.emps.emp.age);

Then it was showing errors like BIP2230E, BIP2488E, BIP2321E.

enter image description here

If there is any connectivity problem means first insert command also should not work. Select also working fine.

Any suggestions to resolve problem?

Vladislav Varslavans
  • 2,775
  • 4
  • 18
  • 33
  • Srikanth - Is it a SOAP(WSDL) based call or REST call ? From your snapshot error, it looks like a SOAP call. – Rohan Jan 24 '21 at 00:52
  • Rest only i used http nodes, but i dont know why it was showing in soap format. And my port number also changing automatically.... I am new to this job.. – Srikanth Konduru Jan 24 '21 at 16:54
  • Please use POSTMAN and try. Also, to debug, try to assign values of input XML to variables like SET ID = InputRoot.XMLNSC.emps.emp.id and check if the values are getting assigned to variable or not. Also take advantage of Trace nodes to see how your data looks when it flows through the message flow OR put your flow in debug mode to see the values – Rohan Jan 25 '21 at 04:18
  • @SrikanthKonduru: Please do not use a screen shot for error. Paste the full SOAP fault in plain text to the question. We can not see the complete error. – Daniel Steinmann Jan 25 '21 at 07:46
  • You need to spend more time on your question. The screenshot is useless because the important details are not included in the screenshot. – kimbert Jan 27 '21 at 16:29

1 Answers1

0

It is fairly obvious that your paths (InputRoot.XMLNSC.emps.emp.id, etc ) do not exist under InputRoot.XMLNSC. You could easily check this using the debugger or (better) a Trace node. To fix the problem, correct those paths.

You should also be declaring and using a REFERENCE variable, to make your ESQL more readable:

-- This is not the correct path, otherwise your code would be working already!
DECLARE refEmp REFERENCE to InputRoot.XMLNSC.emps.emp;
INSERT 
    INTO Database.dbo.CUSTOMERS(ID,NAME,AGE) 
    VALUES (refEmp.id,refEmp.name,refEmp.age)

kimbert
  • 2,376
  • 1
  • 10
  • 20