Can any one help me how to pass the value of result of one query to another query.
I to pass the value of result of 'select max(id) from a' into another query
like
update table
set col =<value from last query>
where ....;
updatestaging()
{
xx=`$ORACLE_HOME/bin/sqlplus -s... (1 Reply)
Hi ,
I just found you while surfing for the string
'Redirecting sql select query output from within a shell script to txt file/excel file'
Could you find time sending me the code for the above question?
It'll be great help for me.
I have a perl file that calls the sql file... (1 Reply)
Hi Yogesh,
Lucky that i caught you online. Yeah i read about DBI and the WriteExcel module. But the server is not supporting these modules. It said..."Cannot locate DBI"..."Cannot locate Spreadsheet::WriteExcel"
I tried creating a simple text file to get the query output, but the... (1 Reply)
Hi ,
I used the below script to get the sql data into csv file using unix scripting.
I m getting the output into an output file but the output file is not displayed in a separe columns .
#!/bin/ksh
export FILE_PATH=/maav/home/xyz/abc/
rm $FILE_PATH/sample.csv
sqlplus -s... (2 Replies)
When I write
Select date_field from TableA fetch first row only
I am getting the output as 09/25/2009.
I want to get the output in the below format
2009-09-25 i.e., MM-DD-YYYY. Please help (7 Replies)
I am currently returning an sql result with a number value that I want to format as an amount. The sql runs smoothly on its own, but when run inside my ksh script an error is encountered:
ERROR at line 3:
ORA-01481: invalid number format model
My sql is --
select distinct
... (6 Replies)
Hello Guys,
This message is somewhat relates with last thread. But I need to re-write thing. I start over a little. I am stuck now and need your help.
Here is my script-
#! /bin/ksh
export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2
/opt/oracle/app/oracle/product/9.2/bin/sqlplus -s... (5 Replies)
Hi
How do I translate
Let say
Cat inserts.sql
gives
Insert into PM9_TAXATION_ROUNDING
(STATE_GECODE, TAX_TYPE, TAX_AUTHORITY, SYS_CREATION_DATE, SYS_UPDATE_DATE, APPLICATION_ID, DL_SERVICE_CODE, ROUNDING_METHOD)
Values
('xx', 'xx', 'x', TO_DATE('10/26/2012 13:01:20',... (3 Replies)
How to Get SQL query result to file in putty?
I have one SQL query and I want that query output to be redirected to the file.
uname -a
SunOS XXX 5.8 Generic_117350-58 sun4u sparc SUNW,Sun-Fire-480R
Please suggest. (7 Replies)
Dear community,
please help with a query on Oracle. I'm using SQLPlus (but with SQLDeveloper is the same) to accamplish a sinple query like:
select count(*) from ARCHIT_D_TB where (TYP_ID=22 OR TYP_ID=23) and SUB_TM like '%SEP%' and CONS=1234This is a very simple query that works perfect until... (5 Replies)
Discussion started by: Lord Spectre
5 Replies
LEARN ABOUT PHP
cubrid_num_rows
CUBRID_NUM_ROWS(3) 1 CUBRID_NUM_ROWS(3)cubrid_num_rows - Get the number of rows in the result setSYNOPSIS
int cubrid_num_rows (resource $result)
DESCRIPTION
The cubrid_num_rows(3) function is used to get the number of rows from the query result. You can use it only when the query executed is a
select statement. When you want to know such value for INSERT, UPDATE, or DELETE query, you have to use the cubrid_affected_rows(3) func-
tion.
Note: The cubrid_num_rows(3) function can only be used for synchronous query; it returns 0 when it is used for asynchronous query.
PARAMETERS
o $result
-$result comes from a call to cubrid_execute(3), cubrid_query(3) and cubrid_prepare(3)RETURN VALUES
Number of rows, when process is successful.
0 when the query was done in async mode.
-1, if SQL statement is not SELECT.
FALSE when process is unsuccessful.
EXAMPLES
Example #1
cubrid_num_rows(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb", "dba");
$req = cubrid_execute($conn, "SELECT * FROM code");
$row_num = cubrid_num_rows($req);
$col_num = cubrid_num_cols($req);
printf("Row Num: %d
Column Num: %d
", $row_num, $col_num);
cubrid_disconnect($conn);
?>
The above example will output:
Row Num: 6
Column Num: 2
SEE ALSO cubrid_execute(3), cubrid_num_cols(3), cubrid_affected_rows(3).
PHP Documentation Group CUBRID_NUM_ROWS(3)