• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To get the size of the String

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Let me give a gist of my situation. I am passing a comma delimited String of SSNs (eg. 1234567890,0987654321,2345678901,3456789012)as a argument for a Stored procedure. But the problem is that, the parameter in Stored procedure can only accept a Max size of 32k. I have more probability that this String of SSN is more than 32k.
so my first question would be
1. How do i find the size of the string?
let me know what i did is right
int len = ssn.length();
int size_In_Bytes = len/1024;
2. Can anyone help me with a logic, about how to pass this string in pieces of less than 32k to the stored procdure, but at the same time making sure that SSN is passed completely.
I really appreciate an answer ASAP. Thanks in advance
Regards,
vikram
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use a StringTokenizer to parse the SSNs out and call the stored procedure on each SSN (looping through them one at a time).
 
vikram nalagampalli
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neal Su:
You could use a StringTokenizer to parse the SSNs out and call the stored procedure on each SSN (looping through them one at a time).


Thanks fro your reply
can you be a little more detail.
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming you're operating under UTF-8, every digit in every social security number that I'm aware of (granted, that's us only) can be represented in eight-bit bytes, therefore, I can't imagine a social security number exceeding a 32,000 bit limitation in the database.
Here's use of a tokenizer:

Good luck,
Cory Wilkerson
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic