Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OMB PLUS - Problem passing Unix environment variables to OMBPlus

666880Oct 23 2008 — edited Sep 13 2009
Due to a requirement to encapsulate deployment of OWB applications, we currently start OMBPlus.sh from our own wrapper ksh script (deploy.ksh) in order to get the new / changed application into the target control center etc.
We now have a new requirement that means we need to pass the content of the Unix environment across to OMBPlus.sh (and from thence into our deployment tcl scripts).

No problem, if you believe the tcl documentation. The entire Unix environement gets dumped into a hash array called 'env', so you can get the variable's value out just by saying $env(unix_valraible).
Sounds great, it should work a treat.

Except OMBPlus only silghtly resembles tclsh.
The 'env' that gets into OMBPlus bears practically no resemblance to the 'env' that existed before OMBPlus.sh got invoked.

Does anyone have:
a decent explanation for why the env gets scrambled (and how to avoid it) ?
or an alternative method of getting the Unix environment varaible values into OMBPlus ?
Please do not propose passing them all on the command line because (would you beleive it) the values are database passwords !

Edited by: user10466244 on 23.10.2008 09:28

Comments

thatJeffSmith-Oracle

If you have a rest api with ORDS, it can accept a json payload and it can be stored natively as a json document in the database, or as rows in a table. There are multiple code/feature paths you can take to accomplish this.
ORDS is responsible for serving up the REST APIs, not for CALLING APIs. To call a REST API from the database, you'd use an apex helper package or write your own UTL.HTP calls.

User_H3J7U

Call Rest API from oracle and convert the json content into oracle table data fields and store in the database - is it possible solution? if so , how?

-- Original rest http://openexchangerates.org/api/currencies.json:
-- {
--  "AED": "United Arab Emirates Dirham",
--  "AFN": "Afghan Afghani",
--  "ALL": "Albanian Lek",
--  "AMD": "Armenian Dram",
--  "ANG": "Netherlands Antillean Guilder",
-- ...
with function json_transpose(jsn clob) return clob as
-- {key1:value1,...} -> [{name:key1,value:value1},...]
  ctx dbms_mle.context_handle_t;
  res clob := empty_clob()||'';
begin
  ctx := dbms_mle.create_context();
  dbms_mle.export_to_mle(ctx, 'jsn', jsn);
  dbms_mle.eval(ctx, 'JAVASCRIPT', q'<
    const bind = require("mle-js-bindings");
    const lob = bind.importValue("jsn");
    const src = JSON.parse(lob.read(lob.length(),1));
    const tgt = [];
    for(const elm in src) tgt.push({name:elm,value:src[elm]});
    tgt
    >', res);
  dbms_mle.drop_context(ctx);
  return res;
end;
rest as (select json_transpose(httpuritype('http://openexchangerates.org/api/currencies.json').getclob()) j from dual)
select *
from rest
     nested j[*] columns(name, value)
where rownum<=5;
/

NAME  VALUE                                   
----- ----------------------------------------
AED   United Arab Emirates Dirham             
AFN   Afghan Afghani                          
ALL   Albanian Lek                            
AMD   Armenian Dram                           
ANG   Netherlands Antillean Guilder           
CT_Resident

Thanks Jeff, Yes I need to call the Rest API by GET , can you send me links for example usiing Apex package and utl htttp

thatJeffSmith-Oracle

If you Google for them, you will find them in the usual places by the usual people.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 11 2009
Added on Oct 23 2008
8 comments
2,052 views