Sponsored Content
Full Discussion: Oracle Database Query
Top Forums Programming Oracle Database Query Post 302478575 by durden_tyler on Wednesday 8th of December 2010 09:28:37 AM
Old 12-08-2010
Quote:
Originally Posted by SkySmart
it's the table that contains the information I want to grab out. im not sure I know how to describe it well enough....
"DESCRIBE" is a command of Oracle's own client - SQL*Plus. When run, it displays the structure of a table i.e. column names, their datatypes, sizes, whether they are nullable or not etc.

I believe fpmurphy wanted you to use that command, rather than plain English, to describe your table.

In any case, you may want to try this Oracle query -

Code:
--
-- This query fetches all records that have LASTOCCURRENCE values between
-- 5-Dec-2010 2:00 PM and 5-Dec-2010 8:00 PM, **both timestamps inclusive**
--
SELECT   node, nodealias, summary, tally, alertkey, alertgroup, manager, agent
   FROM mrtg_alerts
  WHERE lastoccurrence BETWEEN TO_DATE ('5-DEC-2010 14:0:0', 'DD-MON-YYYY HH24:MI:SS')
                           AND TO_DATE ('5-DEC-2010 20:0:0', 'DD-MON-YYYY HH24:MI:SS')
ORDER BY manager DESC;

Note that "between" over here means:
- the timestamp 5-Dec-2010 2:00 PM, and
- all timestamps between 2:00 PM and 8 PM on 5-Dec-2010, and
- the timestamp 5-Dec-2010 8:00 PM

Here's an equivalent query that uses the numeric relational operators instead of BETWEEN -

Code:
-- Equivalent query
SELECT   node, nodealias, summary, tally, alertkey, alertgroup, manager, agent
   FROM mrtg_alerts
  WHERE lastoccurrence >= TO_DATE ('5-DEC-2010 14:0:0', 'DD-MON-YYYY HH24:MI:SS')
    AND lastoccurrence <= TO_DATE ('5-DEC-2010 20:0:0', 'DD-MON-YYYY HH24:MI:SS')
ORDER BY manager DESC;

HTH,
tyler_durden
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

2. Solaris

Can't create database after Oracle Database installation

I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options. OPERATION_TYPE = "createDatabase" GDBNAME = "solaris_user.domain.com" SID = "solaris_user" TEMPLATENAME = "General... (0 Replies)
Discussion started by: solaris_user
0 Replies

3. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

4. Shell Programming and Scripting

How to run a SQL select query in Oracle database through shell script?

I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this? Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies

5. Shell Programming and Scripting

Korn Script to connect and query oracle database

I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error: ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies

6. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
load_dat_font(3alleg4)						  Allegro manual					    load_dat_font(3alleg4)

NAME
load_dat_font - Loads a FONT from an Allegro datafile. SYNOPSIS
#include <allegro.h> FONT *load_dat_font(const char *filename, RGB *pal, void *param) DESCRIPTION
Loads a FONT from an Allegro datafile. You can set param parameter to point to an array that holds two strings that identify the font and the palette in the datafile by name. The first string in this list is the name of the font. You can pass NULL here to just load the first font found in the datafile. The second string can be used to specify the name of the palette associated with the font. This is only returned if the pal parameter is not NULL. If you pass NULL for the name of the palette, the last palette found before the font was found is returned. You can also pass NULL for param, which is treated as if you had passed NULL for both strings separately. In this case, the function will simply load the first font it finds from the datafile and the palette that precedes it. For example, suppose you have a datafile named `fonts.dat' with the following contents: FONT FONT_1_DATA FONT FONT_2_DATA FONT FONT_3_DATA PAL FONT_1_PALETTE PAL FONT_2_PALETTE Then the following code will load FONT_1_DATA as a FONT and return FONT_1_PALETTE as the palette: FONT *f; PALETTE pal; char *names[] = { "FONT_1_DATA", "FONT_1_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If instead you want to load the second font, FONT_2, from the datafile, you would use: FONT *f; PALETTE pal; char *names[] = { "FONT_2_DATA", "FONT_2_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If you want to load the third font, but not bother with a palette, use: FONT *f; char *names[] = { "FONT_3_DATA", NULL } f = load_dat_font("fonts.dat", NULL, names); RETURN VALUE
Returns a pointer to the font or NULL on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks. SEE ALSO
register_font_file_type(3alleg4), load_font(3alleg4) Allegro version 4.4.2 load_dat_font(3alleg4)
All times are GMT -4. The time now is 05:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy