DB connectivity Kit: syntax error in a SELECTION of data from joined tables

Hello everyone

I'm putting in labview a SQL query on joined tables.

As an example I take a database to store the data of basketball 2on2 matches, which tables are

corresponds to (matchId, Thomas, teamB)

teams (teamId,PlayerAname, PlayerBname, nationality)

nationalities (NatId, natName)

To get an array of result with the game as well as the names of player as well as their nationality, I use this query on MySQL (which works on command line interface)

SELECT MatchID,
T1. PlayerAName, t1. PlayerBName, n1.natName,
T2. PlayerAName, t2. PlayerBName, n2.natName
MATCHES m
INNER JOIN teams t1 ON t1.teamID = m.teamA
INNER JOIN teams t2 ON t2.teamID = m.teamB
INNER JOIN nationalities L1 ON n1.natID = t1.nationality
INNER JOIN nationalities n2 ON n2.natID = t2.nationality

When I put it in labview, using the block 'select data', I get a syntax error as shown in the attached screenshot.

Am I something mistanking using the JOIN examples statements or aliases?

Thanks in advance!

The select VI is designed to be a simple way to select from a table. I doubt that he can do joins (and would not certainly need the 'FROM', even if it can). What you can do instead calls the query execute VI and give him the complete SQL query. I don't remember if it returns the data in the recordset object, so you must do so separately.

Tags: NI Software

