cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
soptim_vond
Frequent Visitor

Is it possible to include multiple SQL-Statements in one query (ORACLE)?

Hi folks,

 

usually, working with an oracle database in a standard SQL-editor multiple sql-statements can be entered in one query separated by a semicolon. However, when I try to do that in Power BI, I always get the following error:

ORA-00933: SQL command not properly ended

 

Is there a way to get around this?

 

Separating the two statements is not an option because the order in which they are processed matters and manipulating query order in Power BI is tricky...

 

Thanks in advance,

 

Nico

6 REPLIES 6
Anonymous
Not applicable

Hi soptim_vond,

 

It seems that your query has ended up with the incorrect syntax.

 

Please go through the below URL.

https://www.techonthenet.com/oracle/errors/ora00933.php

 

Regards,

Pradeep

Hi Pradeep,

 

thanks for reply, but the syntax is correct. The statement containing the two substatements separated by a semicolon works fine in a standard SQL-editor. And both substatements work in power bi as well, as long as I put them in seprate queries. Things go wrong as soon as I use a semicolon to separate the two statements.

 

Regards,

 

Nico 

Anonymous
Not applicable

Hi Nico,

 

Can you just send me that query?

 

Because, Power BI will not support ;(semicolon) in SQL Editor. You need to have oracle connector to establish the connection with Oracle DB.

 

If you are using SQL Editor for your Oracle query, then it is wrong.

Or, you can split these two tables and make relations in the data model and then move to further development.

 

Regards,

Pradeep

Thanks a lot for you comment! 

You have saved a lot of days searching for the resolution of my problem!

Hi Pradeep,

 

I´m not sure I get the part about the oracle connector, but here´s my m code from the advanced editor:

 

let

Quelle = Oracle.Database("se.trunk", [Query="
DELETE
FROM PMS_OWNER.VB_LIM_TB_REPORT_TEMPDATA RTDB
WHERE rtdb.RTDB_CLIENT = SYS$UTIL.machine || SYS$UTIL.osuser;
insert into lim_owner.tb_report_tempdata
(rtdb_client, rtdb_item, rtdb_value_number, rtdb_value_string, rtdb_value_datum, rtdb_produkt)
values
(SYS$UTIL.machine || SYS$UTIL.osuser, 'MND', 62, NULL, NULL, 'PMS')
", HierarchicalNavigation=true])

in
Quelle

 

(I know using transactional SQL is not recommended... :))

Regards,

 

Nico

Hi @soptim_vond @Egor_Kurkin ,

This is not working for me.

let
Source = Oracle.Database("hyd1225d.india", [Query="select * from APG0_BANK_ACCOUNTS;select * from APG0_CHECKS",HierarchicalNavigation=true])
in
Source

 

It's throwing error like DataSource.Error: Oracle: ORA-00933: SQL command not properly ended.

can you please help me.

Thanks,

Rajyalakshmi.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors