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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Select and save records from Oracle database

Level 1
Level 1


I'm trying to use Javascript code to retrieve some specific records from Oracle database.

This is simple LiveCycle pdf form with 2 fields and a Button with attached click event and below code:

var inName = TextField1.rawValue

var nIndex = 0;

while(xfa.sourceSet.nodes.item(nIndex).name != "DataConnection")




var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1); // the node pertaining to the data connection specified


//set up sql call to DB to get specifics about employee

oDB.nodes.item(1).query.setAttribute("text", "commandType");

oDB.nodes.item(1) = "Select * from COUNTRIES where COUNTRY_ID = '" + inName + "'";


//now connect to DB and get a record


So after insert country code in TextField1 and a Button click I obtain corresponding Country_Name in database binded field.

Everything works fine until I try to save the form, after reopen the Country_Name field restores it's default first database record.

I tried to assign the selected record to variable and than use it do write it's value to new static text field, which could be saved, but without success.

The final idea is to open clear or filled previously form insert/reinsert some index and after click find necessary data and save it all, so that when reopened the form is unchanged until next button click.

Any help would be appreciated!



0 Replies