Sponsored Content
Top Forums Shell Programming and Scripting need to create a insert query for a file Post 302350594 by mac4rfree on Friday 4th of September 2009 09:42:52 AM
Old 09-04-2009
need to create a insert query for a file

Hi Guys,

I need to create a insert query for the below file

Code:
   Fri Sep  4 06:25:51 2009
ACTION : 'CREATE INDEX S100S_DC.PLInsuranceReportRules_testI1     ON S100S_DC.PLInsuranceReportRules_test1(ENTITY_KEY)'
DATABASE USER: '/'
PRIVILEGE : SYSDBA
CLIENT USER: oracle
CLIENT TERMINAL: pts/3
STATUS: 0

Fri Sep  4 06:28:41 2009
ACTION : 'GRANT DELETE ON S100S_DC.PLInsuranceReportRules_test1 TO   DC_DATACHG_ROLE'
DATABASE USER: '/'
PRIVILEGE : SYSDBA
CLIENT USER: oracle
CLIENT TERMINAL: pts/3
STATUS: 0

Fri Sep  4 06:39:22 2009
ACTION : 'OCIDescribeAny'
DATABASE USER: 'S1'
PRIVILEGE : SYSDBA
CLIENT USER: oracle
CLIENT TERMINAL: pts/3
STATUS: 0

The file contains lot of blocks as shown. The Each of the values should go into the table.

The insert statement should be as follows

Code:
Insert into table values ('Fri Sep  4 06:25:51 2009','CREATE INDEX S100S_DC.PLInsuranceReportRules_testI1     ON S100S_DC.PLInsuranceReportRules_test1(ENTITY_KEY)','/','SYSDBA','oracle','pts/3','0');

Thanks For your help in advance,

Regards,
Magesh.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create Insert script from a file

Hi , I have a text file text.txt which contains values as ULTRA,OTHERS,Mumbai,16912 ULTIMATE,OTHERS,Mumbai,16913 ULTIMATIUM,OTHERS,Mumbai,16914 I want to read the file line by line and create insert scripts like INSERT INTO TAB ( DESC,PLACE,NUMBER ) VALUES... (3 Replies)
Discussion started by: ultimatix
3 Replies

2. Shell Programming and Scripting

to create a export query from a file

Hi Guys,,, I have a file which is of this type. abdc defd afds adfse I want to create a export statement like this. Db2 "export to /clocal/rem/user/rem/used.txt of del select * from t.tel where name in ('abdc','defd','afds','adfse') with ur" Please help me.. Thanks for... (2 Replies)
Discussion started by: mac4rfree
2 Replies

3. Programming

SQL : Fine tune Insert by query

i would like to know how can i fine tune the following query since the cost of the query is too high .. insert into temp temp_1 select a,b,c,d from xxxx .. database used is IDS.. (1 Reply)
Discussion started by: expert
1 Replies

4. Shell Programming and Scripting

How to use a variable in insert query?

My script contains as follows, VALUE=`sqlplus un/pwd <<EOF > OB.txt set pagesize 0 feedback off verify off heading off echo off select max(1) from table1; exit; EOF` insert into table2 values(1, 'The max value is $value',...); i need the value of VALUE to be inserted after 'The max... (2 Replies)
Discussion started by: savithavijay
2 Replies

5. Shell Programming and Scripting

Forming an insert query using awk

Hi, I'm trying to form an insert sql query using shell programming. I have table named company with four columns 'company name', 'company id', 'company code' and 'last change id' I have to read the company name, company code and last change id from a file delimited by | which has around 10... (4 Replies)
Discussion started by: rakesh_s
4 Replies

6. Programming

insert query help

Hello i want help to load data from file into mysql DB this part i know how to do but during loading i want to combine 2 fields into 1 field and insert into db as primary key in new column thanks advice how to do so (5 Replies)
Discussion started by: mogabr
5 Replies

7. Shell Programming and Scripting

Create SQL DML insert statements from file using AWK or similar

Hi all. This is my first post on this forum. I've previously found great help in the huge knowledgebase that is here, but this time I have not been able to find a solution to my problem. I have a large text file that looks like this: typedef struct ABC_struct_nbr1_ { char attr1; /*... (0 Replies)
Discussion started by: Yagi Uda
0 Replies

8. Shell Programming and Scripting

Insert query with shell variable with AWK

Hi, I'm a first timer with Unix so pardon my ignorance. I'm trying to read a comma separated file from the same folder where the script is and insert the value in a DB2 table. I'm using AWK for the same. I'm getting `)' not expected error. I'm not sure but for me it doesn't look like detailed... (8 Replies)
Discussion started by: Kabira Speaking
8 Replies

9. Shell Programming and Scripting

From sql Insert Query to XML format

Hi How do I translate Let say Cat inserts.sql gives Insert into PM9_TAXATION_ROUNDING (STATE_GECODE, TAX_TYPE, TAX_AUTHORITY, SYS_CREATION_DATE, SYS_UPDATE_DATE, APPLICATION_ID, DL_SERVICE_CODE, ROUNDING_METHOD) Values ('xx', 'xx', 'x', TO_DATE('10/26/2012 13:01:20',... (3 Replies)
Discussion started by: anuj87in
3 Replies

10. Shell Programming and Scripting

How to create a file from output of vertica table query in UTF-8 format?

Hello, In my shell script, I extract table data from HP Vertica DB into a csv file using vsql -c command. But the problem is the file getting created is in binary format and hence some of the data becomes unreadable which has chinese characters as part of data. file -i filename.csv - gives... (2 Replies)
Discussion started by: Dharmatheja
2 Replies
DROP 
INDEX(7) SQL Commands DROP INDEX(7) NAME
DROP INDEX - remove an index SYNOPSIS
DROP INDEX index_name [, ...] [ CASCADE | RESTRICT ] INPUTS index_name The name (optionally schema-qualified) of an index to remove. CASCADE Automatically drop objects that depend on the index. RESTRICT Refuse to drop the index if there are any dependent objects. This is the default. OUTPUTS DROP INDEX The message returned if the command completes successfully. ERROR: index "index_name" does not exist This message occurs if index_name is not an index in the database. DESCRIPTION
DROP INDEX drops an existing index from the database system. To execute this command you must be the owner of the index. NOTES DROP INDEX is a PostgreSQL language extension. Refer to CREATE INDEX [create_index(7)] for information on how to create indexes. USAGE
This command will remove the title_idx index: DROP INDEX title_idx; COMPATIBILITY
SQL92 SQL92 defines commands by which to access a generic relational database. Indexes are an implementation-dependent feature and hence there are no index-specific commands or definitions in the SQL92 language. SQL - Language Statements 2002-11-22 DROP INDEX(7)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy