Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write SQL query on more than one line #437

Open
daniaalkhalil opened this issue Nov 3, 2015 · 5 comments
Open

Write SQL query on more than one line #437

daniaalkhalil opened this issue Nov 3, 2015 · 5 comments

Comments

@daniaalkhalil
Copy link

we get an error in execution of the test case when we have to write an sql queries and we put it on more Than 1line

@daniaalkhalil daniaalkhalil changed the title Write query on more than one line Write SQL query on more than one line Nov 3, 2015
@MMatten
Copy link
Contributor

MMatten commented Nov 8, 2015

Can you please post an example of the test here?

I take it you've already tried enclosing your SQL code with !- and -!? E.g. as in https://github.com/dbfit/dbfit/blob/master/FitNesseRoot/DbFit/AcceptanceTests/JavaTests/OracleTests/FlowMode/MultiLineQueries/content.txt.

@javornikolov
Copy link
Contributor

@daniaalkhalil, in general there is a trouble with multi-line mode and <, > characters. To check if that's the issue in our case: you may test what happens if you're using e.g. just = instead of <=.

@Dan-Co
Copy link

Dan-Co commented Aug 29, 2017

Hi @javornikolov
We have just started looking at DBFit for Oracle.
However, we have come accross this issue for complex SQL statements containing < and >

Using the multi-line code and < and >

This issue was a while ago, are there any reccomended workarounds considering we actually need the < and > operators in our SQL?

I am tryign to create a dummy test case, but it seems it doesnt always hit the issue.

For example, both of the below actually work ok...

!|Query|!-
select case when sysdate < sysdate +1 then 'X' else 'Y' end as dummy
from dual 
where 1 < 2
-!|
|DUMMY|
|X|

|Ordered Query|!-
SELECT ROWNUM n FROM ( 
  SELECT 1 FROM dual 
  CONNECT BY LEVEL < 4 
)-!|
|n|
|1|
|2|
|3|

I will continue to try and force a test case, but it seems this is a known limitation from a few posts ive read...

@javornikolov
Copy link
Contributor

Yes, this has problem with multiline queries. I'm not sure if I tried to use some define bar instead < and > characters.

@andreasmarkussen
Copy link

Workarround is to use BETWEEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants