Re: Lookup specific string in all-tables



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
.



Relevant Pages

  • Re: psycopg, transactions and multiple cursors
    ... > first time a change is made to the database. ... My intention is actually to keep them in the same transaction. ... >> cursor fetches one record from the database at a time). ... > generated from the same connection, ...
    (comp.lang.python)
  • Re: Best Practices
    ... How you need to abstract database from ... maybe the same command object with a different command string)? ... Try not to design an application that uses one DataReader that is connected ... > define cursor 1 ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: So whats null then if its not nothing?
    ... Let's face it - we never actaully store persons in a database. ... that database holds no information about the birthday of this person, ... In SQL, the chosen representation for data that is not present in the ... To that person, the value is unknown. ...
    (comp.databases.theory)
  • Re: [VisualAge] Long lists in Client/Server application
    ... I would be able to ask the cursor to ... if it IS a database ... should switch over now to see if I have the same issue on PostgreSQL. ... query, but I can't see any easy way to position the the cursor at the ...
    (comp.lang.smalltalk)
  • Re: Row Order
    ... morphed into a flat-file design into SQL Server. ... Server is a relational database that assumes set operations and doesn't let ... > somebody doesn't want to have to add an ORDER BY clause to the cursor ...
    (microsoft.public.sqlserver.programming)