Help in copying table structure to another table with constraints in Oracle
hi,
i need to copy one table with data into another table,
right now am using
i want the constraints of table1 to be copied to table2 also , can anyone give me some solution to copy the constraints also, now am using oracle 10.2.0.3.0 version.
thanks,
senthil
Last edited by joeyg; 11-26-2013 at 08:57 AM..
Reason: Highlight the area, then click on the CodeTags button to encode the section
I have requirement:
1) Check the record count in table (table in oracle)
2) If records exists generate the file for existing records and wait for some time (Go to sleep mode) and
Again check the record count after 10 min.......... (Loop this process if record count >0).
3) Generate touch... (1 Reply)
I have requirement:
1) Check the record count in table (table in oracle)
2) If records exists generate the file for existing records and wait for some time then Go to sleep mode and
Again check the record count after 10 min.......... (Loop this process if record count >0).
3) Generate touch... (1 Reply)
There is table 'DEPT' in the database with the following desciption:
Name Null? Type
------- -------- ------------------------
DEPTNO NOT NULL NUMBER(2)
DNAME NULL VARCHAR2(14)
LOC NULL VARCHAR2(13)
Using shell script, I need to create a structure for the... (2 Replies)
Hi
I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.)
I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Hi,
I would like to copy some columns from a particular file by mapping with the string names. i am using the .csv file format.
my one file consist of 100 of columns but i want only particular 4 columns such as ( First_name, Middle_name,Last_name & Stlc). but they are listed in many files... (15 Replies)
Hello,
I'm working with putty on Windows 7 professional and I'd like to know if there's a way to gather specific lines from a pre-existing table and make a new table with that information.
More specifically, I'd like the program to look at a specific column, say column N, and see if any of the... (5 Replies)
Hi,
I need to extract only the create table structure with columns alone.
for eg
hive_table
show create table hive_table:
create table hive_table(id number,age number)
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION 'hdfs:/path/'
I need only below
... (5 Replies)
Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer:
<script>
$(function(){
$('tr, td, fieldset,... (0 Replies)
Hello guys,
I want to parse a JSON file in order to get the data in a table form.
My JSON file is like this:
{
"document":{
"page":
},
{
"column":
}
]
},
{
... (6 Replies)
Discussion started by: Gescad
6 Replies
LEARN ABOUT PHP
mysql_fetch_array
MYSQL_FETCH_ARRAY(3) 1 MYSQL_FETCH_ARRAY(3)mysql_fetch_array - Fetch a result row as an associative array, a numeric array, or bothSYNOPSIS
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should
be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
omysqli_fetch_array(3)
o PDOStatement::fetch
array mysql_fetch_array (resource $result, [int $result_type = MYSQL_BOTH])
DESCRIPTION
Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
o $
result -The result resource that is being evaluated. This result comes from a call to mysql_query(3).
o $result_type
- The type of array that is to be fetched. It's a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and
MYSQL_BOTH.
Returns an array of strings that corresponds to the fetched row, or FALSE if there are no more rows. The type of returned array depends on
how $result_type is defined. By using MYSQL_BOTH (default), you'll get an array with both associative and number indices. Using
MYSQL_ASSOC, you only get associative indices (as mysql_fetch_assoc(3) works), using MYSQL_NUM, you only get number indices (as
mysql_fetch_row(3) works).
If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the
same name, you must use the numeric index of the column or make an alias for the column. For aliased columns, you cannot access the con-
tents with the original column name.
Example #1
Query with aliased duplicate field names
SELECT table1.field AS foo, table2.field AS bar FROM table1, table2
Example #2
mysql_fetch_array(3) with MYSQL_NUM
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT id, name FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("ID: %s Name: %s", $row[0], $row[1]);
}
mysql_free_result($result);
?>
Example #3
mysql_fetch_array(3) with MYSQL_ASSOC
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT id, name FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("ID: %s Name: %s", $row["id"], $row["name"]);
}
mysql_free_result($result);
?>
Example #4
mysql_fetch_array(3) with MYSQL_BOTH
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT id, name FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
printf ("ID: %s Name: %s", $row[0], $row["name"]);
}
mysql_free_result($result);
?>
Note
Performance
An important thing to note is that using mysql_fetch_array(3) is not significantly slower than using mysql_fetch_row(3), while it
provides a significant added value.
Note
Field names returned by this function are case-sensitive.
Note
This function sets NULL fields to the PHP NULL value.
mysql_fetch_row(3), mysql_fetch_assoc(3), mysql_data_seek(3), mysql_query(3).
PHP Documentation Group MYSQL_FETCH_ARRAY(3)