Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3396134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:22:17+00:00 2026-05-18T04:22:17+00:00

i have some complex select and result need to place in the table. I

  • 0

i have some complex select and result need to place in the table.
I try this:

INSERT INTO SAMGUPS_STATISTIC_STANTION
(SAMGUPS_STATISTIC_STANTION_SEQ.nextval)
(
with PRG as (
select
 ID_OBJ
from PEREGON where ID_STAN1=&arrival
),
STN_OBJ as (
          select
          distinct ID_OBJ_P as ID_OBJ
          from TMO start with ID_OBJ=&dispatch
          connect by prior ID_OBJ_P=ID_OBJ
),
STAN as (
          select
          A_TOP.ID_POEZD
          ,A_TOP.vrsvop
          from STN_OBJ inner join A_TOP on A_TOP.ID_OBJ=STN_OBJ.ID_OBJ and A_TOP.KODOP_P in ('01','07')
          left join A_POEZD_ATR ATR on ATR.ID_POEZD=A_TOP.ID_POEZD and ATR.VRSVOP=A_TOP.VRSVOP
          WHERE ATR.NOM_POEZD LIKE '____'
),
DATA_RESULT as 
(
          select
          /*count(*) over() as TotalCount*/
          to_char(&dispatch) as dispatch
          ,to_char(&arrival) as arrival
          ...
          ,ATR.PR_N_V_PZ
          from PRG inner join A_TOP on A_TOP.ID_OBJ=PRG.ID_OBJ and  A_TOP.KODOP_P in ('03','07')
                    left join A_POEZD_ATR ATR on ATR.ID_POEZD=A_TOP.ID_POEZD and ATR.VRSVOP=A_TOP.VRSVOP
                    inner join STAN STN on STN.ID_POEZD = ATR.ID_POEZD  
                    WHERE ATR.NOM_POEZD LIKE '____'
                    order by A_TOP.ID_POEZD
)
SELECT * FROM DATA_RESULT);

i have error:

Error at Command Line:71 Column:25
Error report:
SQL Error: ORA-32034: unsupported use of WITH clause
32034. 00000 -  "unsupported use of WITH clause"
*Cause:    Inproper use of WITH clause because one of the following two reasons
           1. nesting of WITH clause within WITH clause not supported yet
           2. For a set query, WITH clause can't be specified for a branch.
           3. WITH clause can't sepecified within parentheses.
*Action:   correct query and retry

Whether there is to circumvent these restrictions?
May be possible result of select place into variable and then using variable insert to table?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:22:18+00:00Added an answer on May 18, 2026 at 4:22 am

    WITH clause can’t sepecified within parentheses.

    try rewrite smth like this

    INSERT INTO SAMGUPS_STATISTIC_STANTION
    with PRG as (
    select
     ID_OBJ
    from PEREGON where ID_STAN1=&arrival
    ),
    STN_OBJ as (
              select
              distinct ID_OBJ_P as ID_OBJ
              from TMO start with ID_OBJ=&dispatch
              connect by prior ID_OBJ_P=ID_OBJ
    ),
    STAN as (
              select
              A_TOP.ID_POEZD
              ,A_TOP.vrsvop
              from STN_OBJ inner join A_TOP on A_TOP.ID_OBJ=STN_OBJ.ID_OBJ and A_TOP.KODOP_P in ('01','07')
              left join A_POEZD_ATR ATR on ATR.ID_POEZD=A_TOP.ID_POEZD and ATR.VRSVOP=A_TOP.VRSVOP
              WHERE ATR.NOM_POEZD LIKE '____'
    ),
    DATA_RESULT as 
    (
              select
              /*count(*) over() as TotalCount*/
              to_char(&dispatch) as dispatch
              ,to_char(&arrival) as arrival
              ...
              ,ATR.PR_N_V_PZ
              from PRG inner join A_TOP on A_TOP.ID_OBJ=PRG.ID_OBJ and  A_TOP.KODOP_P in ('03','07')
                        left join A_POEZD_ATR ATR on ATR.ID_POEZD=A_TOP.ID_POEZD and ATR.VRSVOP=A_TOP.VRSVOP
                        inner join STAN STN on STN.ID_POEZD = ATR.ID_POEZD  
                        WHERE ATR.NOM_POEZD LIKE '____'
                        order by A_TOP.ID_POEZD
    )
    SELECT SAMGUPS_STATISTIC_STANTION_SEQ.nextval,  DATA_RESULT.* FROM DATA_RESULT;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some complex stored procedures that may return many thousands of rows, and
I have some classes layed out like this class A { public virtual void
I have some code like this in a winforms app I was writing to
I have been working on quite a complex accordion/form recently and have a select
I have a script that appends some rows to a table. One of the
i have a input tag which is non editable, but some times i need
I have some numbers which will be part of an sql query, like this...
I have some UI in VB 2005 that looks great in XP Style, but
I have some ASP.NET web services which all share a common helper class they
I have some code for starting a thread on the .NET CF 2.0: ThreadStart

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.