Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Storing and retrieving an xml variable in DB

Avatar

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

28-05-2008

Hi all,



I am having some trouble storing and retrieving an xml variable in a custom DB. Can it be done via the jdbc-services or do I need to create some custom code which I call in an execute script?



In either case, how?



Thanks in advance



Sincerely

Kim Christensen

Replies

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

28-05-2008

"Can it be done via the jdbc-services?"

Yes



You might want to store it in a String variable if you run into problem with the XML.



Jasmin

Avatar

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

28-05-2008

Ok, thanks alot...



I just had the problem that I didn't get any data inserted in the database.



I have set up the execute sql service to the following:



SQL Statement:



insert into table1 values({$ /process_data/@id $}, '{$ /process_data/formdata $}')



This inserts the processInstanceID in the DB but no data is inserted. I have also tried:



insert into table1 values({$ /process_data/@id $}, {$ /process_data/formdata $}) (without the quotes (' and '))



But this time the server gets an exception parsing the xml.



How should I set up the SQL statement to insert my xml-variable "formdata" into the DB?



Thank you in advance



Sincerely

Kim Christensen

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

28-05-2008

That is because you are not referencing your form data correctly. How is formdata defined? Are you doing this from a submitted form (through workspace)?

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

28-05-2008

You might have to convert it into a string.



Use the function serialize(/process_data/formdata) to have a string representation of you XML.



Jasmin

Avatar

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

28-05-2008

The form is submitted by email and the process is kicked of by an email endpoint. How should I reference my formdata variable?



\Kim

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

28-05-2008

What is the variable type tha is recieving the submitted data? XML?

Avatar

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

05-09-2008

Sorry for the late post - I got it working at last but just inserting the xml as a string into the db



Kim