Home » SQL & PL/SQL » SQL & PL/SQL » Create table from Query w/longs and ORDER BY requirements
Create table from Query w/longs and ORDER BY requirements [message #6490] Mon, 21 April 2003 12:58 Go to next message
Jeff Trate
Messages: 2
Registered: April 2003
Junior Member
I want to generate a report for a user who provides four parameters. The source table contains LONGS so I have a problem with "CREATE TABLE tblNEW AS SELECT ..." logic because of the LONG "ORA-00997: illegal use of LONG datatype". The original query has an "ORDER BY" clause also not acceptable in the CREATE TABLE syntax.

I know this seems to be a fairly common question but none of the suggested answers are leaping out at me.

I am using Oracle 8i and I would prefer a procedure/table or Crystal Reports solution as opposed to the current .ASP solution.

Thanks in advance!
Re: Create table from Query w/longs and ORDER BY requirements [message #6491 is a reply to message #6490] Mon, 21 April 2003 13:16 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
If this is a report, why are you creating a table? How about just returning the query back to CR as a REF CURSOR?

Re: Create table from Query w/longs and ORDER BY requirements [message #6496 is a reply to message #6490] Mon, 21 April 2003 14:23 Go to previous messageGo to next message
Jeff Trate
Messages: 2
Registered: April 2003
Junior Member
Thanks Todd.

What is CR?

Looking through my documents, I have a choice of a weak or strong cursor. How can I get the results back into Crystal or .ASP?

Thanks.
Re: Create table from Query w/longs and ORDER BY requirements [message #6498 is a reply to message #6496] Mon, 21 April 2003 15:35 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Sorry, CR was my shorthand for Crystal Reports.

As far as strong vs. weak ref cursor, it depends. If you can define it (base it's type on an existing rowtype or record type definition), then go ahead. Some tools only work correctly with strong, but many are just fine with weak because they can parse out the columns and metadata.

Crystal fully supports REF CURSORS. You would set up the PL/SQL code as in the link I provided earlier. In Crystal, you define the source of the data as a REF CURSOR. More details are available in the CR docs. There's also an ASP example in the link.
Previous Topic: ORA-01652:
Next Topic: union all
Goto Forum:
  


Current Time: Fri Apr 26 19:26:25 CDT 2024