Query SQL from LabVIEW
I would like to get the serial number of a part just being tested. This info is stored in a SQL database. The info I got from the database administrator is as follows.
Host: partdb.mlp.abcd.comPort: 1433 Database Name: part
Read Only User Id: yyyy
Password: xxxx
Example query for engine serial number between certain time period: select *from tdheader h inner join tdstage son h.s_sno = s.s_snowhere h.testCellNo = 5and h.endTime between '3-15-2010 7:00:00' and '3-15-2010 8:00:00'
How do I query the database from LabVIEW? Thanks.
Ian
Example query for engine serial number between certain time period:
select *
from tdheader h inner join tdstage s
on h.s_sno = s.s_sno
where h.testCellNo = 5
and h.endTime between '3-15-2010 7:00:00' and '3-15-2010 8:00:00'
Similar Messages
-
Submit Query(SQL) from a text area from a form
Hi,
I have a form that has a big text area, while users can type in the SQL statement/query.
When user click on the button(say Submit). He/She should able to use the SQL query they input to query the tables.
In order to implement this, should I create a new page that will pass the value of the text area (SQL statement) and display it in that new page?
Or Is there a quick/easier way to do this?
Thanks,
AngelaAngela,
You could create a report region of type PL/SQL function returning SQL querry, and then return the value of your text area item, so you region source would be something like this:
return :PX_MY_QUERY;
When creating that report region, you'll have to use generic column names, since at design time, the query isn't known.
Regards,
Marc -
Use evdre to query data from a SQL View
Hi all
I believe that it is possible to use evdre to query data from a SQL View. If this is possible then how does one go about setting it up in the evdre options (assuming that the view has already been created)?
Regards,
ByronByron, perhaps this is no longer supported, it might be worth opening up a case at service.sap.com on this. However, I did find the following on Page 11 of the "Usages and Considerations of EVDRE" pdf file. This doc is imbedded in the helpfile for BPC 7 SP5 (which was released in August of 2009, well after note 1315011 was last updated.
It looks like you are limited to one custom view per application, since you have to name the view in a parameter at the APPLICATION level. Go into BPC Administration, login to the application related to the custom view, choose "Set Application Parameters" and enter the name of the view to the Application Parameter called "EVDRE_QUERYVIEWNAME" If it is not listed, go ahead and create it at the bottom of the Application parameter screen.
Also: I interpreted the following info from Page 10 of the same doc:
In your EVDRE, set the following options:
QueryEngine: MANUAL
QueryType: enter either NEXJ OR TUPLE see below:
NEXJ - Use two-dimensional queries using the nonemptycrossjoin function
TUPLE - Use two-dimensional queries using tuples"
And I'm assuming you'd enter a Y for the following two parameters:
QueryViewName
"..to enforce the query engine to use a used-defined SQL view of the fact tables, when trying to read the values using SQL queries. This option is typically used in conjunction with the SQLOnly option (see below). "
Option SQLOnly
"..to enforce the query engine to only execute SQL queries, when reading data. This can be achieved using this option." -
Query data from MS SQL db through Oracle ? By using JAVA ?
Hi folks,
I would like to sync our one table in oracle db with table in different system, stored in MS SQL database.
What would be the easiest option for connection from Oracle to MS SQL db to be able to query data from MS SQL through some Oracle package?
If possible, I would like to keep all "tricky steps" within Oracle database. I heard about option with Java, but so far we have no experience with java in Oracle.
Our database: Oracle 11g Database Standard Edition One
Many thanks,
TomasC:\Users\tomeo>dg4pwd HELIOS
ORACLE Gateway Password Utility
Constructing password file for Gateway SID HELIOS
For user account SYSTEM
OPW-00001: Unable to open password-file (RC=0)
C:\Users\tomeo> -
I want to query sql server database from oracle
i want to query sql server database from oracle
can anyone help me in this regardFirst of all - you are in the wrong forum.
Look either for the Database general or search for Transparant / Heterogenous Gateways.
cu
Andreas -
Xmlgen.getxml(query) -issue from PL/SQL
Hi!
Have anyone tried this? I just get errors when I use my SQL-statemensts in Oracle 9i R.1.
I'm trying to update my small PL/SQL based web ap. to start using XML, the function returns ORA-00094 errors
when I use a where-clause. When I don't, the function returns a valid XML page. But I wanna sort, and restict the output
before XML is beeing produced, hence a WHERE-clause.
My function looks like this:
create or replace function SOKER
(s_sok IN VARCHAR2 default null) RETURN CLOB is
converted VARCHAR2(500) default NULL;
query VARCHAR2(200);
begin
select replace(s_sok,'*', '%')into converted from dual;
-- I have to denote my WHERE-clause or this statement will fail!
query := 'select * from oaadm.oa_folder';
-- where contains(REFERANSENR, converted, 1)>0 or contains(SOKNAD,converted, 2)>0 or contains(GJENNOMFORT,converted, 3)>0 ';
RETURN xmlgen.getxml(query);
end soker;
This function works fine in a cursor with HTP.P for each row. But that is not what I want. I wanna dynamically produce XML from a query.
The old dbxml would let med do this (I think.). My table OA_FOLDER does not contain any NULL values.
Any ideas people?
Regards,
Andreas Kjeldsen (NORWAY).Hi!
Have anyone tried this? I just get errors when I use my SQL-statemensts in Oracle 9i R.1.
I'm trying to update my small PL/SQL based web ap. to start using XML, the function returns ORA-00094 errors
when I use a where-clause. When I don't, the function returns a valid XML page. But I wanna sort, and restict the output
before XML is beeing produced, hence a WHERE-clause.
My function looks like this:
create or replace function SOKER
(s_sok IN VARCHAR2 default null) RETURN CLOB is
converted VARCHAR2(500) default NULL;
query VARCHAR2(200);
begin
select replace(s_sok,'*', '%')into converted from dual;
-- I have to denote my WHERE-clause or this statement will fail!
query := 'select * from oaadm.oa_folder';
-- where contains(REFERANSENR, converted, 1)>0 or contains(SOKNAD,converted, 2)>0 or contains(GJENNOMFORT,converted, 3)>0 ';
RETURN xmlgen.getxml(query);
end soker;
This function works fine in a cursor with HTP.P for each row. But that is not what I want. I wanna dynamically produce XML from a query.
The old dbxml would let med do this (I think.). My table OA_FOLDER does not contain any NULL values.
Any ideas people?
Regards,
Andreas Kjeldsen (NORWAY). -
Is it possible to trace users sql query disconnected from the session
One of my users used to run the sql query daily, Now her machine rebooted and she lost all the sql query. is there any way to trap the sql what she used to run? I have the os/sql username....
thxuser587112 wrote:
Yes we are using 10.2.0.3. main requirement of user is all the sql query she used to run.To get this query she is giving me her os user.And says why it is not possible?What would that be possible? If this database is reserved for her only that could be possible.
Once she lost her session, there's no reliable method to trace all her SQL queries. The SID will be reused by Oracle, her SQL could be flushed out of shared pool, consider Oracle is designed to tackle with thousands of queries per seconds there's no feasible way to save all these information without impact on performance.
So unless you had sql trace turned on her session or the database is reserved for her use only, then no it's not possible to retrieve all her SQLs and guarantee it. You might be able recover some of SQL from the mentioned DBA views but no guarantee what so ever.
PS. it's no guarantee to get all her SQLs even her session is still active, unless SQL trace were turned on.
Edited by: yingkuan on Jan 13, 2009 11:48 AM -
Write to Citadel database from LabVIEW?
Hi. I'm a newbie when it comes to Lookout and the Citadel database... so here's my question for you all:
We have various labview applications that log data from instruments. We would like to be able to take this data and store it as "tags" in a Citadel database.
What do you think is the best way to do this?
There are ODBC drivers for the Citadel database, but they appear to only allow you to query the database to retrieve values... you can't write data to the database (so its read-only).
Are they any "Lookout VIs" or Citadel VIs that can write to the Citadel DB from LabVIEW? Or a DLL or something?
Any ideas?
regards,
John PaulVery nice question John Paul. I take it you already have Lookout and LabVIEW. In this case, with the latest versions of either, simply use the LabVIEW datasocket to publish the items on your front panel. Lookout then can subscribe to these once you register the LabVIEW computer. Once you have subscribed to them in Lookout, you are then able to set up logging. You may need to create an expression object to route the data to citadel.
If you just want to use LabVIEW and the Citadel database, you might try VI Logger. This works in our configuration utility - MAX, and also comes with a set of VIs for LabVIEW. One caveot, the Citadel database in VI logger is newer (and faster) than the Citadel database in Lookout. I believe NI is working to synchronize
the version in the future, and its hard to say when. So till then, you would not be able to merge data in the dislike citadel databases. However, you can always use and ODBC call set to extract from both and store in a more permanent SQL database such as access, oracle, ms back office, etc.
Good Luck,
Preston Johnson
Business Development Manager
Industrial Applications
National Instruments
Preston Johnson
Principal Sales Engineer
Condition Monitoring Systems
Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
National Instruments
[email protected]
www.ni.com/mcm
www.ni.com/soundandvibration
www.ni.com/biganalogdata
512-683-5444 -
Not able insert ,query data from forms
hi,
I am not able to insert data or query data from forms(10g devsuite).getting error frm-40505,frm 40508 .i am able to insert and select record from sql plus.the block ihave created is control block .it is connected to the table using the properties.
should i do anything to insert record.please helpthe block ihave created is control block .it is connected to the table using the properties.A Control Block, by definition, is a non-database block. This means the block is not directly connected to a table so you have to manually display data in the block and any DML you want to perform on data in this block you must do manually as well.
There are four database objects you can base your database block on; 1) a Table, 2) a View, 3) From Clause Query (basically an In-line View), and 4) a database stored procedure. I recommend you use one of these four methods rather than manually display your data.
Craig... -
Performance tuning for ABAP Query (created from t-cd SQ01)
Hello all,
We created ABAP Query report from transaction SQ01.
But the generated report has an appropriate SQL statement which causes performance problem.
To solve this issue, I guess the easiest way is;
0. Give up to use it.
1. Copy it to another object in the customer namespace.
2. Ajust SQL statement.
But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
Could anybody give me any better idea?
Thank you
YukoYou can try this: Create 2 ranges, for objnr and cdtcode and fill like:
ra_objnr-sign = 'I'.
ra_objnr-option = 'CP'.
ra_objnr-low = 'OR*'.
append ra_objnr.
ra_code-sign = 'I'.
ra_code-option = 'CP'.
ra_code-low = 'CO*'.
append ra_code.
SELECT objnr udate utime
FROM jcds
INTO TABLE it_jcds
WHERE objnr IN ra_objnr
AND stat = l_tj02t
AND cdtcode IN ra_code
AND inact = space
Regards,
John. -
How to set Query SQL Statement parameter dynamically in Sender JDBCAdpter
Hi All,
I have one scenario in which we are using JDBC Sender Adapter.
Now in this case,we need to set Query SQL Statement with a SELECT statement based on some fields.
This SQL statement is not constant, it would need to be changed.
Means sometimes receiver will want to execute SQL statement with these fields and sometimes they will want to execute it with different fields.
We can create separate channels for each SQL statement but again that is not an optimum solution.
So ,I am looking out for a way to set these parameters dynamically or set SQL statement at Runtime.
Can you all please help me to get this?Shweta ,
<i>Sometimes receiver will want to execute SQL statement dynamically</i>....
How you will get the query dynamically? Ok Let me assume, consider they are sending the query through file, then its definitely possible. But u need BPM and also not sender JDBC receiver adapter instead, receiver JDBC adapter.
SQL Query File ->BPM>Synchronous send [Fetch data from DB]--->Response -
>...............
Do u think the above design will suit's ur case!!!!
Best regards,
raj. -
Trying to query data from a view - ORA-01882 and ORA-02063 Errors
Hey there,
I tried to query data from a view that was provided by a colleague. This view works fine and gives correct data using PL/SQL Developer or SQLPLUS, but in SQL Developer, I get the following error:
ORA-01882: Time zone region not found
ORA-02063: preceding line from SYSTOOLS
01882.00000 - "timezone region %s not found"
* Cause: Specified reason name was not found
* Action: Please contact Oracle Customer Support
Vendor Code 1882
Where comes this error message from?! SYSTOOLS is the database link.
Can't see an obvious reason for this error.
OS is Windows 2000 SP4, SQL Developer is v1.1.1.25 BUILD MAIN-25.14
Regards,
ThomasFrom Oracle Messages 'Cause and Action'
http://www.oracle.com/technology/products/designer/supporting_doc/des9i_90210/cmnhlp72/messages/ora_messages.htm
ORA-01882, 00000, "timezone region %s not found"
Cause: The specified region name was not found.
Action: Please contact Oracle Customer Support.
Maybe invalid region in NLS_LANG?
"select * from v$nls_parameters"
Starting this script in all developer program and compared result... -
Hi all,
I'm getting really frustrated by this Access error. It happens when I export the result of a query through an Access macro to Excel, the first time it runs well but the next time, there is a chance that the query won't run and the error "Query
must have at least one destination field" will be displayed. After that, I try to check the query SQL code and discover the code has vanished. I'm using simple Select query without joins, only "where", "group by" and "order by"
statements.
Thank you in advance for your help,
Jesus
Edit:
One of these queries are like the following (all of them are of this type):
SELECT Field1, field2, field3, field4, field5, Sum(Field6) AS SumOfField6, Sum(Field7) AS SumOfField7
FROM Table1
WHERE Field6 is not null
GROUP BY Field1, field2, field3, field4, field5
Order By Sum(Field6) descHi Peter,
Thank you for your response, I updated the original question with one of the codes.
Thanks,
Jesus -
Problem with return a ColdFusion query object from a Java class
Hi!
I need to return a ColdFusion query object from a Java class
using a JDBC result set ( java.sql.ResultSet);
I have tried to pass my JDBC result set in to the constructor
of the coldfusion.sql.QueryTable class with this code:
ColdFusion code
<cfset pra = createObject("java","QueryUtil").init()>
<cfset newQuery = CreateObject("java",
"coldfusion.sql.QueryTable")>
<cfset newQuery.init( pra.getColdFusionQuery () ) >
My java class execute a query to db and return QueryTable
Java code (QueryUtil.java)
import coldfusion.sql.QueryTable; // (CFusion.jar for class
QueryTable)
import com.allaire.cfx //(cfx.jar for class Query used from
QueryTable)
public class QueryUtil
public static coldfusion.sql.QueryTable
getColdFusionQuery(java.sql.ResultSet rs)
return new coldfusion.sql.QueryTable(rs);
but when i run cfm page and coldfusion server tries to
execute : "<cfset pra =
createObject("java","QueryUtil").init()>" this error appears:
Object Instantiation Exception.
An exception occurred when instantiating a java object. The
cause of this exception was that: coldfusion/sql/QueryTable.
If i try to execute QueryUtil.java with Eclipse all it works.
Also I have tried to return java.sql.ResultSet directly to
coldfusion.sql.QueryTable.init () with failure.
Do you know some other solution?ok
i print all my code
pratica.java execute a query to db and return a querytable
java class
import java.util.*;
import java.sql.*;
import coldfusion.sql.*;
public class Pratica {
private HashMap my;
private String URI,LOGIN,PWD,DRIVER;
private Connection conn=null;
//funzione init
//riceve due strutture converite in hashmap
// globals
// dbprop
public Pratica(HashMap globals,HashMap dbprop) {
my = new HashMap();
my.put("GLOBALS",globals);
my.put("DBPROP",dbprop);
URI = "jdbc:sqlserver://it-bra-s0016;databaseName=nmobl";
LOGIN = "usr_dev";
PWD = "developer";
DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
try{
// Carico il driver JDBC per la connessione con il database
MySQL
Class.forName(DRIVER);
/* Connessione alla base di dati */
conn=DriverManager.getConnection(URI,LOGIN,PWD);
if(conn!=null) System.out.println("Connection Successful!");
} catch (ClassNotFoundException e) {
// Could not find the database driver
System.out.print("\ndriver non trovato "+e.getMessage());
System.out.flush();
catch (SQLException e) {
// Could not connect to the database
System.out.print("\nConnessione fallita "+e.getMessage());
System.out.flush();
//funzione search
//riceve un hash map con i filtri di ricerca
public QueryTable search(/*HashMap arg*/) {
ResultSet rs=null;
Statement stmt=null;
QueryTable ret=null;
String query="SELECT * FROM TAN100pratiche";
try{
stmt = conn.createStatement();// Creo lo Statement per
l'esecuzione della query
rs=stmt.executeQuery(query);
// while (rs.next()) {
// System.out.println(rs.getString("descrizione"));
catch (Exception e) {
e.printStackTrace();
try {
ret = Pratica.RsToQueryTable(rs);
} catch (SQLException e) {
e.printStackTrace();
this.close();
return(ret);
// ret=this.RsToQuery(rs);
// this.close(); //chiude le connessioni,recordset e
statament
//retstruct CF vede HashMap come struct
//METODO DI TEST
public HashMap retstruct(){
return(my);
//conversione resultset to querytable
private static QueryTable RsToQueryTable(ResultSet rs)
throws SQLException{
return new QueryTable(rs);
//chiura resultset statament e connessione
private void close(){
try{
conn.close();
conn=null;
catch (Exception e) {
e.printStackTrace();
coldfusion code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<title>Test JDBC CFML Using CFScript</title>
</head>
<body>
<cftry>
<cfset glb_map =
createObject("java","java.util.HashMap")>
<cfset dbprop_map =
createObject("java","java.util.HashMap")>
<cfset glb_map.init(glb)> <!---are passed from
another page--->
<cfset dbprop_map.init(glb["DBPROP"])>
<cfset pra =
createObject("java","Pratica").init(glb_map,dbprop_map)>
<cfset ourQuery
=createObject("java","coldfusion.sql.QueryTable").init(pra.search())>
<cfcatch>
<h2>Error - info below</h2>
<cfdump var="#cfcatch#"><cfabort>
</cfcatch>
</cftry>
<h2>Success - statement dumped below</h2>
<cfdump var="#ourQuery#">
</body>
</html>
error at line <cfset pra =
createObject("java","Pratica").init(glb_map,dbprop_map)>
An exception occurred when instantiating a java object. The
cause of this exception was that: coldfusion/sql/QueryTable.
----------------------------------------------------------------------- -
Xi JDBC Adapter - Query SQL Statement & Update SQL Statement
Hi!
I configure the JDBC adapter sender (XI) to take data from Oracle database.
I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
Query SQL Statement :
SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
Update SQL Statement :
UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
My question is :
If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
Please, may you give me some example?
Thanks,
Francescohi,
did you check "Isolation Level for Transaction"
for the sender jdbc adapter?
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Regards,
michal
Maybe you are looking for
-
I need to run a program called Niagara. It will not run with Java 7 so I have uninstalled 7 and re-installed 6. Now, mozilla wants me to install a plugin in order to run the program. When I click install plugin, it takes me to the java site and wants
-
How to get the previous state of my data after issuing coomit method
How to get the previous state of some date after issuing commit method in entity bean (It should not use any offline storage )
-
How to get time spent in the repaint(long delay) method of component?
Hi, I'm trying to get the time spent in the repaint method of Component. I tried to surround the method with time information: long time = System.getTime(); component.repaint(400); time = System.getTime() - time; System.out.println("Time spent in rep
-
Hi, When I am going to create a system DSN from Windows2003 using the driver Oracle in OraClient10g_Home1 I get following error while testing connection... Unable to Connect SqlState=IM004 [Microsoft][ODBC Driver Manager.....SQL_HANDLE_ENV failed[/b]
-
Prob: Creating Image in memory and printing "hello" on it, then saving it.
How can i create an Image instance in memory and then do a drawString "Hello" on it, then save it to disk. I'm not loading the image, i'm not displaying it onscreen.... It's all in memory. So i can't to createImage, like in an applet... or Window.cre