Hi
I have a shell script in which a string variable is saving following query.
SqlQuery="select a||'|'||b||'|'||c from dual"
I am trying to pass above query as a parameter to some script but its giving me error for "single quote". I tried suppressing it using \' instead of just ' but it... (1 Reply)
Hi there
I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this
SN=123456
n=server1
m=x4140
sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';"
echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Hi,
I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification
in short
select var,data from usage;
o/p=... (1 Reply)
Hi All,
bash-3.00$ gzgrep -i '\ ExecuteThread:' /******/******/******/******/stdout.log.txt.gz
<Jan 7, 2012 5:54:55 PM UTC> <Error> <WebLogicServer> <BEA-000337> < ExecuteThread: '414' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "696" seconds working on the request... (4 Replies)
HI,
I want to connect to database and fetch the count from a table.
The sql query is as below :
select count(*) from table_test where test_column='read';
How can I print the output of this statement using shell script.
Thanks in advance. (4 Replies)
Hi team,
I have two select statements and need to run them using SYSDBA user
select * from temp_temp_seg_usage;
select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from
dba_segments where segment_name='TEMP_TEMP_SEG_USAGE';
Need to run this using a shell script say named... (1 Reply)
cd /opt/et/WAS/apps/8.0
find . -name "HostIntegration.properties" -o -name "HostSocket.properties" -o -name "environment.properties" 2> /dev/null | awk -F '' '{print $4}'|awk '!x++' | cat>/home/cbadmin/file1.txt
cd /home/cbadmin/
PS3='Please enter a number from list of applications==>:'
select... (3 Replies)
I have a text file in this format
Some lines....
Question no: 1
The question?
A. Answer 1
B. Answer 2
C. Answer 3
D. Answer 4
Answer:B
Some lines....
Question no: 2
The question? (choose 2) (10 Replies)
Hello,
I have script which work 70% of the desired task , the output from script.sh is following , however the desired output I require is following .
Any piece of suggestion would be great..
thanks in advance,
emily
#!/bin/bash ... (8 Replies)
Discussion started by: emily
8 Replies
LEARN ABOUT PHP
sqlsrv_errors
SQLSRV_ERRORS(3)SQLSRV_ERRORS(3)sqlsrv_errors - Returns error and warning information about the last SQLSRV operation performedSYNOPSIS
mixed sqlsrv_errors ([int $errorsOrWarnings])
DESCRIPTION
Returns error and warning information about the last SQLSRV operation performed.
PARAMETERS
o $errorsOrWarnings
- Determines whether error information, warning information, or both are returned. If this parameter is not supplied, both error
information and warning information are returned. The following are the supported values for this parameter: SQLSRV_ERR_ALL, SQL-
SRV_ERR_ERRORS, SQLSRV_ERR_WARNINGS.
RETURN VALUES
If errors and/or warnings occurred on the last sqlsrv operation, an array of arrays containing error information is returned. If no errors
and/or warnings occurred on the last sqlsrv operation, NULL is returned. The following table describes the structure of the returned
arrays:
Array returned by sqlsrv_errors
+---------+---------------------------------------------------+
| Key | |
| | |
| | Description |
| | |
+---------+---------------------------------------------------+
|SQLSTATE | |
| | |
| | For errors that originate from the ODBC driver, |
| | the SQLSTATE returned by ODBC. For errors that |
| | originate from the Microsoft Drivers for PHP for |
| | SQL Server, a SQLSTATE of IMSSP. For warnings |
| | that originate from the Microsoft Drivers for PHP |
| | for SQL Server, a SQLSTATE of 01SSP. |
| | |
| code | |
| | |
| | For errors that originate from SQL Server, the |
| | native SQL Server error code. For errors that |
| | originate from the ODBC driver, the error code |
| | returned by ODBC. For errors that originate from |
| | the Microsoft Drivers for PHP for SQL Server, the |
| | Microsoft Drivers for PHP for SQL Server error |
| | code. |
| | |
|message | |
| | |
| | A description of the error. |
| | |
+---------+---------------------------------------------------+
EXAMPLES
Example #1
functionname(3) example
<?php
$serverName = "serverName/sqlexpress";
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
/* Set up a query to select an invalid column name. */
$sql = "SELECT BadColumnName FROM Table_1";
/* Execution of the query will fail because of the bad column name. */
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false ) {
if( ($errors = sqlsrv_errors() ) != null) {
foreach( $errors as $error ) {
echo "SQLSTATE: ".$error[ 'SQLSTATE']."<br />";
echo "code: ".$error[ 'code']."<br />";
echo "message: ".$error[ 'message']."<br />";
}
}
}
?>
NOTES
By default, warnings generated on a call to any SQLSRV function are treated as errors. This means that if a warning occurs on a call to a
SQLSRV function, the function returns FALSE. However, warnings that correspond to SQLSTATE values 01000, 01001, 01003, and 01S02 are never
treated as errors. For information about changing this behavior, see sqlsrv_configure(3) and the WarningsReturnAsErrors setting.
SEE ALSO sqlsrv_configure(3).
PHP Documentation Group SQLSRV_ERRORS(3)