New to Oracle SQL
Hi all Im very new to his Oracle stuff.. Can anyone guide in learning where I can get a good and easily understable documentation. So that I can learn the oracle very fastly.
Thanks in advance
Mahesh Gupta
Also there are some videos on youtube for Oracle tutorial. You can also refer them.
http://www.google.co.in/#q=official+oracle+tutorial&hl=en&biw=837&bih=448&prmd=ivns&source=univ&tbs=vid:1&tbo=u&ei=PpUiTfL0CMKa8QOju7CDBQ&sa=X&oi=video_result_group&ct=title&resnum=5&ved=0CEYQqwQwBA&fp=71bb22fc7c95cf07
Similar Messages
-
Hi, i am new to oracle, SQL DEVELOPER:- ERROR:- ORA-01918
Hi,
I am new to oracle, and i have installed Oracle database 12c enterprise edition, and oracle jdeveloper 12c for adf web application development,
I created a database and a new connection in it using sql developer, however while trying to create new user with the name db1 by right clicking on other users. by following the instructions in oracle documentation site. i get the error that new user db1 doesnt exist, and gives error:- ORA-01981. i even tried by changing the username as i thought may be it doesnt support alphanumeric name, but still i get the same error.
So please tell me how to create a new user. is there any way to get out of this ora:-01918, as i googled and it says this is a bug.
My os is win 7 x64(amd processor ).
Thank you
BaldwinA new user (called a schema in Oracle) is created using the CREATE USER SQL command. You need to be signed in as the SYS schema/user or as a schema that has been granted the rights to create schemas.
12c database comes in two basic flavours. Container database (containing pluggable databases). Standard database. If connected to a container database, you cannot create standard user schemas - you need to be connected to a pluggable database.
Also, your question has no relevance to either the SQL or PL/SQL languages - the subject matter of this forum. Please repost your question to a more appropriate forum dealing with SQL-Developer issues. -
WHILE Loop - NEW TO ORACLE & SQL
I was assigned a task to loop through an organization heirachy drill until a certain a value is reached. What I mean by this is that I have to select three fields from a ORGN table to find the correct ORGN_CODE: ORGN_CODE, ORGN_CODE_PRED, ORGN_ID.
I need to be able to check if ORGN_ID = 'CONVERT'.
If it is true, then I need run another select statement where ORGN_CODE_PRED = ORGN_CODE. Then I check if ORGN_ID = 'CONVERT' again. Eventually, ORGN_ID <> 'CONVERT' and I have successfully drilled down to the correct ORGN_CODE Level. I'll then need to create a new field and insert the value into a table
I can run a basic query but when it comes to this functionality, I'm rather new. Here is my select statement to bring in the data the first time.
select ftvorgn_orgn_code as ORG_CODE,
ftvorgn_orgn_code_pred as PREDECESSOR,
ftvorgn_user_id as NEXT_PREDESSOR
from ftvorgn
The way "I think" I need to do this is like this:
Declare
MyORG Integer
MyValue Char(10)
Declare ORG_CURSOR for
select ftvorgn_orgn_code as ORG_CODE,
ftvorgn_orgn_code_pred as PREDECESSOR,
ftvorgn_user_id as NEXT_PREDESSOR
from ftvorgn
Declare NEW_ORG_CURSOR for
select ftvorgn_orgn_code as ORG_CODE,
ftvorgn_orgn_code_pred as PREDECESSOR,
ftvorgn_user_id as NEXT_PREDESSOR
from ftvorgn
where ftvorgn_orgn_code = MyORG
Open ORG_CURSOR
Fetch Next from ORG_CURSOR
WHILE (NOT SURE WHAT GOES HERE)
Begin
If NEXT_PREDECESSOR = 'CONVERT'
set MyORG = ORGN_CODE
set MyValue = 'CU'||ORGN_CODE
{Have to work on code to insert into table}
ELSE
set MyORG = ORGN _CODE
Open NEW_ORG_CURSOR
Fetch Next from NEW_ORG_CURSOR
WHILE (NOT SURE WHAT GOES HERE)
Begin
If NEXT_PREDECESSOR = 'CONVERT'
set MyORG = ORGN_CODE
set MyValue = 'CU'||ORGN_CODE
{Have to work on code to insert into table}
Else
set MyORG = ORGN _CODE
Open NEW_ORG_CURSOR
Fetch Next from NEW_ORG_CURSOR
End
End
Close ORG_CURSOR
Close NEW_ORG_CURSOR
Deallocate ORG_CURSOR
Deallocate NEW_ORG_CURSOR
GO
I can only imagine how horrible this looks to average ORACLE DB/SQL programmer and would appreciate any help on this. I'm scheduled from some training down the road, but for now I'm trying to learn on my own.
Thanks for any constructive feedback and input.I've tried this code with the following results:
select ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id,
substr(sys_connect_by_path(ftvorgn_orgn_code,'-'),2) as path
from ftvorgn
connect by ftvorgn_orgn_code = prior ftvorgn_orgn_code_pred
start with ftvorgn_ORGN_CODE = '530340' and ftvorgn_user_id <> 'CONVERT'
FTVORGN_ORGN_CODE FTVORGN_ORGN_CODE_PRED FTVORGN_USER_ID PATH
530340 F00602 SUAGUILA 530340
F00602 E00602 CONVERT 530340-F00602
E00602 D00602 CONVERT 530340-F00602-E00602
D00602 C00598 CONVERT 530340-F00602-E00602-D00602
C00598 B00595 CONVERT 530340-F00602-E00602-D00602-C00598
B00595 A00002 MERROSS 530340-F00602-E00602-D00602-C00598-B00595
A00002 CONVERT 530340-F00602-E00602-D00602-C00598-B00595-A00002
C00598 B00595 GBLACK77 530340-F00602-E00602-D00602-C00598
B00595 A00002 MERROSS 530340-F00602-E00602-D00602-C00598-B00595
A00002 CONVERT 530340-F00602-E00602-D00602-C00598-B00595-A00002
Message was edited by: bjm
I then changed the code to the following and got the following results:
select substr(path,1,instr(path,'-')-1) base, substr(path,instr(path,'-',-1)+1,length(path)-instr(path,'-',-1)) top
from (
select substr(sys_connect_by_path(ftvorgn_orgn_code,'-'),2) path
from ftvorgn
connect by ftvorgn_orgn_code = prior ftvorgn_orgn_code_pred
start with ftvorgn_orgn_code = '530340' and ftvorgn_orgn_code_pred <> 'CONVERT'
BASE TOP
530340
530340 F00602
530340 E00602
530340 D00602
530340 C00598
530340 B00595
530340 A00002
530340 C00598
530340 B00595
530340 A00002
530340
530340 F00602
530340 E00602
530340 D00602
530340 C00598
530340 B00595
530340 A00002
530340 C00598
530340 B00595
530340 A00002
Message was edited by:
This is my current code and results. I still can not capture when ftvorgn_user_id <> 'CONVERT' after the initial start with....do I need to include a where statement inside this query??
select substr(path,1,1) as bottom_level, min(substr(path,-1,1)) as vp, ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id from (
select ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id, substr(sys_connect_by_path(ftvorgn_orgn_code,'-'),2) as path
from ftvorgn
connect by ftvorgn_orgn_code = prior ftvorgn_orgn_code_pred
start with ftvorgn_orgn_code = '530340' and ftvorgn_orgn_code <> ftvorgn_orgn_code_pred and ftvorgn_user_id <>'CONVERT')
group by substr(path,1,1),ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id
BOTTOM_LEVEL VP FTVORGN_ORGN_CODE FTVORGN_ORGN_CODE_PRED FTVORGN_USER_ID
5 0 530340 F00602 SUAGUILA
5 2 A00002 CONVERT
5 5 B00595 A00002 MERROSS
5 8 C00598 B00595 CONVERT
5 8 C00598 B00595 GBLACK77
5 2 D00602 C00598 CONVERT
5 2 E00602 D00602 CONVERT
5 2 F00602 E00602 CONVERT -
Getting the followung error, which I assume is a privs error, when using debugger:
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '10.200.10.79', '3824' )
ORA-30683: failure establishing connection to debugger
ORA-12535: TNS:operation timed out
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
Process exited.
Please advise.
Thank uI just got this working yesterday. I'm using SQL Developer on my Windows XP box. When I started the Remote Debugger I was prompted for a Port and Local Address. I accepted the default of port 4000 and entered my PC's IP Address as the Local Address. If you're also on a Window's box you get this address by going to the command line and typing "ipconfig".
When your DBA is talking about the Oracle listener being on port 1521 he's talking about the Oracle server having a process on it listening for outside processes that want to connect to the database. I'm guessing that your DBA doesn't understand what you're trying to accomplish. In your case starting the Remote Debugger is creating a listener on your development box which listens for something like ApEx to connect to it. If the bottom left of my SQL Developer I see a little satellite icon that says Debug Listener (Port=4000 Timeout=0 Local address=xx.xx.xx.xx). This lets me know that the Remote Debugger is waiting for a connection.
Your call...
CALL DBMS_DEBUG_JDWP.CONNECT_TCP('remotedb','1521')should be connecting to the box that you're running SQL Developer on, not your Oracle database server. It's values should match those that you set when you started the Remote Debugger.
I followed the tutorial found at:
http://www.oracle.com/technology/oramag/oracle/08-may/o38browser.html
Edited by: MARTIN_K on Aug 29, 2008 11:11 AM -
New to Oracle SQL : Cannot connect to the server
I am familiar with MySql and find that some of the syntax are different. I would like to get certified in Oracle DB and would like to know whats the best approach to take. Where do I start? I downloaded 10g on my mac os and not sure what to do next. How do i run the Oracle DB now that it is installed?
Also, It recommends trying Oracle Enterprise Manager Database Control via http://host.domain:5500/em/. I used my ip address for the host but but what is the domain? I typed for eg http://0.0.0.0:5500/em/ but i get the following error message
Safari can’t connect to the server.
Safari can’t open the page “http://0.0.0.0:5500/em” because Safari can’t connect to the server “0.0.0.0”.
Thanks for any help you guys.
Jeannie
Edited by: user11892898 on Sep 12, 2009 6:31 AM
Edited by: user11892898 on Sep 12, 2009 6:41 AMuser11892898 wrote:
Also, It recommends trying Oracle Enterprise Manager Database Control via http://host.domain:5500/em/. I used my ip address for the host but but what is the domain? I typed for eg http://0.0.0.0:5500/em/ but i get the following error message
Safari can’t connect to the server.
Safari can’t open the page “http://0.0.0.0:5500/em” because Safari can’t connect to the server “0.0.0.0”.
...If you have installed Oracle Server in your computer then you should see the menu item added in the Start -> Programs path. Look for "Database Control - <db_name>" or something similar. When you click on it, it opens up the browser with the correct URL. If the browser doesn't show up anything still, then check if the service is up. Start -> Settings -> Control Panel -> Administrative Tools -> Services. Ensure that the service "OracleDBConsole<db_name>" has "Started" status.
Try using your full computer name for "host.domain". Right click "My Computer" on the desktop -> Properties -> "Computer Name" tab -> Full computer name. The Start menu item mentioned in the earlier paragraph does this for you.
HTH,
isotope -
Problem with java.sql.Clob and oracle.sql.CLOB
Hi,
I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below
java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);
lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));
lResourceStatus = true;
can anybody please tell me the what is the problem with this and solution.
thanks,
Ashok.Hi Ashok
You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").
Just check your classpath and see if you are referring to the correct jar files.
cheers
Sameer
PS: Please award points if you find the answer useful -
Is ORACLE SQL DEVELOPER up to other Tools?
Hi Experts,
Am new to Oracle SQL Developer Tool. Can anyone tell me what are the drawbacks of this ORACLE SQL DEVELOPER.
Is SQL DEVELOPER up to other Tools?
Thanks in Advance!
Regards,
AnupAnup wrote:
Yah it's true... But I want to know is there any drawbacks in case of User Interface or Performance or any as compared to other Tools like SQL Navigator or Toad ?This is a wrong place for this question. You need to post it in SQL Developer Forum.
SQL Developer -
Oracle/sql/Datum Class not found
Dear All ,
I am very new in Oracle SQL XML utility.
I am trying to run(gx.java) the following code, I am getting the following error :
============
Error:
java.lang.NoClassDefFoundError: oracle/sql/Datum
at oracle.xml.sql.query.OracleXMLQuery.<init>(OracleXMLQuery.java:126)
at gx.main(gx.java:41)
Exception in thread "main"
=============
Can any one help me.
Thanks & Regards
Subrata SEN
Source Code:
============
import java.awt.*;
import oracle.xml.sql.query.*;
import java.sql.*;
import java.net.*;
import java.awt.*;
import connection.connect;
public class gx
public static void main(String args[])
String tabName = "emp";
String user = "scott/tiger";
Connection conn = null;
connect initCon = new connect();
OracleXMLQuery qry = null;
try
// DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// conn = DriverManager.getConnection("jdbc:oracle:oci8:scott/tiger@");
conn = initCon.setConnection( "scott", "tiger" );
if( conn == null )
System.out.println( " Connection failed ........returning" );
return;
catch(Exception dce)
System.out.println( " Failure : " + dce);
try
System.out.println( " 1." );
qry = new OracleXMLQuery( conn, "select empno, ename from emp" );
System.out.println( " 2." );
qry.setMaxRows(2);
qry.setRowsetTag( "ROOTDOC" );
qry.setRowTag( "DBROW" );
qry.setStyleSheet( "emp.xsl" );
String xmlString = qry.getXMLString();
System.out.println( "OUTPUT : \n" + xmlString );
catch(Exception eQry)
System.out.println( " Exception QRY : " + eQry );
System.out.println( "Program initialized....." );
=================While the XML SQL Utility does not require the Oracle JDBC driver, it must have the Oracle JDBC driver in the CLASSPATH.
-
Problems when starting with oracle SQL developer
Hello,
I am very much new with oracle SQL developer. I use oracle 10g and have a database named 'pallabDB' with username: xxxxxx and paswd:yyyyyy. I have installed oracle SQL developer.But i am unable to start up.What i should do? If any body replies it will be a great help.Thanks in advance.But i am unable to
start up.How to understand this sentence without confusion?
Can you explain exactly what is your problem at start up of SQL Developer? -
New To Oracle.. Needs Help:: Conversion from SQL Server to Oracle 11g
I am new to Oracle 11g and badly need the conversion of SQL Server Functions to Oracle.. Sample Pasted Code not working .. end with error.. pls help
Create Table TempT (ID1 Varchar (10),
ID2 Varchar (10)
CREATE OR REPLACE PACKAGE GLOBALPKG
AS
TYPE RCT1 IS REF CURSOR;
TRANCOUNT INTEGER := 0;
IDENTITY INTEGER;
END;
CREATE OR REPLACE FUNCTION fTempT
i IN VARCHAR2 DEFAULT NULL
RETURN GLOBALPKG.RCT1
IS
REFCURSOR GLOBALPKG.RCT1;
BEGIN
OPEN REFCURSOR FOR
SELECT TT.*
FROM TempT TT
WHERE (fTempT.i = ''
OR TT.ID1 = fTempT.i)
RETURN REFCURSOR;
END;
CREATE OR REPLACE FUNCTION fTempTF
i IN VARCHAR2 DEFAULT NULL
RETURN GLOBALPKG.RCT1
IS
REFCURSOR GLOBALPKG.RCT1;
BEGIN
OPEN REFCURSOR FOR
SELECT *
FROM TABLE(fTempT(i))
RETURN REFCURSOR;
END;
LAST FUNCTION ENDs WITH ERROR
Error(13,7): PL/SQL: ORA-22905: cannot access rows from a non-nested table item2. The major purpose is to get a simplest way to create a parameterized function who can return a table like output. 2nd function has no use instead i was testing the result of First Function like thisIf you just want to select from a select, you should use a view not a function.
1. which program is more help ful for writing and executing queries bcoz after using Query Analyzer of Microsoft It seems difficult to work on SQL Developer.
sqlplus? If you are having difficulty learning new tools because of an old one you used, probably best to forget the old one and concentrate on learning the new one because it will be different. This goes for the database itself also.
2. Can DMLs be used within a Function.Yes, you just can't execute the function in another SQL statement if it modifies data and this is a good thing.
3. Can temporary tables be used within a function.Unfortunately yes, but they shouldn't be unless you are in a slowest application competition.
5. Each Function which is a Table Function must be accompanied with Type Definitions?? its a bit longer way of doing the things than SQL ServerThat is why it is better to use views instead, is there any reason you want a select that you can select from inside a function?
SQL Server for last 9 years thats why i refer this toolThat is not in itself a problem, if you try and do what you did in SQLServer in Oracle, that will be a problem though. -
Oracle SQL Developer 1.0 is easy to install and use, and is portable
I have tried the latest version of Oracle SQL Developer 1.0 and would like to share my experience of using it.
Installation of Oracle SQL Developer 1.0
Download from
http://www.oracle.com/technology/software/products/sql/index.html?_template
Unzip the Oracle SQL Developer for Windows (55.8 MB) to C:\sqldeveloper (103MB)
Advantages: The unzip folder can be your removable disk and you can access Oracle
anywhere provided that there is an Internet connection to Oracle Server.
Unzip sqldeveloper-1557.zip to C:\ with folder name;
double-click on sqldeveloper.exe in c:\sqldeveloper
Click on [No]
Tick all check boxes
Click on [OK]
Right-click on Connections, New
Database Connection…
Enter User name: SCOTT
Password: TIGER
Hostname: 127.0.0.1 (or IP of your Oracle Server on the Internet)
SID: orcl
If you want to connect to local Oracle user SYS,
Enter User name: sys
Password: ora10g_manager_password
Hostname: 127.0.0.1
SID: orcl
Select Role: SYSDBA
Click on [Connect]
Right-click on Tables, Create Table
Click on [Add Column]
Select Type: NUMBER for COLUMN2
Click on [OK]
Table1 is created
Click on TABLE1, click on “Data” tab
Click on the “Green Plus” icon to insert record
Click on “Commit Changes” icon
Click on “DBConnection1” tab
Enter: select * from table1;
Click on “Execute Statement (F9)” icon
To exit: Click on File, ExitHave you noticed that there's a forum dedicated to SQL Developer?
C. -
How to do it? Need help in syntax - new to Oracle syntax
create or replace
PROCEDURE "SP_SAMPLE_data" (prodName in VARCHAR2) AS
where_criteria char(100);
BEGIN
if prodName = 'A' then
I want to build the where criteria string as “product_name in (‘iPod’,’iPad’)”
else
I want to build the where criteria string as “product_name = directly read from the passed variable(prodName)”
end if;
select *
from “MySchema”.”MyTable”
where where_criteria concatenated here – do not know how to concatenate;
END SP_SAMPLE_data;
New to Oracle PL/SQL syntax.
Oracle 10gR2You could try someting like this
create or replace procedure SP_SAMPLE_data (prodName in VARCHAR2) AS
where_criteria char(100);
sql_stmt varchar2(1000);
BEGIN
if prodName = 'A' then
-- I want to build the where criteria string as "product_name in ('iPod','iPad')"
where_criteria := 'product_name in (''iPod'',''iPad'')';
else
-- I want to build the where criteria string as
-- "product_name = directly read from the passed variable(prodName)"
where_criteria := 'product_name = '''||prodName||'''';
end if;
sql_stmt := 'select * from MySchema.MyTable'||where_criteria;
END SP_SAMPLE_data;I added SQL_STMT variable as I am not sure what do you want to do with SQL statement once it is created. Do you plan to execute it in the procedure or pass it back to the calling environment? If you need to pass it back, then specify SQL_STMT as out parameter. -
Unable to connect to Oracle Database using Oracle Sql developer 2.1.1.64
Hi Everyone,
I am searching for some help regarding my problem with Oracle connectivity. I have installed Oracle 11g release 2 on my Windows XP Professional Laptop. For a few days after installation i could connect to the Oracle database with the SYSTEM account using Oracle SQL developer ( installed on the same Laptop) but now i am unable to do so.It gives me this annoying message:
An error was encountered performing the required operation Got a minus one from read call .Vendor code 0
However i am able to connect using Sql Plus by supplying the username SYSTEM and the corresponding password.
My TNSNAMES .ora file is as follows:
ORACLE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORACLE)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
My Listener.ora file is as follows:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
(SID_DESC =
(GLOBAL_DBNAME = Oracle)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(SID_NAME = Oracle)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
ADR_BASE_LISTENER = D:\app
My Sqlnet.ora file is as follows:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
I am new to Oracle and so i need someone in this forum who can help me resolve this problem. Also i even tried connecting to the database using Toad 10.5.0.41. It give me the following error:
ORA 12537 : TNS Connection closed
Thanks for your patience and help in advance.
---PrashantHello Irian and Sue,
I can connect to the Oracle database using SQL Plus. Now when i TNSPING ORACLE from command line i get the following message :
Used parameter files:
D:\app\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =localhost
*)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORACLE)))*
TNS-12537: TNS:connection closed
Thanks for your response to my initial post.Do u have any other methods to resolve this? -
Dear all;
Please pardon me. I am new to oracle report builder and I am trying to accomplish the following. First and foremost please find my pl/sql queries below. Kindly note, all the queries have been tested and I just need to be able to input those queries into the report builder. Thank you.
create or replace package test1 is
type r_cursor is ref cursor;
function report(company_name in varchar2) return r_cursor;
end test1;
create or replace package body test1 is
function report(company_name in varchar2) return r_cursor as
my_r_cursor r_cursor;
begin
if(company_name = 'ALL COMPANIES') THEN
open my_r_cursor for
select t.t_id, t.t_description from t1 t;
return my_r_cursor;
elsif(company_name != 'ALL COMPANIES') THEN
open my_r_cursor for
select t.t_id, t.t_description from t1 t
where t.t_id = company_name;
return my_r_cursor;
end if;
end;
end test1;
create table t1
t_id varchar2(200) not null,
t_description varchar2(250),
primary key(t_id)
insert into t1
(t_id, t_description)
values
('CITI', 'PROFIT: 2.2Billion');
insert into t1
(t_id, t_description)
values
('GE', 'PROFIT: 1Billion');
insert into t1
(t_id, t_description)
values
('JPMORGAN','PROFIT: 0');Now, I am trying to create a simple report in oracle report builder. The interface for generating for this report is basically, there is a dropdownlist where by the user picks a company name from the dropdownlist and clicks on the go button, this should then generate a report with the above query shown in the package. How can this be achieved? All help will greatly be appreciated.Hi,
first of all you need strong typed ref cursor, oracle reports need to detect witch are the columns returned by your cursor.
so first you create your package
create or replace package test1
as
TYPE t_record IS RECORD ( company_number PLS_INTEGER--TABLE_NAME.COLUMN_NAME%TYPE
, company_desc VARCHAR2(150)--TABLE_NAME.COLUMN_NAME%TYPE
TYPE T_REF_CURSOR IS REF CURSOR RETURN t_record;
procedure report(company_name in varchar2 ,cur_out OUT t_ref_cursor) ;
end test1;
show errors
create or replace package body test1
is
procedure report(company_name in varchar2 ,cur_out OUT t_ref_cursor)
is
my_r_cursor T_REF_CURSOR;
begin
if(company_name = '1')
THEN
open my_r_cursor for
select 1 as t_id, 'description' ast_description from dual
else
open my_r_cursor for
select 2 as t_id, 'description2' as t_description from dual
end if;
end;
end test1;
show errors
then, in your report you create a ref cursor query :
function QR_1RefCurDS
return test1.t_ref_cursor
is
C_return test1.t_ref_cursor;
begin
test1.report(1,C_return);
RETURN(C_return) ;
end;
hope this helps you !
E -
Forms installation problem - how do I create a new default Oracle home?
I am new to Oracle so please forgive my utter ignorance. My impression of Oracle because of how an installation
has to be done is taking a nosedive. I thought Microsoft was bad with all the re-booting but the explanation that I
read in Anubhav Seth's post about installing Dev 6i before 8i and the suggestion (not a requirement) to format the
harddisk and reinstall Windows just leaves me with my jaw hanging open. I'm having a little trouble swallowing that
one.
Here's my situation... I'm running 8i at home and I am using it for the Oracle courses that I am taking at a local
university. So 8i with its SQL*Plus has been all I have needed to date. Now we have a project to do that involves forms.
So I go to the OTN page for downloads and downloaded file 6irel2nt.exe which is 264 MB in size. This file, I assume,
has forms in it -- what else I don't know because things are not explained all that well on the web site or I don't know
where to look (which implies poor organization of the web pages).
I run the 6irel2nt.exe file and end up with 11,128 new files on my computer. That's nice. I run the setup file and a step or
two into it it complains that my 'Ora81' home is already being used and that I need to install it into another Oracle Home.
Now I'm trying to find out how I create another Oracle Home. I perform a search in GOOGLE on "creat default Oracle
home" and basically get nowhere. My $50+ "Oracle 8i A Beginner's Guide" from Oracle Press mentions Oracle Home
on one page (pg. 170) but is completely useless in this case. My $184 worth of Oracle University manuals (which
are really PowerPoint slides) is useless too. My next step will be to comb through the FAQs. All this because I cannot
believe that I have to totally uninstall one product to get another to install and then reinstall the first one. That is INSANE!
If I have gone way off track please feel free to blast me but if this is true then all I can say is that the folks at Oracle need
a lesson in KISS (Keep It Simple Stupid)! Computers and computer software are supposed to make our lives simpler
not complicate the holy hell out of them. I'll get off my soapbox now. Sorry about the whining.I ended up uninstalling 8i and then I installed Dev 6i (Forms) and then I reinstalled 8i. I had some problems
installing Dev 6i because of this error "path.vrf(86): Unbound variable 'path_too_long_prompt'". Right after this error
appears I get a dialog that states, "The Oracle Installer cannot update the system path variable to %new_path%
because it is too long. Please restrict your system path to 127 characters and make sure D:\Oracle\OraWin95\bin
is included in your path."
The path D:\Oracle\OraWin95 was what I set up for this installation.
What I did to work around this problem was this...
(1) Go to Start - Accessories - System Tools - System Information.
(2) Click on the Tools menu
(3) Select System Configuration Utility
(4) Select the Autoexec.bat tab
(5) I added D:\Oracle\OraWin95\bin to my PATH variable and unchecked the checkbox next to one of the several
lines that I have that build my PATH variable. (I have several PATH lines that simply add a path to the system
variable %path%). After the installation is complete you can go back and turn back on the paths that you had disabled.
After installing 8i I did have a problem connecting to the database. I got this error:
Error: ORA-01034 Oracle not available
I believe this happened because I had forgotten to turn back on some of my PATH information that I mentioned
earlier. After checking one of my PATH variables and rebooting, this problem disappeared.
When reinstalling 8i and when the installation asks for an SID and you enter the SID you had used in the original
installation you may get a notice that says the SID already exists. I think this happens because the uninstall does not
clean up the registry totally, so I entered a different one. Later on, after the installation has been completed and you
are connecting to your database, you will be prompted to select an SID -- just make sure that you select the SID from
the latest installation.
I should've mentioned first that in preparing for this whole ridiculous exercise I created a directory under my Oracle
directory that I was going to use as the new 'Oracle home.' So I guess that's all one has to do to create a new Oracle
home -- just have another directory ready to install 'stuff' into.
All in all, this a pretty asinine exercise. Oracle really needs to fix this mess. I honestly thought Microsoft was bad but
this takes the cake. I wonder if SQL Server is this screwed up.
Maybe you are looking for
-
Oracel 11gR1 RAC Cluster issue
We have 2-node Oracle 11gR2 RAC on HP-UX 11.31 environment. It was running lase 2 month without any issue. We got some netconfig issue, and node-1 got rebooted today. after the reboot cluster didn't not start on node-1, database is running on node-2.
-
Setting my display to 96mhz messed my display.
Hi all, At 96mhz, my start ups show sync over range and I can't see anything. How can I revert my settings back to 70mhz after setting my display to 96mhz? Thanks Web dude
-
Hi all, when I'm in sales order page (but it appear also on others selling documents) using Toolbar Arrows to Find Documents I obtain the sequence: Doc. No.1 of 2007, and after doc No.1 of 2008, and after doc No.1 of 2009 and so on. So I'm wondering
-
What is the url of the WSDL generated by XI?
Hi all, I have generated a WSDL file for a message interface. I will like to see this WSDL in the wsnavigator. The wsnavigator requires me to input a wsdl url. What is the URL of this WSDL which I've just generated? Please advise. Thanks. Ron
-
The Color of Clipped Highlights
After watching Jeff Sengstack's Color Correction series over on Lynda I dove into correcting for the first time with a home movie. All is going well but when I'm using the RGB Color Corrector to brighten things up highlights from lit sources like li