Query in mysql DB with Dieadem
Hi,
I am using a mysql database to store some report data and I want to use Diadem to show the data and create the charts.
I can connect to the database using diadem and see the database structure. I also can select specific columns and create charts.
My question is if I can make a query for a specific value, the same way that it can be use datafinder to query a specific value in a TDM file.
I have read in the NI developer zone in http://zone.ni.com/devzone/cda/tut/p/id/4260 in the Getting data out tab there is a dialog that is a good example of what I want.
Do we have to build this tools? How ?
Thanks.
Hi hugoc,
I'm sorry, I don't know how I saw spaces yesterday-- there are none now in your column or table names. The "Show Query Results in Dialog" button should pop up a dialog with a table of values in it. So the fact that you're not getting anything to happen is not expected and is a problem of some sort.
You could always put back in the 3 data base connection lines so that you can try out the Wizard with the 3 data bases it contacts by default. Then you should see that dialog pop up. This would be a general way to tell what "should" happen. I've not seen this SQL command FORMAT before. Does this dynmically convert a string column to a float column for the purposes of the query? If so, why are you storing float values in a string column in the data base? If not, then why is the FORMAT command necessary-- if we're doing float comparisons, what need is there for a format specification? Or is the FORMAT determining the display of the values that are returned by the query?
The WHERE clause in the query is cotained in the "CondStr" variable in the SUDialog file. This happens in the Function "QuerySelData()" at the following line:
T1 = "SELECT " & Prefix & QColStr & " FROM " & QTables(k) & CondStr & SortStr
It also occurs in the Function "GetQueryProp()" in the following line:
If (CondBool) Then T1 = T1 & CondStr
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Similar Messages
-
Problem in update Query of MySQL
Hi
I have a large amounts of records in a teble & i want to update the records in a particular condition but it takes time in updating.
I have also used batch update but it's also not going to solve my problem.
can anyone help what should i do to frequently update in a large amount of data.
I am using MySQL along with core java.It's not a Java question but more of a database profiling question. Try to post your description of the problem and the query in a MySQL forum.
Kaj -
Hi,
I posted a question a couple of days ago, about the following question:
The problem i have is i have a table to query, which is a s follows:
Table: ECReact
id: int (11)
ReactID: varchar(5)
Ecid: int(11)
EC:varchar(12)
the question i have is, how do i check in the column ReactID for entries that have the same ECid occurring more than once ?
i did get a response to this question as shown below:
SELECT ReactID, Ecid AS tmp
FROM ECReact
WHERE (SELECT COUNT (*)
FROM ECReact
WHERE Ecid = tmp) > 1;
however, i was getting exceptions thrown out - because i'm querying a mySQL database and apparently this does not support nested queries
Any Suggestions ?
Thankssearch the web,
http://www.developer.be/index.cfm/fuseaction/tutorialDetail/GroupID/28/tutorialName/mySQL-SimulatingSubQueriesUsingTemporaryTables.htm
mySQL - Simulating Sub Queries Using Temporary Tables By Martin Sutton
Summary:
Recently I was constructing a dynamic reporting engine.
One particular report required information from several tables although not possible using just a standard join.
With a sub-query, the task would of been simple, however, as I discovered it was more complex than first thought.
Method:
Had I had access to sub-queries my syntax would of looked similar to this:
SELECT DISTINCT #fieldlist# FROM customers c WHERE c.customerid
NOT IN (SELECT DISTINCT customerid, dateplaced FROM currentorders
WHERE dateplaced BETWEEN '#SetVariable("fromdate", fromyear & "/" & frommonth & "/" & fromday)#'
AND '#SetVariable("todate", toyear & "/" & tomonth & "/" & today)#')
All would of been fine.
Now, I knew mySQL did not support sub-queries but I wasn't aware that this report would be needed.
The workaround was not overly complex but needs more than a casual glance.
Below is the finished code. We can see that we need to re-create the temporary table each time,
and also drop it, if it exists.
First we check to see if the temporary table exists, and if so, we drop it.
drop table IF EXISTS temp
Secondly, we create the temporary table and populate it with data needed for the join.
CREATE TEMPORARY TABLE temp SELECT DISTINCT customerid, dateplaced FROM currentorders
WHERE dateplaced BETWEEN '#SetVariable("fromdate", fromyear & "/" & frommonth & "/" & fromday)#'
AND '#SetVariable("todate", toyear & "/" & tomonth & "/" & today)#'
Now we left join on the temporary table to create a recordset containing customers with no orders.
NULL is returned if there is no match on the joined fields in the right table.
SELECT DISTINCT #fieldnames# FROM customers c LEFT OUTER JOIN temp t ON c.customerid = t.customerid WHERE t.customerid IS NULL -
Hi,
How to convert the below oracle query to MYSQL query
Oracle Query:
SELECT b.* FROM (SELECT t2.*, MIN(t2.id) over(PARTITION BY t2.rid)ord_num
FROM (SELECT t1.id, dense_rank() over(ORDER BY nvl(t1.CLI_ID_CLIENT_EXT, 'a'||t1.id)) rid
FROM CANGEN_MATRICE_BKUP t1) t2) t, (SELECT ROWNUM , b.* FROM CANGEN_MATRICE_BKUP b) b
WHERE t.id = b.id ORDER BY t.ord_num, b.id
i dont know howto convert the MYSQL query?
Please help on this.
Regards
Sudhakar P.No MySQL haven't analytic functions. But every analytic function can be achieved with simple SQL, just one needs to write more it :)
So here is a starting point how to emulate analytic functions in MySQL
http://www.oreillynet.com/pub/a/mysql/2007/03/29/emulating-analytic-aka-ranking-functions-with-mysql.html
And MySQL haven;t rowids as well, but actually I dont see any sense of it in this particular query.
Gints Plivna
http://www.gplivna.eu -
An error occurred querying a data source - with REST services
Hi,
I have a SharePoint 2013 form library library with an info-path form. I need to get the logged in user's 'Display Name' on my form load automatically.
I used REST service to fetch the current user details. In the preview mode of the form, its showing the right name. But when I publish this form to library I am getting the following error.
REST Service --> http://site url/_api/SP.UserProfiles.PeopleManager/GetMyProperties
Please help me to resolve this issue.
Thanks in advance for your time and reply :)Hi,
According to your post, my understanding is that an error occurred querying a data source with REST services.
It is defiantly permission issue with GetUserProfileByName service
and could be many reasons of this problem. You first try with UDCX file and make sure that UPS is running.
Here are some similar threads for your reference:
http://social.technet.microsoft.com/Forums/en-US/b8c668ea-7511-4657-a1a8-08fb4a6bd53d/info-path-an-error-occurred-querying-a-data-source?forum=sharepointcustomizationprevious
http://social.technet.microsoft.com/Forums/en-US/46866ac2-da09-4340-a86a-af72cbb2c8d7/info-path-an-error-occurred-querying-a-data-source-?forum=sharepointcustomization
http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Issue in Setting up MySQL DB with ATG 10.0.3
Hi All,
I am facing the below issue while setting up the MySQL DB with the ATG 10.0.3 version.
**** Error Thu Aug 30 23:45:25 CDT 2012 1346388325927 /atg/dynamo/service/jdbc/JTDataSource an exception was encountered while trying to populate the pool with the starting number of resources:
atg.service.resourcepool.ResourcePoolException: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306
**** Error Thu Aug 30 23:45:25 CDT 2012 1346388325968 /atg/dynamo/service/jdbc/JTDataSource The connection pool failed to initialize propertly, i.e. the starting number of connections could not be created; check your database accessibility and JDBC driver configuration
Please help to resolve this issue.Weblogic comes with ojbc driver for oracle db but I've never tried it with mysql - I just looked and theres mysql-connector-java-commercial-5.1.14-bin.jar in weblogic server/lib directory. Make sure its coming up in your class path log output when you startup weblogic.
-Kip -
Java mysql OK with Terminal but not OK with Apache local web server
With terminal I have :
CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/:/Library/Java/Extensions/:./
SUDO_GID=20
SECURITYSESSIONID=210800
_=/usr/bin/printenv
127:/Library/WebServer/Documents/Java root# java TestMySQL
2006-05-21 13:39:00.0 ************************************************** = OK
127:/Library/WebServer/Documents/Java root#
import java.sql.*;
* mysql-connector-java-3.1.12-bin.jar
* % javac /Library/WebServer/Documents/Java/TestMySQL.java
* % java TestMySQL
public class TestMySQL {
public static void main(String argv[]) throws Exception {
// Load the driver class
Class.forName("org.gjt.mm.mysql.Driver");
1 //Class theClass = null;
2 //try {
3 // theClass = Thread.currentThread().getContextClassLoader().loadClass("org.gjt.mm.mysql.Driver");
4 //}
5 //catch (ClassNotFoundException e) {
6 // theClass = getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
7 //}
Connection conn = DriverManager.getConnection(
"jdbc:mysql:///test",
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("SELECT now();");
while (rset.next()) {
System.out.println(rset.getString(1));
// Close result set, statement and DB connection
rset.close();
stmt.close();
conn.close();
}I have a simple TestMySQL.html file with applet TestMySQL.class in it.
Nothing but "Applet TestMySQL not inited"
When I uncomment the try/catch lines (lines 1 to 7) , java compiler generate an error... near getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
With "Class.forName("org.gjt.mm.mysql.Driver");" no problem.
Running MacOS X 10.3.9, Apache/1.3.33 (Darwin) PHP/4.4.1 mod_ssl/2.8.24 OpenSSL/0.9.7i and JVM 1.4.2_09
Thanks for help.
P.S. This my first approach to java/mysql but I would like to see this short program running on my local web server ...
Thanks.hi :-)
can you post the stack trace?
im not sure what is causing the error because of less info,
but have you tried to copy the driver of mysql to tomcat lib folder?
regards, -
Please help to re-write this query using exists or with
Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
FROM (
SELECT a.individual_id individual_id,
CASE
WHEN NVL
(b.ship_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 45
AND a.country_cd = 'US'
AND b.individual_id in (
SELECT UNIQUE c.individual_id
FROM order c
WHERE c.prod_cd = 'A'
AND NVL (c.last_payment_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 745)
THEN 1
ELSE 0
END AS one_mon_c_paid_us
FROM items b, addr a, product d
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id)
GROUP BY individual_id)
Edited by: user4522368 on Aug 23, 2010 9:11 AMPlease try and place \ before and after you code \Could you not remove the inline column select with the following?
SELECT a.individual_id individual_id
,CASE
when b.Ship_dt is null then
3
WHEN b.ship_dt >= SYSDATE - 90
3
WHEN b.ship_dt >= SYSDATE - 45
2
WHEN b.ship_dt >= SYSDATE - 30
1
END AS one_mon_c_paid_us
FROM items b
,addr a
,product d
,order o
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id
AND b.Individual_ID = o.Individual_ID
and o.Prod_CD = 'A'
and NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
and a.Country_CD = 'US' -
How to Use SQL Query having IN Clause With DB Adapter
Hi,
I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
Thanksinvoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter
-
Is it possible to insert data into a MySQL database with Java?
Hello everyone!
I would like to know, if it's possible to insert data into a MySQL database, with a JFrame inside a servlet?
When the JFrame is first created it calls this method:
* Connects the servlet with the MySQL database.
private void connect(){
try{
Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/data", "root", "omfg123");
}catch(ClassNotFoundException cnfe){
cnfe.printStackTrace();
}catch(SQLException sqle){
sqle.printStackTrace();
}Then, when you click the "Add" button, it executes this code:
add.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent ae){
String employee = employeeName.getText();
String[] args = employee.split(" ");
firstName = args[0];
lastName = args[1];
execute();
});And this is my "execute()" method:
* Connects the servlet with the MySQL database.
* - And executes the SQL queries.
private void execute(){
try{
PreparedStatement statement = connection.prepareStatement("insert" +
" into employees values(" + firstName + ", " + lastName
+ ")");
ResultSet result = statement.executeQuery();
String fullName = firstName + " " + lastName;
printer.write("Employee " + fullName + " added.</br>");
}catch(SQLException sqle){
sqle.printStackTrace();
}But when I click the "Add" button, nothing happens.This is what I use to insert into mysql. It works on windows.
try {
Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://" + loadip + "/custsig?" +
"user=root&password=";
Connection con = DriverManager.getConnection(connectionUrl);
newproc = jTextField1.getText();
newsoft = jTextField2.getText();
newdeb = jTextField3.getText();
newcust = jTextField4.getText();
if (newcust.equals("")) {
errorsig12 = 1;
jLabel1.setForeground(new java.awt.Color(255, 0, 0));
} else if (newsoft.equals("")) {
errorsig12 = 1;
jLabel2.setForeground(new java.awt.Color(0, 0, 0));
} else if (newproc.equals("")) {
errorsig12 = 1;
jLabel3.setForeground(new java.awt.Color(0, 0, 0));
} else if (newdeb.equals("")) {
errorsig12 = 1;
jLabel4.setForeground(new java.awt.Color(0, 0, 0));
if (errorsig12 == 0) {
PreparedStatement ps = con.prepareStatement("insert into customer set cust_name = ?, software = ?, processor = ?, debit = ?");
ps.setString(4, newdeb);
ps.setString(3, newproc);
ps.setString(2, newsoft);
ps.setString(1, newcust);
int rs = ps.executeUpdate();
} catch (SQLException eg) {
System.out.println("SQL Exception: " + eg.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: " + cE.toString());
} -
Can I use custom query in DB Adapter with Polling
Hi All,
I am getting problem while using db adapter with polling. Can I use custom query in db adapter with polling.
I am using 2 tables; table 1 and table2
Structure of table1 is as:
File_name
Batch_id
Creation_date
Status
Structure of table2 is as:
Batch_id
Employee_ID
Last_Name
First_Name
Middle_Name
Group_ID
Site_ID
Dept_Num
Report_id
I have to use below query while polling to table1
Select count(*) as NOSEXP, Report_id
from table1, table2
where table2.batch_id =
table2.batch_id
and table1.Status= 0
group by Report_id;
I mean, when I use DB adapter to poll table1, I have to use above query.
Can you Please suggest on this.
Thanks in advance.I will check for existance not based on Primary key but based on three other fields in the table. I think , by default DB adapter configured for MERGE checks for existance based on PK. Can we change the Primary Key in the mapping file after the DB adapter is configured. In that case , will it check for existance based on the fields , I mention.
Edited by: user12020809 on Sep 16, 2012 6:08 PM -
Query on Driver Compatibility with Oracle 9i & Oracle 11g
Technical query on Driver Compatibility with Oracle 9i & Oracle 11g of our client scenario
1. There are 2 databases, FCDB and FCR DB. Both the databases are running on Oracle 9i. FCDB Application present is using the same version of JDBC driver (classes12.jar) to communicate with FCDB Local and FCR Host Database. And it is JDK 1.4 compliant.
2. We require upgrading the FCDB alone to 11g Release 1 and FCR DB with same Oracle 9i.
3. In this case, if the application is using the same version of JDBC driver (classes12.jar) to communicate with FCDB Local and FCR Host Database, will there be any issues.
4. Need to check if there is any issues related to the classes12.jar with 11g Release 1 DB whether oracle will extend their support to us and how and when they can they provide it.
5. If there are any issues, can that be resolved by Oracle Support?
Edited by: user13290657 on Mar 4, 2011 12:41 PMThis forum deals with migrations from foreign databases to Oracle.
You might better post your request in this forum:
http://forums.oracle.com/forums/category.jspa?categoryID=288 -
Try to use Mysql database with forte
Dear All:
As title said, I try to use Mysql database with forte.
I read the manual , it said I have to put the database jdbc driver in
the Forte for Java lib/ext directory.
I did it and then add a new Driver in the Runtime tab in the Explorer
window .
But when I try to test this new driver(by Right-clicking on the driver
or connection in the Explorer and select Test Driver from the context
menu),it said "cannot find driver class: check your CLASSPATH or
\lib\ext direectory".
I am sure I'hve put the driver class(with the whole directory structure)
in that folder.
Does anyone what I may go wrong ?
Could you please give me some advices that I can fix this problem ?
Thanks in advance.
Ken @ Taipei , Taiwan , AsiaYou should have put the jar file that contains the driver into that directory. If you unpacked the jar file and put the individual classes into that directory, it will not work.
-
How to use non-MySQL database with DW and PHP...???
I need to connect to a data-source that is not MySQL from
with my PHP scripts. The only option I get under the Databases tab
in the Application panel is MySQL Connection. What about just
standard ODBC connections? Will DW not handle those for me? Do I
have to do all of that by hand??
Any information would be greatly appreciated. Thanks!"Angell EYE" <[email protected]> wrote in
message
news:fc4eaj$fmn$[email protected]..
>I need to connect to a data-source that is not MySQL from
with my PHP
>scripts.
> The only option I get under the Databases tab in the
Application panel is
> MySQL
> Connection. What about just standard ODBC connections?
Will DW not
> handle
> those for me? Do I have to do all of that by hand??
>
> Any information would be greatly appreciated. Thanks!
There once existed an opensource servermodel called phakt
that used the
ADODB database abstraction library,
the company that created and supported it was bought by Adobe
and
subsequently the project was cancelled.
A group of people (including me) started a community
initiative@
http://openphakt.sourceforge.net
to continue distribution and development of
phakt, but unfortunately I don't have access to Dreamweaver
CS3 due to lack
of funding.
Phakt will almost certainly NOT run on CS3 in it's current
state, but is
should support previous versions.
Joris -
How to connect mySQL database with jdbc
Who can tell me how to connect mySQL database with jdbc? Thanks
http://onesearch.sun.com/search/developers/index.jsp?and=connect+mysql&nh=10&phr=&qt=¬=&field=title&since=&col=devforums&rf=0&Search.x=24&Search.y=16
Maybe you are looking for
-
IPhoto made a huge mess, how to clean up files on HD???
I have thousands of photos in iPhoto v6.0.6, and it has somehow made a huge frustrating mess of things. Some preliminary information: • My preference is set to "Copy photos to iPhoto Library folder when adding to library." • Under the main "Library"
-
Problem with printing ever since I've changed the yellow cartridge ink
Hello, I have the new printer - HP Ink Advantage 3525 that was working great. I got a message on my PC which says that I need to change the yellow cartridge one, so I did it very easily, but even since I get tons of problems with my printer. The comm
-
How do I reinstall Premiere Pro CC?
Premiere Pro CC crashes every time I start it so I uninstalled it to see if a reinstall would help. I rebooted. Creative Cloud still says that it's installed. I can't find any answers for this in any forum. Help? Please? Thanks.
-
Access MS-Access using JDBC ODBC bridge from Sun AMD64
Hi, We are trying to configure a communication channel using the JDBC adapter. We are setting the driver to the JDBC-ODBC bridge driver and trying to access an MS Acess database from the PI server(sun amd64). When we set the driver to the JDBC-ODBC b
-
I exported a short video of mine from Final Cut Express and the size of the file came out to 7.3 GB. When I put it into an iDVD project, it says that the file is only 800 MB. I tried just burning it onto a dual layer disc anyway to see if it might st