Thanks Carp. At the end I decided to use pipelined table function as follows:
DROP FUNCTION array;
DROP FUNCTION regular_array;
DROP TYPE array_table_type;
DROP TYPE array_row_type;
--
--First define a row type that contains the columns we need
--
CREATE TYPE array_row_type
AS OBJECT
(...
I am new to associative arrays.
Here I am trying to do the equivalent of the folowing:
create table mytable as select n1,padding from T1 where rownum <=5;
Table created.
And join this table with T1 and the get the first 10 matching records
1 SELECT * FROM
2 (
3 SELECT
4...
I have a table t that I created as follows:
CREATE TABLE T
AS
(
SELECT
a.*
,RPAD('*',4000,'*') AS PADDING1
,RPAD('*',4000,'*') AS PADDING2
FROM ALL_OBJECTS a
)
ORDER BY dbms_random.random;
ALTER TABLE T ADD CONSTRAINT T_PK PRIMARY KEY (object_id);
this table has...
Thanks guys.
CREATE TABLE T
AS
(
SELECT
a.*
,RPAD('*',4000,'*') AS IND_PAD
,RPAD('*',4000,'*') AS IND_PAD2
FROM ALL_OBJECTS a
)
ORDER BY dbms_random.random;
ALTER TABLE T ADD CONSTRAINT T_PK PRIMARY KEY (object_id);
The above works fine. We are using this to test...
Oracle does not seem to like:
CREATE TABLE T AS (SELECT *,RPAD('*',4000,'*) FROM ALL_OBJECTS) ORDR BY dbms_raddom.random
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
However I think the only way is to do:
CREATE TABLE T AS (SELECT * FROM...
Hi,
I created a table T1 with index as follows:
CREATE TABLE T1
(
n1 NUMBER(5) NOT NULL,
ind_pad VARCHAR2(40) NOT NULL,
n2 NUMBER(5) NOT NULL,
small_vc VARCHAR2(10) NOT NULL...
Thank you Santa all fixed.
In the statement below:
FOR i IN 1 .. l_data.count
LOOP
BEGIN
SELECT * INTO l_rec FROM t WHERE object_id = l_data(i).object_id;
EXCEPTION WHEN NO_DATA_FOUND THEN NULL...
I have been given a sample code to test. The code is as follows:
create table t as select * from (select * from all_objects order by dbms_random.random);
alter table t add constraint t_pk primary key (object_id;
1 declare
2 type array is table of t%rowtype index by binary_integer;
3...
I have Oracle 11.2.0.1.0 - 64bit
I created a table called T1 as follows:
select DBMS_METADATA.GET_DDL('TABLE','T1') from DUAL;
CREATE TABLE "MICH"."T1"
( "N1" NUMBER(5,0) NOT NULL ENABLE,
"IND_PAD" VARCHAR2(40) NOT NULL ENABLE,
"N2" NUMBER(5,0) NOT NULL ENABLE...
You can test it in UNIX script as follows:
isql -U${USERNAME} -P${PASSWORD} -S${SQL_SERVER} -w1000 << ! > ${LOG_FILE}
exit
!
if [[ $? != 0 ]]
then
msg="`date` ${SQL_SERVER} problem. ${SQL_SERVER} on ${HOST} is down or...
Try isql with -X option
isql -U${USERNAME} -P${PASSWORD} -S${SERVER_NAME}
-w1000 -X
exec sp_addlogin <LOGIN_NAME>,<PASSWORD>,<DATABASE>, ...
go
-X specifies that, in the connection to the server, the application initiates the login with client-side password encryption
HTH,
Learner
To get a list of all tables in a given database do:
use <DATABASE>
go
select name from sysobjects where type = 'U' order by name
go
To see a structure of a table do
sp_help <TABLE_NAME>
go
etc
good luck
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.