Similar Questions

  • An FTP error occurred - cannot establish a connection to the host. Internal data error. Unable to send data from network.

    Recently, I started out of the blue to get this message when I try to connect to an FTP of Dreamweaver. I have CC was last updated. I have like 50 sites, more on different servers and none of them will connect. So I don't know, it can't be a server problem. Yesterday, everything was fine. I made no change what so ever. I uninstalled Dreamweaver and reinstalled him and I get the same thing. It is not the site for 30 seconds and then exhale. As soon as I hit the button to connect as 1 second later, I get this error. I have reset all modems and routers, etc. I can't find anything online about this specific problem. I'm at my wits end. I have projects due, but cannot connect. It's Thanksgiving and trying to solve this problem instead of spending time with the family. Any help would be much appreciated.

    "An FTP error occurred - cannot establish a connection to the host." Internal data error. Unable to send data from network. »

    Nope, that is not the case, I have disabled this service and now it works fine!
    He was not the firewall, but the update 25-nov2014 of Norton Protection against vulnerabilities.  ! Norton is the note and fix it for the next update in the coming days...

    I have

  • 1074118649 error occurred at niUSRP extract data from Rx (2D CBD) .vi

    Hello

    When I was trying the example of the USRP OR which is "niUSRP EX Rx synchronized to multiple entries (MIMO Expansion)", a mistake is released which is

    1074118649 error occurred at niUSRP extract data from Rx (2D CBD) .vi

    A workflow command has been issued in the past.

    can anyboay help me solve the problem?

    Thank you very much

    Andy

    Hi andy,.

    what you need to do is reversing the Oder river where the screw niUSRP the value Time.vi and niUSRP Trigger.vi configure a1.1ppear. Time of first setting then set up trigger. The example works correctly with version 1.1, since you are using version 1.2, that changes must be made.

    In the example, you can set the clock to standard time (start time = 0) even if you had already triggered the reception. Thus, samples received will be acquired with time stamp later where the error.

    Best regards

  • Select the data in a table and update in another table

    Dear experts,

    create the table TB_ENCRYPT

    (

    Identification number,

    Varchar2 (200) KEY

    );

    INSERT INTO TB_ENCRYPT VALUES(1,'HJUVHDUIFBSDGVU');

    SELECT * FROM TB_ENCRYPT;

    1 HJUVHDUIFBSDGVU

    create TABLE users)

    username, NUMBER of

    password VARCHAR2 (200)

    );

    Insert users

    values (1, 123 # "")

    Insert users

    values (2, 456 #')

    Select * from users;

    1 123 #.

    # 2 456

    I want to select the data KEY for table TB_ENCRYPT column and update in the column of tables for the respective key user password

    TB_ENCRYPT table contains only a single key value. Comparing this key, I want to update the old value of the key to the new value.

    For encryption and decryption I followed the java class method.no is worried about that.

    create or replace

    PACKAGE PCK_ENC AUTHID CURRENT_USER AS

    FUNCTION DECRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.decrypt (java.lang.String, java.lang.String) return java.lang.String ';

    FUNCTION ENCRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.encrypt (java.lang.String, java.lang.String) return java.lang.String ';

    END;

    SELECT PCK_ENC. ENCRYPT('1234','HJUVHDUIFBSDGVU') FROM DUAL;

    HERE,

    1234 - is the password of the users table column data

    HJUVHDUIFBSDGVU - represents the key of table TB_ENCRYPT column data.

    Comparing this key, I want to update the old value of the key to the new value.

    I tried with this method

    declare

    cursor c1 is

    Select the key

    of TB_ENCRYPT

    where id = 1

    update the id;

    Start

    for c1_rec looping c1

    update users

    password is PCK_ENC. Encrypt (Password, Key)

    the location being c1;

    commit;

    end loop;

    end;

    /

    Help, please

    You can use the MERGE statement.

    merge into users
    using tb_encrypt
       on (id = userid)
      when matched then
          update set password = PCK_ENC.ENCRYPT(password,key);
    

    And why you encrypt your password. This isn't a good idea. Just password hash.

  • How to connect sql database to esxi to save all data from the virtual machine

    How to connect sql database to esxi to save all data from the virtual machine

    Please provide steps

    In simple terms, you cannot connect ESXi to SQL. Connect a vCenter SQL (Windows only).

    If you want to save all the data that is contained in your virtual machines, I suggest a backup solution.

    Suhas

  • Selection of data in the table in a table

    I use apex 3.2

    I have a report where he returnts say 3 rows.


    I need to select data from a table in and table and then use the data in this table in a body of email

    or select the data in the table and use the data in the body of the sub form of e-mail

    How can I do this. ?

    something like below

    Empno name e-mail address
    1 XX [email protected]
    2 bb [email protected]
    3 [email protected] aa

    Hello

    You can take the values in the table in the cursor and use it in the part of the email.
    It will be like,

    Cursor c1 is
    Select Empno, emp email;

    In the part of the body

    Hardcode the values of the columns inside html tags

    l_body: = '

    ';

    I'm in c1
    loop
    l_body: = l_body | »

    ';
    end loop;
    l_body: = l_body | »
    EmpNo
    i.EmpNoi.Namei.email
    ';

    then use the variable 'l_body' inside your share email.

    I hope this helps.

    Kind regards
    LIBERATOR

  • Select this OPTION to generate XML data from the table using XMLELEMENT, XMLAGG gives error ORA-19011 string buffer too small

    My select statement fails with the error:


    The ORA-19011 string buffer too small


    The select statement looks like:


    SELECT TO_CLOB)

    XMLELEMENT ("accounts",

    XMLELEMENT ("count",

    XMLATTRIBUTES)

    rownum AS "recordId."

    To_date('20130520','YYYYMMDD') AS "datestarted."

    123456 AS "previousBatchId."

    56789 AS 'previousRecordId '.

    ),

    ....

    .... .

    .....

    XMLFOREST)

    SIG_ROLE AS "SignatoryRole."

    To_char(TRANSFER_DATE,'YYYY-mm-DD') AS "TransferDate."

    NVL(Reason,0) AS 'reason '.

    ) AS the 'transfer '.

    )

    ()) AS CRDTRPT

    OF ANY_TABLE;

    • It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    I'd use the XMLGEN package. But the environment team says no mounted drives in the future with the arrival of the EXADATA.

    NO HARD DRIVE MOUNTED, NO ACCESS TO THE DATABASE DIRECTORIES

    No UTL_FILE

    I need to use the REEL spool the resulting XML data of the SELECT query.

    SQL is a standard in my org, but I can do with a PL/SQL solution also to load data into a table (cannot use a COIL with PL/SQL)

    What I do is:

    1. a column of type CLOB to a xml_report of the loading of the above SELECT query table
    2. Then using SELECT * FROM xml_report to SPOOL the data to a file report.xml

    No need of XMLTYPE data behind. Xml data stream is fine for me.

    In addition, I need to validate the XML file, also using XSD.

    Problem is that the resulting lines of the select query are supposed to be from 15000 to 20000 bytes long.

    Oracle database version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    A Suggestion or a solution to this problem would be appreciated.

    (Sorry for the use of "BOLD", just to make it more readable and highlight the imp points)

    Bravo!

    Rahul

    It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    You use the right method.

    There is an implicit conversion from XMLType to the data type VARCHAR2 as expected by the function TO_CLOB, where the limitation, and the error.

    To serialize XMLType to CLOB, use the XMLSerialize function:

    SELECT XMLSerialize (DOCUMENT

    XMLELEMENT ("accounts",

    ...

    )

    )

    OF ANY_TABLE;

    For the rest of the requirement, I wish you good luck trying to spool the XML correctly.

    You may need to play around with the SET LONG and SET LONGCHUNKSIZE commands to operate.

  • Selection of data into a table

    Hello

    I'm trying to enter data in a table by using an instruction box to select the values of interest.

    The problem is this, I am under a for loop and every time that it runs, it reads a specific value in the table (table 1), using the for loop index as the index for table 1. So I check whether this specific value = preset value

    If Yes: the case statement writes the index in a table (table 2).

    If it is not: the case statement writes a constant - I would like to not have to do, but unfortunately the case loop must have all the input terminals connected.

    I would like the main table consist only of interest and no default values / values constant.

    Any ideas?

    You're abusing table to build.  Wire you a table in a table entry and other values or the other.  See the example I have attached.

  • Error message ORA-01722 loading data from text file

    Hi all

    I want to load data into the table 'dh_healthcare '.

    with the columns:

    ...

    NUMBER OF RMI,

    NUMBER OF KUM,

    ...

    Loading data with the APEX data workshop, I got the error message ' ORA-01722: invalid number. "

    For example, ALEXIS has the following values:

    1.99

    6.49

    4.14

    ...

    KUM:

    139,30

    51.32

    165,23

    ...

    I tried to put the precision and scale in the column definition, but the same error message appears.
    When I changed the data type of these columns in VARCHAR2 (60) the data loaded without error message.

    Someone at - it an idea to solve the error?

    Thank you

    Ben

    This has to do with the settings of NLS Session about the decimal separator and the group separator.

    How you load the data in the table determines where and how you set the Session variables.

    MK

  • read in select data from another table

    Hello world.

    IM Oracle11GR2 database.

    I m facing the following problem:

    I have 2 tables.

    In the first picture, I have a few articles and 3 of these items then come.

    (A) point Varchar2

    (B) Item Varchar2.

    (C) point digital and this point is the id of a record in the other table.

    If the digital point > 0 then points A and B must be read in the second table

    In the second table, I have 3 Articles.

    (A) the id of the record.

    B & C point are also point varchar2 and must be read in the first table, point C is > 0.

    I'm looking for the way that when I write a normal selection in the first picture he gives me the point B & C of the second table if C point in the first table is > 0.

    I thought to solve this problem with a trigger or something similar.

    Any idea is welcome.

    Regards to everyone.

    You don't need a trigger for this. A simple select statement should do. Something like that? I got your if condition perfectly.

    SELECT CASE WHEN (T1. C > 0) THEN (SELECT T2. B OF THE T2 WHERE T1. C = T2. (A) T1 OTHERWISE. END A,

    BOX WHEN (T1. C > 0) THEN (SELECT T2. C FROM T2 WHERE T1. C = T2. (A) T1 OTHERWISE. B END HAVE B,

    T1. C

    FROM T1;

    Look at the following example. Check if it fills your scenario.

    -BEGINNING OF THE SAMPLE DATA

    WITH T1 AS)

    SELECT 'A' A, 'B' B, 1 C OF DOUBLE UNION ALL

    SELECT 'C', ', 2 DOUBLE UNION ALL

    SELECT 'DF', 'G', THE DOUBLE 0),

    () AS T2

    SELECT 1, 'X' B 'Y' C DOUBLE UNION ALL

    SELECT 2, 'Z', 'BB' OF THE DOUBLE)

    -END OF THE SAMPLE DATA

    SELECT CASE WHEN (T1. C > 0) THEN (SELECT T2. B OF THE T2 WHERE T1. C = T2. (A) T1 OTHERWISE. END A,

    BOX WHEN (T1. C > 0) THEN (SELECT T2. C FROM T2 WHERE T1. C = T2. (A) T1 OTHERWISE. B END HAVE B,

    T1. C

    FROM T1;

    OUTPUT:

    A  B           C

    -- -- ----------

    X Y 1 - since c > 0 A and B values in table 2 are replaced

    Z BB 2 - since c > 0 A and B values in table 2 are replaced

    DF G 0 - since c = 0, there is even value in table 1

    Post edited by: Parth272025

  • Select Max (date) between multiple tables

    I need to retrieve a record from a Table in a set of similar tables with a common "date field". You can select the record where this "date field" value is greater between multiple tables.

    Here, any help is appreciated.  Thank you in advance.

    FOR EXAMPLE

    No. EMP is the primary key.

    Again, each table can have multiple records for EMP n ° 1

    TABLE1:

    FIRST NAME

    FAMILY NAME
    THE EMP NO.

    BASE SALARY

    DATE_FROM

    TABLE 2

    FIRST NAME

    FAMILY NAME
    THE EMP NO.

    SALARY GRADE

    DATE_FROM

    TABLE 3

    FIRST NAME

    FAMILY NAME
    THE EMP NO.

    COMPENSATION

    DATE_FROM

    Hello

    Said Knani, if you use the current design of the table, then here is a way to do what you want:

    WITH union_data AS

    (

    SELECT MAX (base_salary) AS sal FROM table1 UNION ALL

    SELECT MAX (grade_salary) table2 UNION ALL

    SELECT MAX (compensation) FROM table3

    )

    SELECT MAX (sal) AS max_sal

    Of union_data

    ;

  • How to insert point decimal all by selecting data from a table

    Hi all

    My select requirement says, if the value received with no decimal place then insert decimals before last 2 bytes. I need to recover the data with this condition.

    May help people how I can achieve this?

    Thanks in advance,
    Yvan

    997936 wrote:
    This will not work if the values are of 5 bytes.

    It should work for any number of digits...

    select 1234567/100 from dual;
    
    SELECT DECODE (INSTR (1234567, '.'), 0, 1234567 / 100, 1234567) FROM DUAL;
    

    Output:

    12345,67

    See you soon,.
    Manik.

    Published by: Marty on April 4, 2013 08:53

  • Select a choice from the table of the ADF

    Hello

    does anyone know how to convert a column in a table in the ADF to display a list of values in a control of first choice select?

    I want to allow the user to select a value from a drop-down inside the table.

    Thank you

    Hello
    Welcome to OTN forum and always mention your version JDev,.
    Hope that follows will be useful

    SelectOneChoice and ADF Table
    http://www.gebs.ro/blog/Oracle/Oracle-ADF-selectonechoice-table-filter-for-lov-column/

  • Select the data in two tables

    Hello

    I am trying to build a query WITH, but I can't seem to make it work:

    WITH P1 AS (SELECT OT_VALUE

    OF CSD_OPEN_VERY_HIGH_INCIDENTS VHIGH

    WHERE OT_VALUE > = 0

    ). P2 AS (SELECT OT_VALUE

    OF HIGH CSD_OPEN_HIGH_INCIDENTS

    WHERE OT_VALUE > = 0

    ), SELECT VHIGH. OT_VALUE, TOP. OT_VALUE

    P1 P2 JOIN INTERNALLY. RATING = P2. RANKING

    The two tables have the same column names.

    I want to only return a set of results if the two columns (OT_VALUE) contain in reality 1.

    Select this check box. This is a job for all four images. This will return the line to the following combinations. 0.0 and 0.1 and 1.0 and 1.1. Importance is 1.2.  Let me know if you face any problem

    SELECT CASE WHEN ((VH_OT_VAL = 0 ET H_OT_VAL = 0) OR (VH_OT_VAL = 1 AND H_OT_VAL = 0) OR (VH_OT_VAL = 0 AND H_OT_VAL = 1) or (VH_OT_VAL = 1 AND H_OT_VAL = 1)) 1

    ANOTHER ACE OF NULL TERMINATOR OT_VAL

    DE)

    SELECT H.OT_VALUE H_OT_VAL,

    VH. OT_VALUE VH_OT_VAL

    OF CSD_OPEN_VERY_HIGH_INCIDENTS VH.

    CSD_OPEN_HIGH_INCIDENTS H

    WHERE NVL (VH. CLASSIFICATION, 0) = NVL(H.CLASSIFICATION,0)

    AND VH. IMPORTANCE IN (1,2)

    AND H.IMPORTANCE IN (1,2)

    AND NVL (VH. OT_GROUP, 0) = NVL(H.OT_GROUP,0)

    AND VH. IMPORTANCE = H.IMPORTANCE

    AND VH. TIME_STAMP = H.TIME_STAMP

    );

  • Select the data from collections plsql

    Hi all

    I'm not a developer but working as a DBA, so not very familiar with pl/sql, always crossed with documentation and could lead to a solution of my problem. I need advice from expert here.

    Problem: I am writing in a kind of special program plsql for surveillance of certain lots, I know that we have much option to do the same db/grid control including... etc but for some
    the reason I have to do this, use only plsql.

    Requirement: my requirement is to select data in the plsql table and then have the opportunity to ask questions again and again. I prefer not to go to table, rather than directly from plsql...

    I wrote below the code for the sample, bulk data in collection type collection and can print using the loop.

    Declare
    TS type is table v$ session % rowtype index by pls_integer;
    tsess ts.
    Start
    Select * bulk collect into tsess from v$ session;
    I'm looping 1.tsess.count
    dbms_output.put_line (tsess (i) .terminal);
    end loop;
    end;
    /

    But is it possible same collection (tsess in the example above) can be queried using a select as ' select * from table (Tsess) "I searched the net and found this can be done using create type at the database level.» But my problem is that I can't create any object in the database as being it's a production one.

    I was looking as if is it possible even can be accomplished... as cast / multiset... However, I could not get it through.

    your help would be appreciated!

    Kind regards

    I don't think you should use the tables here, only SQL, take a look at the factors of subquery and will indicate if it is not enough...

    Published by: BrendanP on February 12, 2012 03:07 for an example:

    I understand you want to "Refresh" of data that you already have the database purely to be able to use the SQL such as ORDER BY in multiple ways. Here's how you can do it in the original SQL for a particular example, where you query v$ sql time control processor and disk reads separately (I tested it but the result won't be good look here, so omitting it):

    WITH v AS (
    SELECT
        Substr (sql_text,1,500)             sql_text,
        cpu_time/1000000                    cpu_seconds,
        disk_reads,
        buffer_gets,
        executions,
        CASE WHEN rows_processed != 0 THEN Round( buffer_gets / Nvl (Replace (rows_processed, 0, 1) ,1)) END Buffer_gets_rows_proc,
        Round (buffer_gets / Nvl (Replace (executions, 0, 1), 1)) Buffer_gets_executions,
        elapsed_time / 1000000              elapsed_second,
        module
    FROM v$sql s)
    SELECT
        'CPU'                order_by,
        cpu_seconds          order_val,
        sql_text,
        cpu_seconds,
        disk_reads,
        buffer_gets,
        executions,
        buffer_gets_rows_proc,
        buffer_gets_executions,
        elapsed_second,
        module
    FROM v
     UNION
    SELECT
        'Disk reads',
        disk_reads,
        sql_text,
        cpu_seconds,
        disk_reads,
        buffer_gets,
        executions,
        buffer_gets_rows_proc,
        buffer_gets_executions,
        elapsed_second,
        module
    FROM v
    ORDER BY order_by, order_val DESC
    

Maybe you are looking for

  • I need to keep a message from a number idk so stuck?

    I have a number that will be the text me, I do not know this person and did know that I do not want their text me.  They continued to text me, so I blocked the number (I went to the details and clicked on the i and scroll down to the block caller). M

  • I have not received my book money. Help, please.

    A few days ago, I posted a book in the Ibook Store and my friend bought. 18 days ago and I have not yet received the money. Help, please.

  • How to write the table 1 d of labview to Excel line wise?

    Hello, I'm cooler in labview and want to learn it thanks to you all and of course myself. I 1-d arrays of strings and I want to save in excel file one by one and line by line. designates a 1 d in a line chart, the next time, a neighbor on the next ro

  • stop a secondary vi

    I have a program consisting of a main vi which calls one of the three different sub-panels based on a number entered. I can leave the school very well and then use a different one with a different number, but I also want to stop the entire program wi

  • Cannot access the server gmail via any web browser; code 105 error message cannot access server

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: have cleared cache, spilled all saved passwords and I can not even access accounts gmail via Google Chrome; Internet Explorer or Firefox.