The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Auto-substitute * in SQL

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Stefan_Wak Posted - 06/23/2020 : 06:26:51 AM
Hello!
When trying the following SQL-Querry, /* xxx */ is replaced by a newline (\n).
I am trying to collect data of multiple files via DRILL.

SELECT `p`.`dir0` FROM `dfs.data`.`./smardFT/v1/*/parameters.parquet` as p INNER JOIN `dfs.data`.`./smardFT/v1/*/parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`

Resulting to this:
SELECT * FROM (SELECT `p`.`dir0` FROM `dfs.data`.`./smardFT/v1
parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`) WHERE ROWNUM <= 50

Executing the same Querry with Drill Explorer return the data.


Origin Ver. and Service Release (Select Help-->About Origin): 2020b, 9.7.5.184
Operating System: Win 10
4   L A T E S T    R E P L I E S    (Newest First)
Stefan_Wak Posted - 06/25/2020 : 04:47:47 AM
Ok, i will try the backslash on tuesday, when i am back in office.

Thanks
Stefan
Chris D Posted - 06/23/2020 : 12:33:52 PM
Well I owe you an apology. It does appear that Origin somehow does convert content between /* and */ (inclusive) into newline. I don't know why it would.

What happens when you try to use backslash for path separators?

Thanks,
Chris Drozdowski
Originlab Technical Support
Stefan_Wak Posted - 06/23/2020 : 11:06:18 AM
I got the resulting SQL-query from the "Web-Interface" from our DRILL-Server. The Server has a list of the last 100 queries with state an duration, ...

"Drill Explorer" is using the same ODBC driver.

And the Origin SQL-Editor also show this message, if i click the preview button:
Microsoft OLE DB Provider for ODBC Drivers: [MapR][Drill] (1040) Drill failed to execute the query: SELECT * FROM (SELECT `p`.`dir0` FROM
`dfs.data`.`./smardFT/v1
parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`) WHERE ROWNUM <= 50
[30038]Query execution error. Details:[
PARSE ERROR: Lexical error at line 2, column 25. Encountered: "\n" (10), after : "`./smardFT/v1"


In the Origin SQL-Editor the following part of the query is formatet green, like a comment in C
/*/parameters.parquet` as p INNER JOIN `dfs.data`.`./smardFT/v1/*/



When trying the following:
select * from file/*/does_not/*/exist

In Origin i got this error (missing /*/does_not/*/ -> replaced with a newline):
Microsoft OLE DB Provider for ODBC Drivers: [MapR][Drill] (1040) Drill failed to execute the query: select * from file
exist

With Drill-Explorer is got the following error (with the complete query):
[MapR][Drill] (1040) Drill failed to execute the query: select * from file/*/does_not/*/exist
[30038]Query execution error. Details:[
VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 'file' not found
Chris D Posted - 06/23/2020 : 09:00:37 AM
Hi,

How do you know the query gets re-written? That is, where do you find out that is the case?

Origin itself will not rewrite the query like that but perhaps the Drill ODBC driver does.

It would be fairly impossible for us to duplicate your system to test and give you a definite answer.


Thanks,
Chris Drozdowski
Originlab Technical Support

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000