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 8629099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:43:01+00:00 2026-06-12T08:43:01+00:00

Im using the Grails database migration plugin by liquibase. Im trying to use aPLSQL

  • 0

Im using the Grails database migration plugin by liquibase. Im trying to use aPLSQL statement in the migration to find and remove a constraint on a table, im using this approach as i dont know the name of the constraint and it will vary on different systems i use.

Some notes:

  • Grail 1.3.7
  • Database-migration 1.0

This is the code from the migration

sql("declare\n" +
      "vOldName all_constraints.constraint_name%TYPE\n" +
    "begin\n" +
      "select CONSTRAINT_NAME\n" +
      "into   vOldName\n" +
      "from   all_constraints\n" +
      "where  TABLE_NAME='TABLENAME' and CONSTRAINT_TYPE='U' and OWNER='USERNAME'\n" +
      "execute immediate 'alter table USERNAME.TABLENAMEdrop constraint '\n" +
      "|| vOldName\n" +
    "end")

When i run this i get the following error:

java.sql.SQLException: ORA-06550: line 3, column 1:
  PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
    := ( ; not null range default character
  The symbol ";" was substituted for "BEGIN" to continue.

I have tried to add ; to the end of each statement but it them complains about seeing end-of-file in the code.

Any help please ?

  • 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-06-12T08:43:02+00:00Added an answer on June 12, 2026 at 8:43 am
    sql("declare\n" +
          "vOldName all_constraints.constraint_name%TYPE;\n" +
        "begin\n" +
          "select CONSTRAINT_NAME\n" +
          "into   vOldName\n" +
          "from   all_constraints\n" +
          "where  TABLE_NAME='TABLENAME' and CONSTRAINT_TYPE='U' and OWNER='USERNAME';\n" +
          "execute immediate 'alter table USERNAME.TABLENAME drop constraint '\n" +
          "|| vOldName;\n" +
        "end;")
    

    I think this will fix it. A PL/SQL block needs a semicolon after each statement. The only thing that doesn’t need a semicolon is dynamic SQL. Also, there was a missing space between TABLENAME and drop.

    It might help to first make sure the code works in SQL*Plus, or some other database tool. And then paste it into a multi-line string.

    Let me know if it doesn’t work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Grails 1.3.7 + MySQL 5.5 + Liquibase through the database-migration plugin 0.2.1.
Using Grails database-migration I have a table in production defined like so: +--------------+------------+------+-----+---------+----------------+ |
When I use the Grails Database Migration Plugin and run a dbm-gorm-diff (for example,
I have been using the Grails database-migration plugin during development of my application, and
I am trying to query a database within grails using: def per = User.get(springSecurityService.principal.id)
Using mongodb in grails i am trying to get a hold of the database
I'm trying to connect my application to Shared Database 5MB using grails tutorial. I'm
When using Grails 1.1 together with a MySQL the charsets of the auto-generated database
We are using Grails with a legacy database and we need to control how
I plan to build a database management system using Grails as the main framework.

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.