Sponsored Content
Full Discussion: SQL IF-THEN-ELSE issue
Top Forums Programming SQL IF-THEN-ELSE issue Post 302407004 by curleb on Wednesday 24th of March 2010 10:37:10 AM
Old 03-24-2010
Gotta say it's a little lacking in specifics on the details.

You're using Oracle? MySQL? SQL Server? Your use of curdate() suggests, but doesn't say. What exactly is the contents of the CPU table? Does it contain activity for both CPU0 and CPU1, along with others?

Points to note: your CASE..END statements skip the fallback ELSE clause, which probably accounts for the NULL value shown. Your IN array restricts it all to CPUs 0 and 1, whereas your initial comments suggest you'd want insight to the spread across all CPU.

Hope this helps, but details would help more...
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SQL scripts not running, possible timeout issue?

I am a novice Unix scripter and need a little advice/help on a script I've written that's causing some problems. We are using Solaris 9 on a Sun box and the script is invoked with the korn shell. I have a two-part question: I wrote a shell script that calls and executes 3 separate sql scripts,... (3 Replies)
Discussion started by: E2004
3 Replies

2. Programming

SQL Issue please respond !!!

Hi Folks, I have a issue regards space in the records. Example: 999207404 |sp818056|STEVEN |LAWRENCE |Mike.S.Lawrence@sprint.com |2003 S Data Sales Mgr 77 |SVC ... (5 Replies)
Discussion started by: Haque123
5 Replies

3. Shell Programming and Scripting

KSH script SQL timeout issue

Hi all, I have a KSH script which is kicking off an sql scripts as follows: /usr/local/installs/instantclient_10_2/sqlplus -s username/password @$sql_path/sql_query.sql > $tmp_path/sql_query_results The problem I have is that sometimes the 10g Oracle Database spits out an error saying... (4 Replies)
Discussion started by: Donkey25
4 Replies

4. Programming

SQL Developer JOINS / GROUP BY issue.

Am having a nightmare with a certain piece of code.. have tried almost everything and just cannot see what the issue is.. CREATE OR REPLACE VIEW TOP_EARNER_PER_LOCATION AS SELECT E.FIRST_NAME || ' ' || E.LAST_NAME AS EMPLOYEE_NAME, L.REGIONAL_GROUP AS REGIONAL_GROUP, ... (1 Reply)
Discussion started by: U_C_Dispatj
1 Replies

5. Shell Programming and Scripting

Issue in SQL Loader scripts

Hi, I'm planning to load the data from FLAT files into tables. Source file: more input.txt LRNO|Bale|Horsepower|NumberOfBarges|BollardPull|NumberOfCars|GasCapacity|GrainCapacity|IndicatedHorsepower|LiquidCapacity|... (6 Replies)
Discussion started by: shyamu544
6 Replies

6. Shell Programming and Scripting

Sql issue in shell scripting

HI friends , i am also facing an issue in mysql i ma trying to insert detail in a variable but not got success #!/bin/sh mysql -u<username> -p<password> <dbname> << EOF DEV=`mysql --skip-column-names <dbname> -e "SELECT timestamp from process_record where id = 1"` EOF echo $DEV ERROR... (3 Replies)
Discussion started by: sanjay833i
3 Replies

7. Shell Programming and Scripting

Issue with SQL UNIX shell script -

Hi all I am writing a shell script which will run a select query from a table . If the ouput is not 500 - then send a email to the team saying there is a error . But i am not sure how to redirect this output of the select query to the log file - #!/bin/ksh sqlplus /nolog conect... (1 Reply)
Discussion started by: honey26
1 Replies

8. Shell Programming and Scripting

Issue with quotes when running SQL command from within su -c

RHEL 6.2/Bash shell root user will be executing the below script. It switches to oracle user logs in using sqlplus and tries to run the below UPDATE statement. All the commands after su -c are enclosed in a single quote delimited by semicolon. The execution has failed because the quotes... (3 Replies)
Discussion started by: omega3
3 Replies

9. Shell Programming and Scripting

awk concatenation issue - SQL generation

Greetings Experts, I have an excel file and I am unable to read it directly into awk (contains , " etc); So, I cleansed and copied the data into notepad. I need to generate a script that generates the SQL. Requirement: 1. Filter and select only the data that has the "mapping" as "direct"... (4 Replies)
Discussion started by: chill3chee
4 Replies
DEL_TIMER_SYNC(9)						   Driver Basics						 DEL_TIMER_SYNC(9)

NAME
del_timer_sync - deactivate a timer and wait for the handler to finish. SYNOPSIS
int del_timer_sync(struct timer_list * timer); ARGUMENTS
timer the timer to be deactivated DESCRIPTION
This function only differs from del_timer on SMP: besides deactivating the timer it also makes sure the handler has finished executing on other CPUs. SYNCHRONIZATION RULES
Callers must prevent restarting of the timer, otherwise this function is meaningless. It must not be called from interrupt contexts unless the timer is an irqsafe one. The caller must not hold locks which would prevent completion of the timer's handler. The timer's handler must not call add_timer_on. Upon exit the timer is not queued and the handler is not running on any CPU. NOTE
For !irqsafe timers, you must not hold locks that are held in interrupt context while calling this function. Even if the lock has nothing to do with the timer in question. Here's why: CPU0 CPU1 ---- ---- <SOFTIRQ> call_timer_fn; base->running_timer = mytimer; spin_lock_irq(somelock); <IRQ> spin_lock(somelock); del_timer_sync(mytimer); while (base->running_timer == mytimer); Now del_timer_sync will never return and never release somelock. The interrupt on the other CPU is waiting to grab somelock but it has interrupted the softirq that CPU0 is waiting to finish. The function returns whether it has deactivated a pending timer or not. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 DEL_TIMER_SYNC(9)
All times are GMT -4. The time now is 09:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy