Sponsored Content
Full Discussion: Selective delete in SQL
Top Forums UNIX for Dummies Questions & Answers Selective delete in SQL Post 302772253 by sonia102 on Sunday 24th of February 2013 05:09:12 PM
Old 02-24-2013
Selective delete in SQL

Hi All

This might be a weird query but its related to deleting specific details in database.

Bascially I had built a database using a set of files
Code:
seq1 of 300 mb
seq2 of 200 mb
seq3 of 350 mb
seq4 of 300 mb

and after building the database i realized that i didn't need the whole data. i am required to not only delete content of database related to seq2 to seq4 but also delete content related to last 200 bytes in seq1

Basically i am required to retain only first 100 mb of data in seq1.

without going through the whole procedure of rebuilding the db could i delete contents of database corresponding to these requirements.
i know its a little unusal but could some one give a direction.

Thanks
Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Trying to delete a directory pattern-selective deletion

Trying to delete a directory or a file using a pattern-selective deletion (using “*” and “?” ) (4 Replies)
Discussion started by: herberwz
4 Replies

2. UNIX for Dummies Questions & Answers

Help with selective ls

Hi all :wall: Can anyone advise how do I use ls to do a selective amd sorted listing of file that I want to have as below? Am looking for files that are named as log_<nnnn>.txt, where <nnnn> are numeric, i.e. I want to have a listing sorted from the newest to the oldest of files that... (7 Replies)
Discussion started by: newbie_01
7 Replies

3. Shell Programming and Scripting

RegEx - selective delete around a pattern

I need RegEx to delete text block delimited by "^--" and "^request saved" if the block contained the pattern "FAILED:No air,rail,hotel or car" in the following. Many thanks in advance! company_id=9292 queue_id=72 internationalOnly=0 Building XML... ABC123 Adding passenger first=First ... (1 Reply)
Discussion started by: roshansharma
1 Replies

4. Shell Programming and Scripting

Capture rows for a column in file from delete sql -Oracle

Hi, This may not be the right forum but i am hoping someone knows an answer to this. I have to capture rows for a column that was deleted. How can i do that without having to write a select query? delete from myschema.mytable where currentdatetimestamp > columnDate this should delete 5... (4 Replies)
Discussion started by: jakSun8
4 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Selective delete command

Hi All. I didnt know how to put this question as but i want to delete my values following string_X but need to retain the data in it. I hope the following might help me in conveying my doubt. My sequence looks like this. >string_1 CAJW010000001... (3 Replies)
Discussion started by: sonia102
3 Replies

6. UNIX for Dummies Questions & Answers

SQL selective replace

Hi I have a table which looks like this id | name | length | clone | null 1 | string 1 | 12345643 | string 1 | NULL | 2 | string 2 | 2345612 | string 2 | NULL | 3 | string 3 | 3421556 | string 3 | NULL | 4 | string 4 | 1236742 | string 4 | NULL | 5 | string 5 | 2312677 | string 5 | NULL |... (2 Replies)
Discussion started by: rsi.245
2 Replies

7. UNIX for Dummies Questions & Answers

Sql delete and append

Hi I have a question on appending and deleting entries in mysql table. This is my sample table. table name: details id_name | model | mode | media| first | end | id | level | +--------------------+-------+---------+-----+-------+-------+--------+--------+ | PSK_30s1207681L002 | -1 | 1... (7 Replies)
Discussion started by: rsi.245
7 Replies

8. UNIX for Dummies Questions & Answers

Selective replace and delete

Hi My input file looks like this: >BAHMI01000090.1 Details of the shopping list 9800 item00090, whole set of listed artifacts and objects >BAHMI01050012.1 Details of the shopping list 9800 item02310, whole set of listed artifacts and objects >BAHMI01070078.1 Details of the shopping list ... (5 Replies)
Discussion started by: sonia102
5 Replies

9. UNIX and Linux Applications

How to delete a data starting with a phrase in a table - SQL?

Hello, I am trying to remove some rows in a table, which are including a phrase at a defined column but i could not find the unique result for this. What I wish to do is to remove all lines including http://xx.yy at link column ... (2 Replies)
Discussion started by: baris35
2 Replies

10. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
SQL::Translator::Parser::DBI(3pm)			User Contributed Perl Documentation			 SQL::Translator::Parser::DBI(3pm)

NAME
SQL::Translator::Parser::DBI - "parser" for DBI handles SYNOPSIS
use DBI; use SQL::Translator; my $dbh = DBI->connect('dsn', 'user', 'pass', { RaiseError => 1, FetchHashKeyName => 'NAME_lc', } ); my $translator = SQL::Translator->new( parser => 'DBI', dbh => $dbh, ); Or: use SQL::Translator; my $translator = SQL::Translator->new( parser => 'DBI', parser_args => { dsn => 'dbi:mysql:FOO', db_user => 'guest', db_password => 'password', } ); DESCRIPTION
This parser accepts an open database handle (or the arguments to create one) and queries the database directly for the information. The following are acceptable arguments: o dbh An open DBI database handle. NB: Be sure to create the database with the "FetchHashKeyName => 'NAME_lc'" option as all the DBI parsers expect lowercased column names. o dsn The DSN to use for connecting to a database. o db_user The user name to use for connecting to a database. o db_password The password to use for connecting to a database. There is no need to specify which type of database you are querying as this is determined automatically by inspecting $dbh->{'Driver'}{'Name'}. If a parser exists for your database, it will be used automatically; if not, the code will fail automatically (and you can write the parser and contribute it to the project!). Currently parsers exist for the following databases: o MySQL o SQLite o Sybase o PostgreSQL (still experimental) Most of these parsers are able to query the database directly for the structure rather than parsing a text file. For large schemas, this is probably orders of magnitude faster than traditional parsing (which uses Parse::RecDescent, an amazing module but really quite slow). Though no Oracle parser currently exists, it would be fairly easy to query an Oracle database directly by using DDL::Oracle to generate a DDL for the schema and then using the normal Oracle parser on this. Perhaps future versions of SQL::Translator will include the ability to query Oracle directly and skip the parsing of a text file, too. AUTHOR
Ken Y. Clark <kclark@cpan.org>. SEE ALSO
DBI, SQL::Translator. perl v5.14.2 2012-05-01 SQL::Translator::Parser::DBI(3pm)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy