Re: Lookup specific string in all-tables
- From: Keith <keith.wingate@xxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Dec 2007 06:52:27 -0800 (PST)
On Dec 13, 9:26 am, Eric Fung <wkfung.e...@xxxxxxxxx> wrote:
Thanks Keith, using the combine of BCP and GREP shall also do the
trick. Just one more question, regarding to your valuable solution.
What about the table size is huge, would BCP still gonna be the
suitable way to go?
(Sorry that it should be a different topic)
Eric.
On 12月13日, 下午8時00分, Keith <keith.wing...@xxxxxxxxxxxxxxxxx> wrote:
On Dec 12, 8:15 am, David Kerber
<ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In article <f5a755b8-feed-4c2b-a53c-
44e02086b...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, wkfung.e...@xxxxxxxxx
says...
Hi I am new to sybase,
May I know how I can find a specific string (filename in one of the
column in one of the table) in a database in which the table's name is
unknown?
I've read a simular article, saying that the only way to do this is to
open a cursor and run through the sysobjects table.
That's pretty much it. Get a list of the user tables and check each of
them for the piece of data you're looking for. If you don't know the
field name either, then you'll also need to scan through the fields list
for each table.
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Depending on the size of the database it may be easier to:
1) Dump your data to flat files using, e.g. dbschema.pl & bcp.
2) "grep" / "find" the search string in the dumped data.
Keith- 隱藏被引用文字 -
- 顯示被引用文字 -
You can bcp the rows out of the table, no matter how big it is AFAIK.
Things to look out for:
1) Make sure you have space. The bcp file for a larger table might be
as large as the dataspace for the table, in my experience.
2) Time. Although bcp is very fast, it still takes time.
3) Filesize limitation in your filesystem. Know what it is. Make
sure you don't have ulimit set. You can get around this by
bcp'ing out the data in separate files, but that' s more work.
It sounds like you've got some good help in the right direction: doing
it in-db. I would consider this a last resort.
Keith
.
- References:
- Lookup specific string in all-tables
- From: wkfung . eric
- Re: Lookup specific string in all-tables
- From: David Kerber
- Re: Lookup specific string in all-tables
- From: Keith
- Re: Lookup specific string in all-tables
- From: Eric Fung
- Lookup specific string in all-tables
- Prev by Date: Re: Lookup specific string in all-tables
- Next by Date: What is the cause of this error message
- Previous by thread: Re: Lookup specific string in all-tables
- Next by thread: What is the cause of this error message
- Index(es):
Relevant Pages
|
|