Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Direct Discovery for mySQL

Hi,

I'm developing an application which required Direct Discovery. I tested using the MSSQL, I got no problem in developing the application. But now I need connect to another database type which is mySQL, but when I reload the script, error from the DIRECT QUERY statement.

SQL##f - SqlState: 37000, ErrorCode: 1064, ErrorMsg: [MySQL][ODBC 5.3(w) Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[ServiceNo] FROM [branchs].[stuservice]' at line 1

Please advice. Or anyone have the sample code for direct discovery in mySQL?

Regards,

CS Khoo

1 Solution

Accepted Solutions
Bill_Britt
Former Employee
Former Employee

Hi,

This is the only thing I could find.

Direct discovery can be used in conjunction with MySQL and MS Access but may require the

following parameters in the set variables due to the quoting characters used in these sources:

SET DirectIdentifierQuoteChar='``';

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.

View solution in original post

11 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

Can you post the entire SQL query here?  Have you run the statement successfully against MySQL directly?

Steve

rbecher
MVP
MVP

Hi,

MySQL has different SQL syntax than MSSQL..

- Ralf

Astrato.io Head of R&D
Not applicable
Author

No, when the script start to run the 1st column, then error. If not using any direct discovery function, I managed to read every tables as usual.

Below are the statement.

ODBC CONNECT TO QlikQMS (XUserId is fBMYMZdNPDdeP, XPassword is YWaGDZdNPDdCDZMGPG);

DIRECT QUERY

  dimension

  ServiceNo,

  BranchCode

    measure

    CurrTicket,

    NextTicket,

    PhysicalTicketWaiting,

    TransferTicketWaiting,

    PhysicalTicketIssued,

    TransferTicketIssued,

    PhysicalTicketServed,

    TransferTicketServed,

    PhysicalTicketCalled,

    TransferTicketCalled,

    PhysicalTicketRenegaded,

    TransferTicketRenegaded,

    TicketTransferredOut,

    AvgWTSec,

    AvgSTSec,

    AvgTTSec,

    CurrWTSec,

    CurrSTSec,

    TotalWTSec,

    TotalSTSec,

    TotalTTSec,

    TotalWithinTgtWT,

    TotalWithinTgtST,

    TotalWithinTgtTT,

    CurrTicketIssueTime,

    CurrTicketStr,

    NextTicketStr,

    UpdateTimeStamp,

    ServiceState,

    LastStatusTime,

    GroupTicketCount

    detail

    CounterOpened  

FROM branchqms.stuservice;

Not applicable
Author

Any idea how to solve?

rbecher
MVP
MVP

No, the Direct Query syntax seems to be correct.

Astrato.io Head of R&D
rbecher
MVP
MVP

I think it's probably the created SQL in the background and MySQL doesn't like the brackets...

Btw. you can trace those SQL statements in the ODBC driver.

Astrato.io Head of R&D
Bill_Britt
Former Employee
Former Employee

Hi,

This is the only thing I could find.

Direct discovery can be used in conjunction with MySQL and MS Access but may require the

following parameters in the set variables due to the quoting characters used in these sources:

SET DirectIdentifierQuoteChar='``';

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Not applicable
Author

Please advice how to trace the statement?

Not applicable
Author

Yes, I did applied this.