Hi Folks,
I am trying to strip away the last five characters from the file name. Following is an example
Input: file1.done
Output: file1
My nawk script is as follows
BEGIN {
# Set the field separator to white space
FS=" "
}
{
print | "mv " $9 " " substr($9, 1,length($9)-5)
}
I am...
Hi Folks,
I need help to pass a double quoted string as parameter to my korn shell script.
The shell script is as follows
=========================================
#!/bin/ksh
# File Name: test.ksh
received=$0
echo $received
========================================
Execution:
logmsg="This...
Hi Folks,
I have been tasked with writing (my first) functional requirements document to make enhancements to an existing data warehouse. Can somebody please list the things that go in a functional spec document ? Or can somebody please post a sample functional spec ?
Thanks in advance
rogers42
Hi Folks,
I have a data file with three comma delimited columns. I am trying to load just the first column from the file into an Oracle table. The remaining table columns should contain hardcoded values.
My table looks as follows
Name Null? Type
---------- --------...
Hi Folks,
tab_1 has 60K records
tab_2 has 90 records
Both tables are indexed
The code to update one of tab_1 columns is as follows
DECLARE
v_flag CHAR(1);
CURSOR c_provider IS
select p.PROV, p.FREE, p.SUB, p.PAID
from tab_1 p,
tab_2 vab
where p.PROV = vab.PROV
and...
Hi Folks,
I need help with the "sort" command syntax. Essentially, I would like to sort the data (in descending order) on the second field
Sample Data:
============
:03.mpg: 14
:03TB.mpg: 8
:04TV_NR.mpg: 8
:102_FINAL.MPG: 11
Desired Results:
=================
:03.mpg: 14
:102_FINAL.MPG: 11...
Contents of Data File:
123-2009-123-123
456-2008-123-0
789-2009-100-0
awk Code:
BEGIN {
# Set the field seprator
FS="-";
}
/2009/
{
print "Updating " $2 " data";
}
}
Output:
All lines are printed
I am executing my script as follows
cat test.dat | nawk...
Hi Folks,
I need help with loading a partitioned table using the sql loader. Details are as follows
Table Structure:
Name Null? Type
------- -------- ----------------------------
FIELD_1 VARCHAR2(10)
FIELD_2...
Hi Folks,
I would like to package the following code in a file (on Unix) and to execute it via the Oracle schedular. However, I can't seem to make the dynamic part of the code to execute.
Can somebody please make a suggestion.
The code is as follows
select case when to_char(SYSDATE, 'DY')...
Hi Folks,
Given a "Range" or a "List" partitioned table, how can I find out if the data really ended up in the correct partition ? Put another way, how can I get a dump of a specific partition ?
The solution that I have come up is to
1, create a table with "List" partition
2, populate table...
Hi Folks,
I have a materialized view that is defined as follows.
create materialized view mv_test
BUILD IMMEDIATE
REFRESH COMPLETE
start with SYSDATE
next round(SYSDATE + 1) + 1/24
as
< my query >
Based on the above code, an somebody please confirm that the materialized view will be updated...
Hi Folks,
I can't seem to print the column headings. E.g. The following simply prints "X" but no heading
select * from dual;
show heading command displays ON.
Is there any other setting that might be supressing the column header printing ?
Thanks in advance.
rogers42
Hi Folks,
I am looking for an elegant way of computing the percentage error. The following code works, but I don't want to repeat the same statment to compute the % error.
select NODE,
count(*) "Total_Errors",
sum(case when (CODE = 3) then 1 else 0 end) "Code_3",
(sum(case when (CODE =...
Hi Folks,
I need help loading data using the sql loader
Sample Data:
Toledo,230-123456789,SABNJCKHQ,3250
Ottawa-arizona,240567890234,SABBMXCRN,2000
My control file looks as follows
LOAD DATA
TRUNCATE INTO TABLE TMP
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
field_1...
Hi Folks,
I need help to convert a string to integer so I can manipulate the numbers
My Korn shell script is as follows
typeset -i today=`date +%d`
print $today
yesterday=$today-1
print $yesterday
I get "21 -1" for yesterday
Thanks in advance
rogers42
Hi Folks,
Snippet of my ctl file looks as follows
...
PINGABLE CHAR "DECODE('0', 'NON PINGABLE',
'1', 'PINGABLE',
'UNKNOWN')",
....
This particular field is defined as follows in my table
PINGABLE...
Hi Folks,
I am working on a (hopefully) one time assignment to pull some data from an sql server. The data needs to be pulled for a particular day.
While I am familiar with Oracle, I do not know the SQL syntax (on Sql server) to formulate the correct query.
Sample Date data looks as follows...
Hi,
Sample Data:
============
AAAAA
BBBB
CCCC
Desired Output:
================
'AAAAA',
'BBBBB',
'CCCCC'
My query looks as follows
select '''||distinct(MAC_ADDR)||'','
from MAC;
The compiler keeps complaining about the strings being not properly terminated.
Can somebody please revise my...
Hi Folks,
Sample "CREATE_DATE" data: 01-JUN-08
Query #1
=========
select count(*)
from CM
where CREATE_DATE = SYSDATE
Query #2
========
select count(*)
from CM
where to_char(CREATE_DATE, 'DD-MON-YY') =
to_char(SYSDATE - 1, 'DD-MON-YY')
How come query #2 returns valid data while query...
Hi Folks,
I am having problems loading some data in my Oracle table. Can somebody please look at the following code and point out my mistake ?
Table Defination
================
table_1
(FLAP_TIME DATE)
sqlloader control file
======================
FLAP_TIME "to_date(:FLAP_TIME,'Mon DD...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.