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?

5
  • Srikanth - Is it a SOAP(WSDL) based call or REST call ? From your snapshot error, it looks like a SOAP call. Commented Jan 24, 2021 at 0: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.. Commented Jan 24, 2021 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 Commented Jan 25, 2021 at 4: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. Commented Jan 25, 2021 at 7:46
  • You need to spend more time on your question. The screenshot is useless because the important details are not included in the screenshot. Commented Jan 27, 2021 at 16:29

1 Answer 1

-1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.