Skip to main content
Question

Select * into * not allowed in sql executor?

  • November 5, 2019
  • 7 replies
  • 127 views

fpakzat
Contributor
Forum|alt.badge.img+3

Hi all,

I'm running into this error when I try to run some queries inside SQLExecutor.

Select * into * not allowed in sql executor

is there any other way around?

 

Thanks.

 

 

7 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • November 5, 2019

Select * into .. is PL/SQL code.

If you want to select multiple attributes, use:

Select * From <table>

And define the attributes to expose in the parameter.

Hope this helps.


fpakzat
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • November 5, 2019

Thanks for your response but that was not my point. Apologize for not making myself clear.

 

I have the "From <table>" there but the error's coming from not allowing my "Into <table>" part,

 

i.e. select A.cola, A.colb, B.cola, B.colB into new_table_c from A, B where A.id=B.id;

 


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • November 5, 2019

Do you mean:

Insert * from <table> into <new table> ?

This will insert records from the table into a new table.


fpakzat
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • November 5, 2019
erik_jan wrote:

Do you mean:

Insert * from <table> into <new table> ?

This will insert records from the table into a new table.

no, I meant: select attr1, attr2,... into table_c from tablea, tableb where tablea.id=tableb.id;


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • November 5, 2019
fpakzat wrote:

no, I meant: select attr1, attr2,... into table_c from tablea, tableb where tablea.id=tableb.id;

Insert into table_c

select tablea.attr1, tableb.attr2, ..

from tablea, tableb

where tablea.id = tableb.id


david_r
Celebrity
  • November 6, 2019

Tip: Since the SQLExecutor doesn't have a syntax (the statements are simply forwarded to the server), it's usually very helpful to tell us which database backend you're working with.


fpakzat
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • November 26, 2019

I fixed this issue by changing my query from:

select A.col1, A.col2, B.col1, B.col2 into new_table_name from A, B where A.id = B.id;

 

to

 

Create table new_table_name as

select A.col1, A.col2, B.col1, B.col2 from A, B where A.id = B.id;


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings