Fetching data from database in case of mixed case in SE37
Hi,
I have created a function module(in se37) where the input is Last name(PA0002-NACHN). My requirement is i have to fetch data from PA0002 based on last name. But the problem is if i give a name in mixed case(both upper and lower) sap converts the last name into Capital letter and starts searching the database.
But i tried in abap editor. here SAP accept the parameter(last name) as mixed case and starts searching. Why in function module the parameters are converted into upper case. How to restrict it.
If i will create a domain with LOWER CASE check box checked and try to call the dataelement in import part of function module then also it's converting it inot upper case. If i uncheck the lower case check box then also it's taking it as upper case.
How to process the input parameter in function module(SE37) which should take the input as user enters,i.e if user enters small letter it should take it as small letter , if mixed letter it should take it as mixed letter and start searching.
regards
sandeep
HI sandeep,
<i>"If i will create a domain with LOWER CASE check box checked and try to call the dataelement in import part of function module then also it's converting it inot upper case. If i uncheck the lower case check box then also it's taking it as upper case."</i>
I think the data is getting converted to upper case even before it is passed to this FM.
Can yo ushow how are you testing this FM?
If you are calling this FM in a abap program using a parameter, it will convert the text to upper case as and when you enter data the name in it.
Regards,
Ravi
Similar Messages
-
How to fetch data from database in javafx 2.2 table which is editable.
Dears!
I want to fetch data from database in javafx 2.2 tableformat with jdbc , which is also editable and i can add more records in this table also.
Can anybody help meI can vaguely recall some sort of JavaFX database connectivity feature, I'm not sure if it's valid anymore.The link is based on JavaFX Composer which only applied to NetBeans 6.9 and JavaFX 1.x (both of which are now dead techs).
There is a good chance you will have to write your own. There are several blogs describing other peoples' work. You could probably use them as a reference.Here is Narayan's basic [url http://blog.ngopal.com.np/2011/10/19/dyanmic-tableview-data-from-database/] tutorial for displaying data from a database in a TableView, you'll need to look elsewhere for the editing portion.
The [url http://docs.oracle.com/javafx/2/ui_controls/table-view.htm]JavaFX TableView tutorial gives info about how to handle edits in a TableView, but you will need to tie the updates back to the database yourself.
It is possible that [url http://www.javafxdata.org/]DataFX may provide some facilities to help support you. -
Swing Applet in JSP: problem with fetching data from database
i am facing a problem while fetching data from database using Swing Applet plugged in a JSP page.
// necessary import statements
public class NewJApplet extends javax.swing.JApplet {
private JLabel jlblNewTitle;
private Vector vec;
public static void main(String[] args) {
JFrame frame = new JFrame();
NewJApplet inst = new NewJApplet();
frame.getContentPane().add(inst);
((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
frame.pack();
frame.setVisible(true);
public NewJApplet() {
super();
initGUI();
private void initGUI() {
try {
this.setSize(542, 701);
this.getContentPane().setLayout(null);
jlblTitle = new JLabel();
this.getContentPane().add(jlblTitle);
jlblTitle.setText("TITLE");
jlblTitle.setBounds(197, 16, 117, 30);
jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
jlblNewTitle = new JLabel();
this.getContentPane().add(jlblNewTitle);
Vector vecTemp = getDBDatum(); // data fetched fm DB r stored here.
jlblNewTitle.setText(vecTemp.get(1).toString());
jlblNewTitle.setBounds(350, 16, 117, 30);
jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));
} catch (Exception e) {
e.printStackTrace();
}//end of initGUI()
private Vector getDBDatum() {
// fetches datum from oracle database and stores it in a vector
return lvecData;
}//end of getDBDatum()
}//end of class
in index.jsp page i have included the following code for calling this applet:
<jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
width="600" height="300">
<jsp:fallback>Could not load applet...</jsp:fallback>
</jsp:plugin>
if i view it in using AppletViewer it runs perfectly and display the data in JLabel. (ie, both jlblTitle and jlblNewTitle).(ie, DATA FETCHES FROM db AND DISPLAYS PROPERLY)
BUT IF I CLICK ON INDEX.JSP, ONLY jlblTitle APPEARS. jlblnNewTitle WILL BE BLANK(this label name is supposed to fetch from database)
EVERY THING IS DISPAYING PROPERLY EXCEPT DATA FROM DATABASE!!!
i signed the applet as follows :
grant {
permission java.security.AllPermission;
Can any body help me to figure out the problem?This is the Swing Applet java code
import java.awt.Dimension;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.JScrollPane;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
public class HaiApplet extends javax.swing.JApplet {
private JLabel jlblTitle;
private JLabel jlblNewTitle;
private Vector vec;
* main method to display this
* JApplet inside a new JFrame.
public static void main(String[] args) {
JFrame frame = new JFrame();
NewJApplet inst = new NewJApplet();
frame.getContentPane().add(inst);
((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
frame.pack();
frame.setVisible(true);
public HaiApplet() {
super();
initGUI();
private void initGUI() {
try {
this.setSize(542, 701);
this.getContentPane().setLayout(null);
jlblTitle = new JLabel();
this.getContentPane().add(jlblTitle);
jlblTitle.setText("OMMS");
jlblTitle.setBounds(197, 16, 117, 30);
jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
jlblTitle.setHorizontalAlignment(SwingConstants.CENTER);
jlblTitle.setForeground(new java.awt.Color(0,128,192));
jlblNewTitle = new JLabel();
this.getContentPane().add(jlblNewTitle);
Vector vecTemp = getDBDatum();
jlblNewTitle.setText(vecTemp.get(1).toString());
jlblNewTitle.setBounds(350, 16, 117, 30);
jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));
} catch (Exception e) {
e.printStackTrace();
}//end of initGUI()
private Vector getDBDatum() {
Vector lvecData = new Vector(10,5);
Connection lcon = null;
Statement lstmt = null;
ResultSet lrsResults = null;
String lstrSQL = null;
String lstrOut = null;
try {
OmmsDBConnect db = new OmmsDBConnect();
lcon = db.connectDb();
lstmt = lcon.createStatement(lrsResults.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
lstrSQL = "select DT_ID from P_DATATABLES";
lrsResults = lstmt.executeQuery(lstrSQL);
int i = 0;
lrsResults.last();
int length = lrsResults.getRow();
System.out.println(length);
lrsResults.beforeFirst();
int recCount = 0;
while (lrsResults.next()) {
recCount++;
lvecData.addElement(new String(lrsResults.getString("DT_ID")));
// System.out.println("ID : " + lrsResults.getString(1));
i++;
}System.out.println("here 3 out fm while");
catch(SQLException e) {
System.out.print("SQLException: ");
System.out.println(e.getMessage());
catch(Exception ex) {
lstrOut = "Exception Occured " + ex.getMessage();
finally {
try {
lrsResults.close();
lstmt.close();
lcon.close();
System.out.println("[DONE]");
catch(Exception e) {
System.out.println(e);
}//end of finally
return lvecData;
}//end of getDBDatum()
}//end of classOfcourse the above code compiles and runs well. in Applet Viewer
I plugged the above Swing Applet in a JSP page index.jsp
<jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
width="600" height="300">
<jsp:fallback>Could not load applet...</jsp:fallback>
</jsp:plugin>Every thing is working fine in AppletViewer...But if i view this in any browser, then only the jlblTitle is displaying. jlblNewTitle is not displaying(this label name is actually fetching from thedatabase)
can any body help me regarding this matter.? Thx in Advance. -
Dynamically fetch data from database and display it in the report
Hi,
We have a requirement in developing a report which needs us to dynamically fetch data from the database and display it in the report.
We have a column called WORKER in the report.
For each worker there is a measure(PSA) associated with it.
In the report we have to display both the WORKER and the PSA column.
What we want is, when we display the list of the workers, the corresponding workerid_id of the worker will be passed and the value of his PSA will be fetched from the database and displayed in the report.
Or anything similar to this.
We also have drill applied on this WORKER column. So after any drill up or drill down also the value for PSA should change.
Is there any way of doing this?
Please help if possible.
Thanks,hi,
data : count type i value 0.
data : Begin of itab occurs 0 ,
plan_version like hrhap-plan_version,
APPRAISAL_ID like hrhap-APPRAISAL_ID,
AP_START_DATE like hrhap-AP_START_DATE,
AP_END_DATE like hrhap-AP_END_DATE,
AP_STATUS like hrhap-AP_STATUS,
AP_STATUS_SUB like hrhap-AP_STATUS_SUB,
OBJ_DATE_SET like hrhap-OBJ_DATE_SET,
REVIEW_DATE_SET like hrhap-REVIEW_DATE_SET,
AP_DATE_SET like hrhap-AP_DATE_SET,
AP_DATE_EARLIEST like hrhap-AP_DATE_EARLIEST,
AP_DATE_LATEST like hrhap-AP_DATE_LATEST,
CHANGE_DATE like hrhap-CHANGE_DATE,
CHANGE_TIME like hrhap-CHANGE_TIME,
CHANGE_USER like hrhap-CHANGE_USER,
end of itab.
<b>select * from hrhap into corresponding fields of table itab.</b>
loop at itab.
write :/ itab-plan_version under 'plan_version',
itab-appraisal_id under 'Appraisal Id',
itab-AP_START_DATE under 'Start Date',
itab-AP_END_DATE under 'End date',
itab-AP_STATUS under 'Status',
itab-AP_STATUS_SUB under 'Substatus',
itab-OBJ_DATE_SET under 'Objective setting date',
itab-REVIEW_DATE_SET under 'Review date set',
itab-AP_DATE_SET under 'appraisal date',
itab-AP_DATE_EARLIEST under 'Earliest appraisal date',
itab-AP_DATE_LATEST under 'Latest Appraisal date',
itab-CHANGE_DATE under 'Change Date',
itab-CHANGE_TIME under 'change time',
itab-CHANGE_user under 'change user'.
count = count + 1.
endloop.
write : 'No of records' ,count.
rgds
anver
if hlped mark points. -
How to fetch data from DataBase using Servlet ?
Hi all,
Till now, i was just sending values from web page and receive the data in excel format using servlets.
But, now, i want to fetch data from data base. I will be giving inputs in the web page(for the query)....ON click of submit button,
Servlet should be called.
Depending on the input, query has to be executed, and response should be sent to the user.
How to do it?
Code
import java.text.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.OutputStream;
/** Simple servlet that reads three parameters from the html
form
public class Fetchdata extends HttpServlet
String query=new String();
String uid="ashvini";
String pwd="******";
try
Connection con=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Testing";
con = DriverManager.getConnection(url, uid, pwd);
Statement s = con.createStatement();
query = "select * from gowri.msllst1";
ResultSet rs = s.executeQuery(query);
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException
response.setContentType("application/vnd.ms-excel");
ServletOutputStream out=response.getOutputStream();
out.println("<HTML>" +"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + title + "</H1>\n" +
"<table>" +" <th>ITEM Code</th>");
while(rs.next())
out.println("<tr><td>" rs.getString(1).trim()"</tr></td>");
}//end of while
out.println("</table></BODY></HTML>");
}//end of doGet method
}catch(Exception e)
System.out.println(e);
It is giving error message as:
C:\Program Files\Apache Tomcat 4.0\webapps\general\srvlt>javac Fetchdata.java
Fetchdata.java:17: illegal start of type
try
^
Fetchdata.java:48: <identifier> expected
^
2 errors
Is this format is correct? am i placing this doGet method at the right place? is my program's logic is correct?
Please help me?
Regards
AShviniThere is some mistakes in ur code.....how can try catch exists outside a function???
make use of try catch isde ur doGet method and put
Connection con=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Testing";
con = DriverManager.getConnection(url, uid, pwd);
Statement s = con.createStatement();
query = "select * from gowri.msllst1";
ResultSet rs = s.executeQuery(query);
isdie doGet method, for the time being,
i think u get me..
regards
shanu -
LabVIEW Memory full while fetching data from database
Hi,
In my program I need to sync some data from client PC as per the selected time frame.
But while fecthing the data from the clinet database, my application is hanging and when I run it with code I get the 'LabVIEW memory full' error message.
Kindly suggest to overcome this problem.Fetching the entire database is probably not a good idea. You should narrow down how much you read at a time.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Database Connectivity Toolset-Fetching Data from Database
Hello guys,
Currently I am doing some applications that include with database manipulation. The data that I am using now coming from Microsoft Access.
My Idea is to fetch the data from the specified table, specified column and specified row.... yeah we could do it using SQL query that we wrote on the Block Diagram...but that will be apply for the one condition that we set.
How about for the next time when we want to pull data from the same database but from different table/column/row using the same application..yeah we have to change the sql query
Why don't we use 'ring' in Front Panel to choose the database we want like to...
example
If we choose
Dominant = Right
Age = 25-34
Sex=Female
Weight= 50-69
Height= 175-184
Then the answer that will come out might be 78 in numeric indicator
So and the next time if I choose
If we choose
Dominant = Left
Age = 25-34
Sex=Male
Weight= 50-69
Height= 175-184
Then the answer will be 77 in numeric indicator...
So...my questions is simple....how to do it....have anyone here try to use ring to make selections in their database
I'll attach my empty applcation so that you all can see the Front Panel...and what exactly my Idea is...
TQ
Attachments:
fetching..vi 19 KBI couldn't look at your VI (7.0), but you can read (and change) the strings in a ring by using a property node.
To create one, right click on the control or the terminal and select Create>>Property Node. Then, click on the property and find Strings[] in the list. This is an array of all the strings in the ring. You can wire it, along with the ring value, into Index Array and you will get the string you chose.
You can now use this string to build your SQL query, no need for numbers and codes.
You can further customize this by using different strings for each field. For example, you can have one ring which will select the field, and based on that, another ring will now have only the values relevant to that field.
You can save these values in an array and that way have an unlimited query.
Correct me if I'm wrong, but don't the DB tools allow you to extract data directly (For instance, the DB Tools Select Data VI)? Shouldn't this allow you to extract all the info you need?
Try to take over the world! -
Long time taken to fetch data from Database Table
Moved to correct forum by moderator.
I had a requirement where i need to fetch records from table A912 for the matching entries in an internal table and satisfying some conditions.
The Internal Table(it_out) has 1,206 entries, while Databse table(A912) has 9,758,234 entries.
The Structure of Internal Table and Select Query are,
TYPES : BEGIN OF ty_a912,
matnr LIKE a912-matnr, "Material
kunwe LIKE a912-kunwe, "Ship-to party
datbi LIKE a912-datbi, "Validity end dt
datab LIKE a912-datab, "Validity start
knumh LIKE a912-knumh, "Cond rec no.
END OF ty_a912.
TYPES : BEGIN OF ty_out,
erdat LIKE vbak-erdat, "Date
vbeln LIKE vbak-vbeln, "Sales document
posnr LIKE vbap-posnr, "Item
kunnr LIKE vbpa-kunnr, "Customer
fkdat LIKE vbkd-fkdat, "Billing Date
ndc LIKE zndc-zndc, "EAN/UPC
matnr LIKE vbap-matnr, "Material
zr00p LIKE konv-kbetr, "ZR00 Price
zcarp LIKE konv-kbetr, "ZCAR Price
zrfcp LIKE konv-kbetr, "ZRFC Price
ctrnr TYPE char80, "Contract#
ctrnm TYPE char80, "Contract Name
a912p TYPE konv-kbetr,
END OF ty_out.
SELECT
matnr kunwe datbi datab knumh
FROM a912
INTO TABLE t_a912
FOR ALL ENTRIES IN t_out
WHERE matnr EQ t_out-matnr
AND kunwe EQ t_out-kunnr
AND datbi GE t_out-fkdat
AND datab LE t_out-fkdat.
It takes very long time to process this select query, is there any alternate way?
Please suggest some valid solution for this issue.
Edited by: Matt on Dec 3, 2008 10:08 AMPrabhakar Manoharan wrote:>
> Moved to correct forum by moderator.
>
> I had a requirement where i need to fetch records from table A912 for the matching entries in an internal table and satisfying some conditions.
> The Internal Table(it_out) has 1,206 entries, while Databse table(A912) has 9,758,234 entries.
>
Hi,
can you give us an SQL trace in ST05? The SQL Trace (ST05) Quick and Easy
The FAE will be processed in a special way: see https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=6630311
If an index is NOT supported the FAE part will take forever...
if t_out is filled by another table you may go for a join? But again, index support is the key
bye
yk
Edited by: YukonKid on Dec 4, 2008 10:31 AM -
How to fetch data from Database using SUP MBOs
I'm learning to develop blackberry apps using SUP.I am new to both blackberry api and SUP.
I need to make a login page for a Student and then validate the username and password entered using data from a database.
I need to check the database for the username and password entered. What should be my next step? How do i get this data from the database. Using findAll() method is not working . Do i need to connect to SCC or unwired server first. If yes , then someone please provide a sample code for it.Hi!, I see your code and I see that you have a fee errors, try to use this:
import java.text.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.OutputStream;
* NOTE: You must put the try-catch and your sql code into the get method
/** Servlet program to take fetchdata from database and display that on the broswer*/
public class Fetchdata
extends HttpServlet {
String query = new String();
String uid = "ashvini";
String pwd = "******";
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, Exception {
try {
Connection con = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Testing";
con = DriverManager.getConnection(url, uid, pwd);
Statement s = con.createStatement();
query = "select * from gowri.msllst1";
ResultSet rs = s.executeQuery(query);
response.setContentType("text/html");
ServletOutputStream out = response.getOutputStream();
out.println("<HTML>" + "<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + title + "</H1>\n" +
"<table>" + " <th>ITEM Code</th>");
while (rs.next()) {
out.println("<tr><td>" + rs.getString(1).trim() + "</td></tr>");//I change </tr></td> for </td></tr>
} //end of while
out.println("</table></BODY></HTML>");
catch (Exception e) {
System.out.println(e);
} //end of doGet method
}I hope this help you :) -
Fxml ComboBox created in scene builder how to fetch data from database
Hi Sir, How r u? Hope to be fine. Sir, I have a problem that i want to fetch data in fxml comboBox created in Scene Builder?
I have used this code in JavaFx 2.0 for comboBox and textField the code is
ComboBox studentRegId = new ComboBox();
try{
stm = db.con.createStatement();
rs = stm.executeQuery("select * from students order by s_reg_id asc");
while(rs.next()){
for(int i=1; i<=1; i++)
studentRegId.getItems().add(rs.getString("s_reg_id"));
}catch(SQLException sqlException){
final TextField sRegId = new TextField();
final String regId[] = new String[1000];
try{
stm = db.con.createStatement();
rs = stm.executeQuery("select * from students order by s_reg_id asc");
int a = 0;
while(rs.next()) {
regId[a] = rs.getString("s_reg_id");
a++; }
}catch(SQLException sqlException){
studentRegId.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>(){
public void changed(ObservableValue ov,Number value, Number new_value){
sRegId.setText(regId[new_value.intValue()]);
Now, the problem is that I want to use this code in Scene Builder fxml ComboBox .
Please Help Me!
I shall be very grate full to you for this kindness.
RegardsHi,
Ok, so you create your FXML :
Add a controller property to your root control. (See Code tab in SceneBuilder or direcly in FXML : fx:controller tag)
Add a fx:id to your controls (your combobox) (First property in SceneBuilder or directly in FXML : fx:id)
Example :
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<HBox prefHeight="-1.0" prefWidth="-1.0" xmlns:fx="http://javafx.com/fxml" fx:controller="org.lgringo.comboexample.Controler">
<children>
<TextField fx:id="text" prefWidth="100.0" />
<ComboBox fx:id="combo" prefWidth="200.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="Item 1" />
<String fx:value="Item 2" />
<String fx:value="Item 3" />
</FXCollections>
</items>
</ComboBox>
</children>
</HBox>Then, you create your Controler class using @FXML annotation (name of control should be the name of fx:id properties)
You can do some initialisation in the inherit method "initialize"
Example :
package org.lgringo.comboexample;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
public class Controler {
@FXML
// fx:id="combo"
private ComboBox<String> combo; // Value injected by FXMLLoader
@FXML
// fx:id="text"
private TextField text; // Value injected by FXMLLoader
@FXML // This method is called by the FXMLLoader when initialization is complete
void initialize() {
assert combo != null : "fx:id=\"combo\" was not injected: check your FXML file 'ComboboxExample.fxml'.";
assert text != null : "fx:id=\"text\" was not injected: check your FXML file 'ComboboxExample.fxml'.";
// Initialize your logic here: all @FXML variables will have been injected
combo.getItems().clear();
combo.getItems().addAll("John Lennon","Mick Jagger","David Bowie");
combo.getItems().add("Others...");
text.setText("List : ");
}Then you use the FXMLLoader class to load your FXML and Controler.
Example :
package org.lgringo.comboexample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class App extends Application {
* @param args
public static void main(String[] args) {
App.launch(args);
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("ComboboxExample.fxml"));
primaryStage.setTitle("Combo Example");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}More info : http://docs.oracle.com/javafx/2/get_started/fxml_tutorial.htm -
Fetch Data from Database using JSP
Dear friends,
I am developing a portal for my College. The theme is to automate student details.
Here i have Screens for Posting, Editing , Viewing.
In Editing: I fetch the data from the backend using select query.
In the address field: I have value as "Big House".
The user keyed with double quotes when he keyed.
During extraction of the data i put the value inside a textbox as
<input type=text name=st1 value="<%=res.getString("street1")%>">
Here,
the value becomes as
<input type=text name=st1 value=""Big House "">
Here, you can notice that Big house i prefixed by double -double quotes.
The value should be Big House but the values is empty.
What i should. ???
Thanks in Advance.
Rengaraj.RTry this:
<%
String addr = res.getString("street1");
//escape the double quotes from the address
addr = addr.replaceAll("[\"]",""");
%>
<input type="text" name="st1" value="<%=addr%>"> -
i use this sentence to get the data from my database, "select * from datalogging WHERE datalogging.utctstamp>15684000&datalogging.utctstamp<15686000", i insert this sentence into labview DB tool execute query module and then use DB tool Fetchl recordset module from labview to get the data, however, the labview wait infinite time and then crashed.
can somebody help me?
Attachments:
databankread.vi 26 KBHi,
I think the first sub-vi returns an error (Open connection).
There are 2 ways to connect to a database :
The easyest is to use a .udl file (search on your hard drive C:\, you will find a Labview.udl) This file will help you to connect you to database : there is a button to test connection, ant if this doen's success, it's useless to continue with labview... When ot works, link the path of this udl to the vi connecting to database.
The second way is to use a connection string (try to search SQL connection string on forum, you will find what it looks like), but I don't think omnihpposa is a good connection string.
Just an advice : when you use local variables (such as decimal integer string), you doen't assure data flow : your second query (datalogging) will execute with parameters of the previous recorset of the other database...
Best regards,
V-F -
Using a paramter to fetch data from database
Hello SAP,
Is there a way to use a parameter that takes in the employee ID and have it fetch from the database the employee name. Just to note, the tables that I am using in this report do not link to the employee table that contains the employee name. I just want to be able to use a parameter that can fetch me the name from the database dynamically so that it prints in the report header.
Is this possible?
Thanks in advance,
ZThanks for your responses all.
I tried what you've recommended. I tried but it didn't seem to work. Perhaps I misunderstood so please let me know if I did. I'll elaborate a bit more of what I'm looking to achieve.
I have a report that gives information that pertains to an employee. The three tables in the report have no reference to the employee table (meaning I cannot link the Emp ID field to any field of the three tables). We as the firm know based on coding within the three tables which employee the records within the report beloing to.
So basically, I want to be able to display the employee's full name in the Report Header by using a parameter. I want to enter the employee ID in the parameter field and have it display the employee name in the report header.
I tried to insert the Employee table in my report as the only "unlinked" table in my report. I tried to create a formula as:
@Employee Name
if {?Emp ID} = {Employee table. Emp ID} then
{Employee Name}
This resulted in as a null value when I inserted it into the report header.
I also tried creating a formula as such:
@Employee Name (2nd)
BeforeReadingRecords;
Global StringVar FullName;
if {?Emp ID} = {Employee table. Emp ID} then
FullName:={Employee Name};
This did not work either as the error message stated the field {Employee table.Emp ID} must be evaluated later.
If I'm heading in the wrong direction can someone steer me back into the right direction?
Sastry, if I need to use the Add Command feature to fetch the data, is there a way to dynamically insert the parameter value in the SQL so that only the record that you want to be brought back into your report comes back?
Thanks again to all!
Z
Edited by: Zack H on Jan 19, 2009 8:34 PM -
How to fetch latest data from database instead of clicking on Generate report in RSRT?
Hi all,
We are not able to get latest data of BEx query.Everytime we have to click on Generate Report button in RSRT for getting latest value.
Is there any way to get latest value automatically? We are not doing any changes in query.
When we click on Generate Report it is fetching data from Database instead of cache,so if it is possible to disable cache or any other workaround?
We have used time(0TIME) characteristic in query as a formula variable. We have applied a condition on that variable to fetch the first record (latest value). When we click on generate report, it fetches correct value with latest time but when we run the query without generate report, it is not fetching latest value. The cube on which this query is developed, is a realtime cube.
Regards,
ZalakOnce its in the request attributes it would be far better to use JSP Expression Language as well as the JSTL that Malcolm suggested So if the servlet code said:
request.setAttribute("myList", al);Then using EL and the JSTL tags from <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> the JSP would look something like:
<c:forEach items="${myList}" var="user">
<TR>
<TD><c:out value="${user.name}" /></TD>
<TD><c:out value="${user.fname}" /></TD>
<TD><c:out value="${user.city}" /></TD>
<TD><c:out value="${user.cont}" /></TD>
<TD><c:out value="${user.age}" /></TD>
</TR>
</c:forEach> -
FETCHING DATA FROM A TABLE USING ARRAYLIST
how can we fetch data from database using arraylist????
Hi ,
This is the way to fetch data into 2d array , you can customize to fetch in array list .
we will assume that we have stm as Statement and rs as ResultSet
rs = stm.executeQuery("select * from emp");
int noOfColumns = rs.getMetaData.getColumnCount();
rs.last();
int noOfRows = rs.getRow;
rs.befpreFirst();
String [][] result = new String[noOfRows][noOfColumns];
for(int i = 0 ; i<noOfColumns;i++){
rs.next();
for(int y = 0;y<noOfColumns;y++){
result[i][y]=rs.getString(y+1);
rs.close;
Maybe you are looking for
-
How to create a certificate using keytool / terminal?
I have problems with creating certificates using the terminal. I use the instructions below and typed in all the required information. When it asks me to type "yes" and confirm, the whole process just starts from the beginning over and over and I hav
-
Changing audio file locations within I-tunes
How can I move files out of the music folder and into the audio books folder within the library? Specifically, I purchased several MLK and JFK speech files. Most appear in the music list, although a couple appear in the audiobook list. I would like t
-
Front Row has ALL video files in "Movies" list. WHY?
This is ridiculous! I have never had this problem before, but now it is out of hand. In Front Row under the "Movies" list, along with the movies that I have purchased from the iTunes store, every single video help file from various applications on my
-
Dynamically change the value in standard text
Hi all, I have created standard text using SO10 transaction. I have included the text id in SAP FORM. My requirement is some text need to change dynamically in the text when printing the form.Is there any way to do it. Thanks Suadrsana
-
I got a used iphone 4s from a pawn shop and I cant activate it because I dont have the past owners icloud info is there anyway to unlock it and put in my information?