Drop everything after slash in 'foo/bar' in SQL ?

Drop everything after slash in 'foo/bar' in SQL ?

Post by Emme » Sun, 01 Sep 2002 04:18:45



Is it possible to select only the foo part of 'foo/bar'
in SQL?

How ;-)

Thanks,

em

 
 
 

Drop everything after slash in 'foo/bar' in SQL ?

Post by Richard Kuhle » Sun, 01 Sep 2002 06:26:42


select substr('foo/bar', 1, instr('foo/bar' || '/', '/') - 1) from dual

Richard


> Is it possible to select only the foo part of 'foo/bar'
> in SQL?

> How ;-)

> Thanks,

> em


 
 
 

1. sqlplus foo/bar@baz works; connect foo/bar@baz doesn't

Hi

I have this weird problem on W2K: If I open a cmd box and
type

But if I do a

in the (same) sqlplus prompt I get an ORA-12154 error (german:
TNS: Der Service Name konnte nicht aufgeloest werden,
english translation would be something like
TNS: could not resolve service name)

SQLPLUS is 9.0.1.0.1 for Windows, while
the DB Server is 8i on HP.

What can cause this?

AHA
Rene

2. Data Migration Methodologies -- FoxPro to Access

3. select distinct foo, count(foo) from exec (sp_my_proc 'myarg', 'bazarg')

4. Managing development db and production db in parallel

5. select N'foo'

6. Sybase: bcp from one database to database

7. psql slash command '\G'

8. linux kernel mods for V8 install

9. Query.ParamByName('Foo').AsMemo ?

10. can't replicate tables with a forward slash in table names

11. Beginner's course to *PROPER* slashing (for HJR, not important, not directly Oracle related)

12. failed: make install prefix=/foo/bar