How to get value of the CGI environment variable in Oracle

OWA_UTIL ওরাকল ডাটাবেজের ইউটিলিটি প্যাকেজ। এর একটি সাব প্রোগ্রাম হলো GET_CGI_ENV, এর মাধ্যমে ইউজারের আইপি, ডিভাইস ইনফো সহ অনেক কিছু পেতে পারি।

syntax: 

owa_util.get_cgi_env(parameter_name in varchar2) return varchar2;

যে সকল প্যারামিটার দিয়ে আমরা GET_CGI_ENV কে কল করতে পারি –

  1. PLSQL_GATEWAY
  2. GATEWAY_IVERSION
  3. SERVER_SOFTWARE
  4. GATEWAY_INTERFACE
  5. SERVER_PORT
  6. SERVER_NAME
  7. REQUEST_METHOD
  8. PATH_INFO
  9. SCRIPT_NAME
  10. REMOTE_ADDR
  11. SERVER_PROTOCOL
  12. REQUEST_PROTOCOL
  13. REMOTE_USER
  14. HTTP_CONTENT_LENGTH
  15. HTTP_CONTENT_TYPE
  16. HTTP_USER_AGENT
  17. HTTP_HOST
  18. HTTP_ACCEPT
  19. HTTP_ACCEPT_ENCODING
  20. HTTP_ACCEPT_LANGUAGE
  21. HTTP_REFERER
  22. HTTP_ORACLE_ECID
  23. WEB_AUTHENT_PREFIX
  24. DAD_NAME
  25. DOC_ACCESS_PATH
  26. DOCUMENT_TABLE
  27. PATH_ALIAS
  28. REQUEST_CHARSET
  29. REQUEST_IANA_CHARSET
  30. SCRIPT_PREFIX
  31. HTTP_COOKIE
  32. QUERY_STRING

example: 

DECLARE
   l_resp VARCHAR2(100);
BEGIN
--get value
   l_resp := OWA_UTIL.get_cgi_env('REQUEST_PROTOCOL');
--print output
   HTP.print (l_resp);
END;

sample output: 

PLSQL_GATEWAY : WebDb
GATEWAY_IVERSION : 3
SERVER_SOFTWARE : Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server
GATEWAY_INTERFACE : CGI/1.1
SERVER_PORT : 7780
SERVER_NAME : dummyserver
REQUEST_METHOD : POST
PATH_INFO : /wwv_flow.show
SCRIPT_NAME : /pls/dmt
REMOTE_ADDR : 148.132.152.59
SERVER_PROTOCOL : HTTP/1.1
REQUEST_PROTOCOL : HTTP
REMOTE_USER : APEX_PUBLIC_USER
HTTP_CONTENT_LENGTH : 416
HTTP_CONTENT_TYPE : application/x-www-form-urlencoded
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
HTTP_HOST : dummyserver.com.au:7780
HTTP_ACCEPT : */*
HTTP_ACCEPT_ENCODING : gzip, deflate
HTTP_ACCEPT_LANGUAGE : en-au
HTTP_REFERER : http://dummyserver.com.au:7780/pls/dmt/f?p=4500:1003:4479870342920497::NO:::
HTTP_ORACLE_ECID : 1297402712:144.135.172.44:22243:0:21186,0
WEB_AUTHENT_PREFIX :
DAD_NAME : dmt
DOC_ACCESS_PATH : docs
DOCUMENT_TABLE : wwv_flow_file_objects$
PATH_ALIAS :
REQUEST_CHARSET : UTF8
REQUEST_IANA_CHARSET : UTF-8
SCRIPT_PREFIX : /pls
HTTP_COOKIE : ISCOOKIE=true; LOGIN_USERNAME_COOKIE=U123456; LOGIN_PASSWORD_COOKIE=; LOGIN_REMEMBER_ME_COOKIE=; r1=%23ALL; r2=%23ALL; r3=%23ALL; propHide=4301%2C%23ALL; WWV_FLOW_USER2=47770A7FD83D3E0A; ORACLE_PLATFORM_REMEMBER_UN=U123456:dmt; __ppFullPath=di-di; s_nr=1296902947468; s_evar18=%5B%5B%27referral%27%2C%271296902515781%27%5D%5D; SearchSettings=50,0,0,1,1,1,1,1; HTMLDB_IDLE_SESSION=11-FEB-2011 10:22:00; WWV_CUSTOM-F_955908081711180_100=739B959ED77BAFE2
name=test&age=22

 

Published by

Ali Asgor

Graduate in GES, OCP holder, Self-motivated app developer, Programming lover, Lazy person...

4 thoughts on “How to get value of the CGI environment variable in Oracle”

  1. Greate post. Keep posting such kind of information on your page. Im really impressed by your site.
    Hi there, You’ve performed a great job. I’ll definitely digg it and for my part suggest to my friends. I’m confident they will be benefited from this site.
    diplomanc-russia24.com

  2. Excellent post. Keep writing such kind of information on your blog. Im really impressed by your blog.
    Hey there, You’ve done a great job. I’ll certainly digg it and in my opinion suggest to my friends. I am sure they will be benefited from this site.
    lee bet

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.