Hi
i am new to DB2 and i am working on a java application on windows ,backend for this is DB2,
i am trying to access the db2 server which is on Mainframes from the java application on Windows...,i don't have db2 client installed on windows..
the jdbc driver used for the connectivity is jdbc type 4 .
at present i am using the following connection string in the application:
...
User Profile
Collapse
-
restricting a user to access his own tables
Hi all,
as a super user i want to restrict a user created by me to access only the tables created by him/her.
i.e he only can access or change the data in the tables created by him.and can not do anything on other's tables.
is there any grant command to do this. or is this the case by default.
pls help me out.
thanks in advance. -
There is somthing called Rowid using which u can select the last record from ur table irrespective of the table structure.
ex: this table contains two records as shown
SQL> select * from sujatha_third;
ROLLNO JOINDATE
---------- ------------------
2 07-DEC-06
1 07-DEC-06
SQL> select * from sujatha_third where rowid=(select max(rowid) from... -
user_constraint s contains both primary and foreign key constraints.
see the example below.i think it will help u.
SQL> create table x(id number constraint p1 primary key);
Table created.
SQL> create table x1(id number constraint f1 references x(id));
Table created.
SQL> select CONSTRAINT_NAME from user_constraint s;
CONSTRAINT_NAME...Leave a comment:
-
Excel Users
How to know who (authorised users)can change the controls in spreadsheet.
ex:for title ,company,auhor. ....we find in file properties.
is there any thing similar to this to find the users who can modify an excel sheet.(not the password protection)
thanks in advance -
This is the problem with the code u have given
SQL> SELECT TOP 1 empno, name, salary
2 FROM employee
3 WHERE empno IN
4 (SELECT TOP 3 empno
5 FROM employee
6 ORDER BY salary DESC)ORDER BY salary;
SELECT TOP 1 empno, name, salary
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expectedLeave a comment:
-
This is with FOR loop
SQL> begin
2 for i in 1..&n
3 loop
4 dbms_output.put _line(i);
5 end loop;
6 end ;
7 /
Enter value for n: 2
old 2: for i in 1..&n
new 2: for i in 1..2
1
2
PL/SQL procedure successfully completed.Leave a comment:
-
Hi u missed one more end if;
that is the problem.
the following code works.check it.
SQL> declare
2 sales number := &sales;
3 comm_rate number(5,2);
4 commission number(6,2);
5 begin
6 if sales <= 500
7 then comm_rate := 0.03;
8 else if sales <= 1000
9 then comm_rate := 0.05;
10 else
11 comm_rate...Leave a comment:
-
There is no function like characters in oracle i guess.
cast is used for type conversion
ex:to convert a date into varchar
select cast(bday as varchar(20)) from sujatha_example ;
CAST(BDAYASVARC HAR(2
--------------------
05/12/06 11:53:08AM
05/12/06 11:54:59AM
07/12/06 03:20:03PM
this is also used as substring function
ex:
SQL>...Leave a comment:
-
Hi this is the code:let me know any issues reg this
declare
2 i pls_integer :=1;
3 begin
4 loop
5 dbms_output.put _line(i);
6 i :=i+1;
7 exit when i=&n;
8 end loop;
9 end;
10 /
Enter value for n: 7
old 7: exit when i=&n;
new 7: exit when i=7;
1
2
3
4
5
6Leave a comment:
-
for the first code that i have given it's checking the range correctly but for insertion it's firing the trigger repeatedly.so
wat i did is i tried with after insert ,and if the sal is not in the given range i tried to delete it from the table (as it is already inserted).
SQL> create or replace trigger suj_range_check
2 after insert on employee
3 for each row
4 declare
5 empid...Leave a comment:
-
if it is giving the following oracle error
ERROR at line 1:
ORA-00036: maximum number of recursive SQL levels (50) exceeded
ORA-00036: maximum number of recursive SQL levels (50) exceeded
ORA-00036: maximum number of recursive SQL levels (50) exceeded
then the problem
is with insert
inside the trigger body u r trying to insert values into the table it again calls the trigger(before...Leave a comment:
-
what exactly the problem u r getting.
i have some code probably that can help u.
create or replace trigger suj_range_check
2 before insert on employee
3 for each row
4 declare
5 empid number(2):= :new.empid;
6 sal number(5):= :new.sal;
7 begin
8 if (sal>7000 or sal<500) then
9 raise_applicati on_error(-20002,'employee sal...Leave a comment:
-
Select * from employee where empid = (
Select empid from (Select * from employee order by sal desc) where rownum < &n+1
Minus
Select empid from (Select * from employee order by sal desc) where rownum < &n
) ;
enter n=3
enter n=3
or
Select * from employee where empid = (
Select empid from (Select * from employee order by sal desc) where rownum < &n
Minus...Leave a comment:
-
-
-
it didn't work too.
SQL> alter tablespace test_per_ts temporary;
alter tablespace suj_second_tab temporary
*
ERROR at line 1:
ORA-03218: invalid option for CREATE/ALTER TABLESPACELeave a comment:
-
init.ora contains initialization parameters
but my doubt is can we have two init.ora files for single DB.
i.e
we all know that there may be multiple instances for single DB.
so can we initialize the parameters for two different instances using two different init.ora files for a particular DB.Leave a comment:
-
i tried these before also n i'm using ORACLE 9.2 version.the errors are
SQL> desc all_data_files;
ERROR:
ORA-04043: object all_data_files does not exist
SQL> desc user_data_files ;
ERROR:
ORA-04043: object user_data_files does not exist
SQL> desc v$datafiles;
ERROR:
ORA-04043: object v$datafiles does not existLeave a comment:
-
init.ora file
Hi all,
can a database have two sets of init.ora file??
How can we make 2 instances refer to one database?
kindly reply me
Thank you
No activity results to display
Show More
Leave a comment: