Skip to main content
Question

Select * into * not allowed in sql executor?

  • November 5, 2019
  • 7 replies
  • 141 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.

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • 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
  • 21 replies
  • 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+22
  • Contributor
  • 2179 replies
  • 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
  • 21 replies
  • November 5, 2019

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+22
  • Contributor
  • 2179 replies
  • November 5, 2019

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
  • 8394 replies
  • 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
  • 21 replies
  • 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;