An SQL programmer that I work with is trying to accomplish something in D3 and thought for sure that something he considers so basic isn't available in D3. He wants to select data and direct specified fields to an array. In other words, not deal with re-processing the file by doing a readnext, read record, parse/process those fields. ...
An SQL programmer that I work with is trying to accomplish something in D3 and thought for sure that something he considers so basic isn't available in D3. He wants to select data and direct specified fields to an array. In other words, not deal with re-processing the file by doing a readnext, read record, parse/process those fields.
SQL returns can throw all that into an array that can processed without rereading/reprocessing the selection
Here are 2 examples of executeQuery command in java that returns a ResultSet. The values can be extracted from the result set by column number (the first example below) or by column name (the second example)
Example 1:_______________________________________________________
from http://www.roseindia.net/jsp/execute-sql-query.shtml
** // sql query to retrieve values from the specified table.
** QueryString = "SELECT * from user_master1";
** rs = statement.executeQuery(QueryString);
** while (rs.next()) {
** System.out.println(rs.getInt(1) + " " + rs.getString(2) + " " + rs.getString(3) + " "+rs.getString(4)+"\n");
** }
Example 2:_______________________________________________________
from: http://www.devdaily.com/java/edu/pj/jdbc/jdbc0003
** Statement stmt = conn.createStatement();
** ResultSet rs = stmt.executeQuery("SELECT Lname FROM Customers WHERE Snum = 2001");
** while (rs.next()) {
** String lastName = rs.getString("Lname");
** System.out.println(lastName + "\n");--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
Correction:
This code can be run in the SQLDEMO account that is already in your D3 system:
EXECUTE \SELECT CUSTOMERS CUSTOMERID CITY WITH STATE "OHIO"\ RTNLIST RS
* RS is an array!
FOR N = 1 TO DCOUNT(RS,@AM) STEP 2
CRT RS<N>:" ":RS<N+1>
NEXT N