IFX_GETSQLCA(3) 1 IFX_GETSQLCA(3)ifx_getsqlca - Get the contents of sqlca.sqlerrd[0..5] after a query
SYNOPSIS
array ifx_getsqlca (resource $result_id)
DESCRIPTION
Returns a pseudo-row with sqlca.sqlerrd[0] ... sqlca.sqlerrd[5] after the query associated with $result_id.
For inserts, updates and deletes the values returned are those as set by the server after executing the query. This gives access to the
number of affected rows and the serial insert value. For SELECTs the values are those saved after the PREPARE statement. This gives access
to the *estimated* number of affected rows. The use of this function saves the overhead of executing a SELECT dbinfo('sqlca.sqlerrdx')
query, as it retrieves the values that were saved by the ifx driver at the appropriate moment.
PARAMETERS
o $result_id
-$result_id is a valid result id returned by ifx_query(3) or ifx_prepare(3) (select type queries only!).
RETURN VALUES
Returns an associative array with the following entries: sqlerrd0, sqlerrd1, sqlerrd2, sqlerrd3, sqlerrd4 and sqlerrd5.
EXAMPLES
Example #1
Retrieve Informix sqlca.sqlerrd[x] values
<?php
/* assume the first column of 'sometable' is a serial */
$qid = ifx_query("insert into sometable
values (0, '2nd column', 'another column') ", $connid);
if (!$qid) {
/* ... error ... */
}
$sqlca = ifx_getsqlca($qid);
$serial_value = $sqlca["sqlerrd1"];
echo "The serial value of the inserted row is : $serial_value<br />
";
?>
PHP Documentation Group IFX_GETSQLCA(3)
Check Out this Related Man Page
MSSQL_FETCH_ASSOC(3)MSSQL_FETCH_ASSOC(3)mssql_fetch_assoc - Returns an associative array of the current row in the resultSYNOPSIS
array mssql_fetch_assoc (resource $result_id)
DESCRIPTION
Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead. mssql_fetch_assoc(3) is equiv-
alent to calling mssql_fetch_array(3) with MSSQL_ASSOC for the optional second parameter.
PARAMETERS
o $result_id
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
RETURN VALUES
Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows.
EXAMPLES
Example #1
mssql_fetch_assoc(3) example
<?php
// Send a select query to MSSQL
$query = mssql_query('SELECT [username], [name] FROM [php].[dbo].[userlist]');
// Check if there were any records
if (!mssql_num_rows($query)) {
echo 'No records found';
}
else
{
// Print a nice list of users in the format of:
// * name (username)
echo '<ul>';
while ($row = mssql_fetch_assoc($query)) {
echo '<li>' . $row['name'] . ' (' . $row['username'] . ')</li>';
}
echo '</ul>';
}
// Free the query result
mssql_free_result($query);
?>
PHP Documentation Group MSSQL_FETCH_ASSOC(3)
Hi Guys,
Thank you all for helping me with my different queries and I continue to get better at scripting because of help from all of you!
I have a file that would look something like -
ID SUB ID VALUE
1 10 5
2 18 7
1 ... (1 Reply)
Hi,
So far i've made a script that takes two argument, 1st is the contents and the 2nd is the named file. At the moment i've managed to insert new contents as a new line at the top, but i want to ask how can you insert contents in the middle of the file?
Source Code
#!/bin/bash
#Write... (3 Replies)
I am working on a file, I need add a column with serial # in a file, the column will be the first column. and the serial # will be decide by each raw, say if I have 6 raws, I need serial # from 1 to 6 in the first column. Anyone know how to add that. I really appreciate. Thanks (2 Replies)
Hi all,
I want to extract rows with the pattern ALPHANUMERIC/ALPHANUMNERIC in the 2nd column.
I dont wan rows with more than 1 slash or without any slash in 2nd column.
a a/b
b a/b/c
c a/b//c
d t/y
e r
f /f
I came up with the regex
grep '\/$' file
a a/b
b a/b/c
d t/y (3 Replies)