This is very straight forward with limitations. You need to have at least CRA enhanced licenses to query databases (Standard won't do it).
You will first need to set up the "Database" on the CRA server (data sources,system DSN). Then you will need to set it up in the CRA application (subsystems,Database). Note: Names must match identically (DSN/database name)
In the script editor, start with:
DB READ and enter the the SQL statment.
Note: Don't have full functionality of SQL (no count is biggest).
Under successful, add DB Get
Note: You will need to have variables for every field you plan to retrieve and every record. The field types must match exactly. It took me a little bit of time for some field types because I had to create them by using java."whatever"."whatever"
Under each successful, you will need to put a new DB Get for the next returned row. There are other, better ways, but I needed to have all data in all rows get returned.
After that, you should have a DB Release.
For the java question, there are various ways to do that. Look in the sample scripts for ideas.
I would recommend upgrading to 4.0 due to the Java supported code changes.
Remember, that version 3.5 of IPCC uses Jave version 1.1.8 so only the java types that are supported in this version will work. I am not a Java programmer either and had to look at the datatype in the database to know what to create the variable in CRA. Almost all data types were already in CRA, except for:
Date of birth field in database was:
If you download the help file jdk1.1.8 from the Internet you can view the list of supported types. I haven't worked much with arrays in Java and realized quickly that jdk1.1.8 was real limiting. If you go to version 4.0,you will be on a newer version of java (can't remember which version) and will have more supported data types and functions. It was a little trial and error when trying to pull the data from the database. Kept getting not valid datatype or something like that. I had to keep trying different variables with different datatypes before I hit the correct one. There is probably an easier way, but I am lacking the skills.
I had to take the DOB field from the timestamp type convert it to characters, then convert to a string in the way I wanted it to be viewed (real pain). I created a subscript to do this so I can call it from any new script that I create.
You may want to take a Cisco class CIPX. This class went through what you are trying to accomplish and if you are going to be doing any kind of longer term scripting, would be beneficial.
This document is an early notification of a behaviour change that will be introduced in IOS XR release 6.5.
IOS XR configuration principles relevant for this article are:
On router platforms all interfaces must be by defaul...
With XR 4.2.0 the ASR9000 is releasing a new line of hardware models. This amongst others is the RSP440, the next generation RSP with faster switch fabric along with Typhoon based Linecards, the next generation network processor.
The Cisco EPN system incorporates a network architecture designed to consolidate multiples services on a single Multiprotocol Label Switching (MPLS) transport network. This network is designed primarily based on Application ...