Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: rogers42
  • Content: Threads
  • Order by date
  1. rogers42

    Need help to execute Unix commands from awk script ?

    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...
  2. rogers42

    Need help with passing double quoted string to a Korn shell script

    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...
  3. rogers42

    Need help with DWH Function Spec

    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
  4. rogers42

    How to load a single column using sql loader

    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 ---------- --------...
  5. rogers42

    Need help to speed up updates to a table

    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...
  6. rogers42

    Need help with the Unix "sort" command

    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...
  7. rogers42

    Need help with the syntax

    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...
  8. rogers42

    Partitioned tables & sql loader question

    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...
  9. rogers42

    How to execute dynamic sql code

    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')...
  10. rogers42

    How to troubleshoot a partitioned table

    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...
  11. rogers42

    Need help with defining a materialized view refresh frequency

    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...
  12. rogers42

    Can't seem to print the column headers

    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
  13. rogers42

    How to compute percentage error

    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 =...
  14. rogers42

    SQL Loader related question

    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...
  15. rogers42

    Converting a string to integer in Korn shell

    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
  16. rogers42

    Need help with sqlloader

    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...
  17. rogers42

    Need help with a date manipulation query

    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...
  18. rogers42

    Need help with formating

    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...
  19. rogers42

    Date data type confusion ?

    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...
  20. rogers42

    Need help loading Dates using sqlloader

    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...

Part and Inventory Search

Back
Top