Forum Discussion

Mirithu's avatar
Mirithu
Icon for Helper II rankHelper II
6 years ago
Solved

Create Temporary Table Statement In Power BI Desktop

Hi,

 

I have two create temporary table statements - one in tsql and the other in plsql - both of which run in their native databases. But when I run them in Power BI desktop using Get Data option, the tsql statement runs successfully, but the plsql one fails with the error message 'Oracle: ORA-00922: missing or invalid option'

 

What am I doing wrong, or is the create temporary table in Oracle not supported in Power BI?

 

Here are the statements:

 

TSQL

 

CREATE TABLE #TBL
(
LINE1 VARCHAR(50) NOT NULL,
LINE2 INT NULL,
LINE3 DATETIME
);

INSERT INTO #TBL VALUES ('FIRST',1,GETDATE())
INSERT INTO #TBL VALUES ('SECOND',2,GETDATE())
INSERT INTO #TBL VALUES ('THIRD',3,GETDATE())

SELECT * FROM #TBL

 

PLSQL

 

CREATE GLOBAL TEMPORARY TABLE TBL
(
LINE1 VARCHAR(10),
LINE2 VARCHAR(10),
LINE3 DATE
)
ON COMMIT DELETE ROWS;


INSERT INTO TBL VALUES('FIRST','1',SYSDATE);
INSERT INTO TBL VALUES('SECOND','2',SYSDATE);
INSERT INTO TBL VALUES('THIRD','3',SYSDATE);

 

SELECT * FROM TBL

 

  • Mirithu 

    The temporary Table is session-specific or the data is session-specific.  Also, it needs access to temp schema. So if the power BI session does not create it or does not insert data into it it will not see the table or data.

     

    What is the need of using Temporary table in BI

     

3 Replies

  • Mirithu 

    The temporary Table is session-specific or the data is session-specific.  Also, it needs access to temp schema. So if the power BI session does not create it or does not insert data into it it will not see the table or data.

     

    What is the need of using Temporary table in BI

     

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity Support

    Hi , Mirithu 

    Maybe  you can take a try to use  “varchar2(255)”    instead of “ VARCHAR(10)”  and see whether it will fail with error message.

     

    Best Regards,
    Community Support Team _ Eason

     

    • Mirithu's avatar
      Mirithu
      Icon for Helper II rankHelper II

      Hi v-easonf-msft 

       

      Thank you for you help, but it did not work - still gave the error.

       

      Kind regards.