Hi All,
I'm writing a script that provides a menu to manipulate records. I'm having a problem, however. The first option I'm writing is simply to display all of the records in a supplied file.
The supplied file ('records') currently contains sample data, this data is:
... (3 Replies)
Hello,
I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command.
How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ?
Thank you (7 Replies)
Dear all,
I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this
andrew 80
ben 75
and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Good evening! Trying to make a shell script to parse log file and show only required information.
log file has 44 fields and alot of lines, each columns separated by ":".
log file is like:
first_1:3:4:5:6:1:3:4:5:something:notinterested
second_2:3:4:3:4:2
first_1:3:4:6:6:7:8
I am interested... (3 Replies)
I have the below script
i am getting the csv in garbled format.Please suggest the changes.
SUNOS
#######################################################################
####MAIN SCRIPT
#######################################################################
today=`date "+%m-%d-%Y ... (3 Replies)
I need to parse .conf file in Unix system to get output from the snippets like below :
; generated by mod_identity
exten => int,1,GoSub(mdc_template-3,s,1)
exten => int,n(next_380),Return()
; default action for busy
exten => ext,1,GoSub(mdc_template-3,s,1)
exten => ext,n,Set(PRI_CAUSE=17)... (2 Replies)
Hello,
I have some tab delimited text data,
file: final_temp1
aname val
NAME;r'(1,) 3.28584
r'(2,)<tab>
NAME;r'(3,) 6.13003
NAME;r'(4,) 4.18037
r'(5,)<tab>
You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Dear all,Zabbix version : 2.4 (yes, I know, upgrading soon - honest)
Server OS version : CentOS 6, 64-bit (CentOS 7 with the Zabbix upgrade)I've got a large log file that I would like to read by an external process. It's basically the same as reading the item value on a web-page. I have... (5 Replies)
Hi - I want to interrogate information about my poker hands, sessions are all recorded in a text file in a particular format. Each hand starts with the string <PokerStars> followed by a unique hand reference and other data like date/time. There is then all the information about each hand. My first... (5 Replies)
Hello,
I have a src code file where I need to uncomment many lines.
The lines I need to uncomment look like,
C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ)
The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
LEARN ABOUT PHP
oci_parse
OCI_PARSE(3)OCI_PARSE(3)oci_parse - Prepares an Oracle statement for executionSYNOPSIS
resource oci_parse (resource $connection, string $sql_text)
DESCRIPTION
Prepares $sql_text using $connection and returns the statement identifier, which can be used with oci_bind_by_name(3), oci_execute(3) and
other functions.
Statement identifiers can be freed with oci_free_statement(3) or by setting the variable to NULL.
PARAMETERS
o $connection
- An Oracle connection identifier, returned by oci_connect(3), oci_pconnect(3), or oci_new_connect(3).
o $sql_text
- The SQL or PL/SQL statement. SQL statements should not end with a semi-colon (";"). PL/SQL statements should end with a semi-
colon (";").
RETURN VALUES
Returns a statement handle on success, or FALSE on error.
EXAMPLES
Example #1
oci_parse(3) example for SQL statements
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
// Parse the statement. Note there is no final semi-colon in the SQL statement
$stid = oci_parse($conn, 'SELECT * FROM employees');
oci_execute($stid);
echo "<table border='1'>
";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo "<tr>
";
foreach ($row as $item) {
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>
";
}
echo "</tr>
";
}
echo "</table>
";
?>
Example #2
oci_parse(3) example for PL/SQL statements
<?php
/*
Before running the PHP program, create a stored procedure in
SQL*Plus or SQL Developer:
CREATE OR REPLACE PROCEDURE myproc(p1 IN NUMBER, p2 OUT NUMBER) AS
BEGIN
p2 := p1 * 2;
END;
*/
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$p1 = 8;
// When parsing PL/SQL programs, there should be a final semi-colon in the string
$stid = oci_parse($conn, 'begin myproc(:p1, :p2); end;');
oci_bind_by_name($stid, ':p1', $p1);
oci_bind_by_name($stid, ':p2', $p2, 40);
oci_execute($stid);
print "$p2
"; // prints 16
oci_free_statement($stid);
oci_close($conn);
?>
NOTES
Note
This function does not validate $sql_text. The only way to find out if $sql_text is a valid SQL or PL/SQL statement is to execute
it.
SEE ALSO oci_execute(3), oci_free_statement(3).
PHP Documentation Group OCI_PARSE(3)