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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:40:44+00:00 2026-05-27T09:40:44+00:00

My situation is that I need to create DB partitions on the fly at

  • 0

My situation is that I need to create DB partitions on the fly at certain times. I’m using a Statement like the following:

alter table table_name split partition default_partition values (' +
id + ') into (  partition " + partitionName + ", partition
default_partition) update indexes

This works fine and does exactly what I expect. However, the value of id comes from input that an unauthorized person could potentially access. So, the above statement is vulnerable to an SQL injection attack. I would like to use a PreparedStatement, but I cannot figure out how.

The problem is that the partition table in oracle puts the “id” value into the HIGH_VALUE column which is a LONG. I see no appropriate setter to do this (since String can’t work). I’ve tried using the various stream messages, with both a StringReader and ByteArrayInputStream as the value to no avail. I know LONGs aren’t supposed to be used anymore but that’s the way Oracle has it so I can’t really get around it.

When I try with any of those ways, this is what I get:

ORA-14308: partition bound element must be one of: string, datetime or interval literal, number, or NULL

The Oracle doc has good info on how to get a LONG (the oracle data type, which is like a LOB) but not how to set it. Could anyone help me with this? I’ve also looked into the Oracle implementation of the JDBC driver but it too doesn’t seem to have a setLONG type method. Is there a way I can do this?

  • 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-27T09:40:45+00:00Added an answer on May 27, 2026 at 9:40 am

    You cannot use bind variables with DDL. You’re not going to be able to use a PreparedStatement and call any setXXXX methods in your DDL statement.

    Splitting partitions on the fly based on user input is, at the very least, a very unusual design. I would tend to suspect that you’d be better served with something like interval partitioning where Oracle takes care of creating new partitions when they are needed or hash partitioning rather than range partitioning. Assuming it truly makes sense to manually create new partitions on the fly, however, you’ll have to write code to validate that the ‘id’ and ‘partitionName’ values are valid in order to prevent SQL injection.

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

Sidebar

Related Questions

The situation is, that i need to create table in grid view looking like
Here is my situation. I need to create a report that shows each open
Situation: I need to make an imap client (using java mail api) that if,
I'm in this situation that i need a list of lists. for instance i
I am in kind of situation that I need to start with a tab
I have a situation that I solved in the following way: //cube_potentials is float8
We have a product that we need to create an installer for. It has
I ran into the situation that I need a way to edit the data
I need to create a function that is only necessary inside one cshtml file.
Hey I usually run into a situation where I will create a class that

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.