 |
|
 |
|
Next: Project Lead (Data Warehousing) - Openings in a l..
|
| Author |
Message |
External

Since: Dec 12, 2007 Posts: 1
|
(Msg. 1) Posted: Wed Dec 12, 2007 4:20 am
Post subject: Lookup specific string in all-tables Archived from groups: comp>databases>sybase (more info?)
|
|
|
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.
Can any one please give me some ideas? on how to tackle this problem?
Appreciate that.
Eric. >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: May 11, 2006 Posts: 34
|
(Msg. 2) Posted: Wed Dec 12, 2007 9:15 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <f5a755b8-feed-4c2b-a53c-
44e02086b8de.RemoveThis@e10g2000prf.googlegroups.com>,
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). >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: Dec 13, 2007 Posts: 3
|
(Msg. 3) Posted: Thu Dec 13, 2007 1:35 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hi Dave,
May you give me an example of how to do that?
Eric
On 12$B7n(B12$BF|(B, $B2<8a(B10$B;~(B15$BJ,(B, David Kerber
wrote:
> In article <f5a755b8-feed-4c2b-a53c-
> 44e02086b... RemoveThis @e10g2000prf.googlegroups.com>,
> 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). >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: Apr 17, 2007 Posts: 9
|
(Msg. 4) Posted: Thu Dec 13, 2007 4:00 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Dec 12, 8:15 am, David Kerber
wrote:
> In article <f5a755b8-feed-4c2b-a53c-
> 44e02086b... RemoveThis @e10g2000prf.googlegroups.com>,
> 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 >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: Dec 13, 2007 Posts: 3
|
(Msg. 5) Posted: Thu Dec 13, 2007 7:26 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
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$B7n(B13$BF|(B, $B2 wrote:
> On Dec 12, 8:15 am, David Kerber
>
>
>
>
>
> wrote:
> > In article <f5a755b8-feed-4c2b-a53c-
> > 44e02086b....DeleteThis@e10g2000prf.googlegroups.com>,
> > 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- $Bp,i6Ho0zMQJ8;z(B -
>
> - $Bp}<(Ho0zMQJ8;z(B - >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: Dec 13, 2007 Posts: 3
|
(Msg. 6) Posted: Thu Dec 13, 2007 7:51 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Thanks Dave, as long as I can find all the tables' name from
sysobjects, I will be able to write a script and BCP all the tables.
That shall be a lot easier and relatively not time consuming.
Eric.
(PS, I will definitely try combining sp_alltables_rowcount (search
from internet, it gave me an idea of using cursor) and sp_columns
(returns all the column) together)
On 12$B7n(B13$BF|(B, $B2<8a(B9$B;~(B59$BJ,(B, David Kerber
wrote:
> In article <2ae0000d-cb87-4dac-b1d0-47afd911daa9
> @e6g2000prf.googlegroups.com>, says...
>
> > Hi Dave,
>
> > May you give me an example of how to do that?
>
> I would have to do as much research as you would, since I've never had a
> need to do this. Check the help contents of your DB version for the
> names and layouts of the system tables, and that should get you started.
>
> ....
>
> --
> Remove the ns_ from if replying by e-mail (but keep posts in the
> newsgroups if possible). >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: May 11, 2006 Posts: 34
|
(Msg. 7) Posted: Thu Dec 13, 2007 8:59 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <2ae0000d-cb87-4dac-b1d0-47afd911daa9
@e6g2000prf.googlegroups.com>, says...
> Hi Dave,
>
> May you give me an example of how to do that?
I would have to do as much research as you would, since I've never had a
need to do this. Check the help contents of your DB version for the
names and layouts of the system tables, and that should get you started.
.....
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible). >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
External

Since: Apr 17, 2007 Posts: 9
|
(Msg. 8) Posted: Fri Dec 14, 2007 6:52 am
Post subject: Re: Lookup specific string in all-tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Dec 13, 9:26 am, Eric Fung 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$B7n(B13$BF|(B, $B2 wrote:
>
> > On Dec 12, 8:15 am, David Kerber
>
> > wrote:
> > > In article <f5a755b8-feed-4c2b-a53c-
> > > 44e02086b....DeleteThis@e10g2000prf.googlegroups.com>,
> > > 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- $Bp,i6Ho0zMQJ8;z(B -
>
> > - $Bp}<(Ho0zMQJ8;z(B -
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 >> Stay informed about: Lookup specific string in all-tables |
|
| Back to top |
|
 |  |
| Related Topics: | Interesting findings with string pattern matching using [s.. - I found some interesting results today, when using the "like" command combined with pattern matching for a range of numbers eg. searches with the use of [1-100] or [A-Z] aka [specifier] or [rangespec] as the symbol Please see below - I will...
HELP audit a specific user in a database - Hello I need to set audit in Sybase for some users only. How can I setup audit for a database and a user on delete, truncate etc The following commands do it for the database entire users which I don't want to do Use mydb Go sp_audit "delete&qu...
user's tables - Hi everyone, I use Sybase Adaptive Server Anywhere Database Engine Version 8.0.2.3601. I've connected to database (isql) but I don't know database structure. Can anyone tell me which sql query should I use to see database structure (I mean tables defined...
Bcp out / in all tables with a generic script - Hello Is there a way of bcp out and then in all tables in sybase? if so can someone please help? I just dont want to hard code every single table in a script if possible Sybase version is 12.5.2 on solaris Thank you very much Teresa
Proxy tables between Sybase and Oracle - Hi! I have 2 applications which have both their own database. The first one is Sybase and the seconde one is Oracle (8i now, 10g in 2 months). I would like to know if it is possible (and how) to create proxy tables in Sybase to access directly datas.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|