I'm not understanding the problem. You want to get the time/date on the server then use it in your query? Just use the variable "SYSDATE" in your query, it is the current time on the server. example:
-- finds all of the rows in mytable where the table_date field has a value that is less than one day.
I cannot figure out how to run a SQL script, or just a sqlplus query, from a shell script (bash or ksh). Basically, I need to su - oracle from root and run a query, then test the exit status. (3 Replies)
HI ALL
i have a requirement like this. i have to write a shell script to run a sql query. DB is oracle. once the query is run, the results of the query has to be published in a data file. can you please advice me how to go about it. i am absolutely new to shell scripts and this is a part of my job. (14 Replies)
Hi ALL,
I need an help in connecting to oracle database, executing a select query and printing it on the screen. Can any one please write a simple code or psuedo code and let me know.
select query returns multiple values( say select name from emp)
Thanks in advance
LM (1 Reply)
I want to perform few post-session success tasks like update a status to 'true' in one of the sql database table, update date values to current system date in one of the configuration table in sql. How do i achieve this in a post session command?syntax with example will be helpful. (3 Replies)
Hi all,
My reqirenet goes like this.
Need to execute one select statement within the script and send a mail to the users with the number of records fecthed from the query.
Please help..
Thanks. (3 Replies)
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Hi,
I have a perl snippet that call a select query with a bind variable,when i compile the script I'm unable to get the query output.
The same query when i fire in sqlplus fetches few rows.
The query takes bit time to fetch results in sqlplus.
my $getaccts = $lda->prepare("select distinct ... (1 Reply)
Hi,
I have one SQL file prepared in UNIX and one script that is executing that.
In SQL i have Update and create queries.
I want to introduce conditions in SQL file (in UNIX) that if either of the create or update query failes whole transaction should be rollback.
I just have 1 create... (2 Replies)
Hello~
I have a requirement to write a shell script which will connect to the oracle database and run a select count(*) query on a table.
The script should succeed only when the count returns a number greater than zero. If the count returns zero, the script should fail.
Can someone please... (3 Replies)
Discussion started by: Naren.N
3 Replies
LEARN ABOUT PHP
ibase_query
IBASE_QUERY(3) 1 IBASE_QUERY(3)ibase_query - Execute a query on an InterBase databaseSYNOPSIS
resource ibase_query ([resource $link_identifier], string $query, [int $bind_args])
DESCRIPTION
Performs a query on an InterBase database.
PARAMETERS
o $link_identifier
- An InterBase link identifier. If omitted, the last opened link is assumed.
o $query
- An InterBase query.
o $bind_args
-
RETURN VALUES
If the query raises an error, returns FALSE. If it is successful and there is a (possibly empty) result set (such as with a SELECT query),
returns a result identifier. If the query was successful and there were no results, returns TRUE.
Note
In PHP 5.0.0 and up, this function will return the number of rows affected by the query for INSERT, UPDATE and DELETE statements.
In order to retain backward compatibility, it will return TRUE for these statements if the query succeeded without affecting any
rows.
ERRORS /EXCEPTIONS
If you get some error like "arithmetic exception, numeric overflow, or string truncation. Cannot transliterate character between character
sets" (this occurs when you try use some character with accents) when using this and after ibase_query(3) you must set the character set
(i.e. ISO8859_1 or your current character set).
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.1 | |
| | |
| | On success the function now returns TRUE if |
| | there were no affected rows, where it previously |
| | returned 0 (a zero followed by an empty space). |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
ibase_query(3) example
<?php
$host = 'localhost:/path/to/your.gdb';
$dbh = ibase_connect($host, $username, $password);
$stmt = 'SELECT * FROM tblname';
$sth = ibase_query($dbh, $stmt) or die(ibase_errmsg());
?>
SEE ALSO ibase_errmsg(3), ibase_fetch_row(3), ibase_fetch_object(3), ibase_free_result(3).
PHP Documentation Group IBASE_QUERY(3)