Database query

G

Gaurav

Hi All,

I have a database query written in shell script as :

ORACLE_SID = "$dataenv"

insert into unizzz.job
select cu.user_id||wg.job_code||wg.subsystem,
cu.user_id,
wg.job_code,
' ',
wg.subsystem,
to_number(to_char(sysdate,'dddHHMIsssss')) + rownum || '01'
from nmclas.clas_users@$refenv cu,
nmclas.work_group@$refenv wg
where cu.work_grp=wg.work_grp and
cu.user_id=upper(rpad('khalnayak'),8))



Please note that I have logged in to the ORACLE_SID as dataenv, but I
search in some other database stored in the variable refenv.

Now how can I port this query in java ?

Considring I open a connection to dataenv, but can I still reuse the
same query which has got a reference to another database "refenv" ?

Regards,
Gaurav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top