SQL & PL/SQL :: Type In Code To Make Few Tables Then Run Code
Feb 13, 2012
I downloaded oracle sql developer, i type my code into a worksheet but if i use the run statement option, it asks me to make a connection. I dont want to make a connection, just test the data locally.However, even if I do try and make a connection, i get ora-12560 error (local connection).
I just want to type up some data to make some table and test to retrieve or manipulate the data. I'll use any program, command line or gui.
View 7 Replies
ADVERTISEMENT
Sep 5, 2011
format your code (Instant SQL Formatter is here) and - before submitting a message - enclose it into the [code] tags.Note the difference; see how the formatted code is easier to read?
View -1 Replies
View Related
Feb 28, 2011
I have the following chunk of code, which could return no rows, one row or many rows. When it returns one or many rows the DBMS_OUTPUT.PUT_LINE prints out my values. When no data is found 'Hello' is not printed?
Suggest a way I can change the code to make the exception print when no data is found?
SET SERVEROUTPUT ON;
BEGIN
FOR prec IN ( select * from xxx.part_maint where drop_partition = 'Y' )
LOOP
DBMS_OUTPUT.PUT_LINE (prec.SCHEMA_NAME || ' ' || prec.OBJECT_NAME);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE ('hello');
END;
View 1 Replies
View Related
Feb 12, 2009
I have no knowledge about Barcode. The problem is an issue of Loyalty Cards of a Hotel and Restaurant to various customers and then these cards will be presented by the customers time to time in the Hotel as well as Restaurant. The Owner of the Hotel and Restaurant wants to generate separate barcode for each card and when this card will be presented then the bar code reader will readout the code and the system will calculate the amount of discount/rebate. Because if the data entry operator enter the code of the card through key board the it will be a chance of leakage or misuse of that card.
View 8 Replies
View Related
May 30, 2012
I have to compare my SVN source code (packages, views etc) with the production code in the database like views etc (actually we are not sure that what we have in the svn is the final version of production code, we have objects created in the production database, but we don't have latest scripts for that. we have to deploy the svn code in the UNIX box).
So here the comparison is between the OS files and the database objects.
I thought I would get scripts of all the packages, views etc from the production database by using DBMS_METADATA or some utility and save the code in OS files then compare one svn file with OS file manually by using some comparison tools e.g toad provide one comparison tool.
View 5 Replies
View Related
Jul 8, 2011
I am trying to xcom the file from Linux server location to Windows server location through shell script. When i execute my DBMS_SCHEDULER to trigger the shell script i am getting the below mentioned error.
Error report:
ORA-27369: job of type EXECUTABLE failed with exit Exchange full
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at "CUSTDOMAIN.TSC_041_REPORT_PRC", line 50
[code]....
View 2 Replies
View Related
Mar 21, 2013
I have created a simple external job to run export (expdp) job to be run from PL/SQL. When I create a job as SYS user, the job runs good but the same fails when I execute it as application user. I am certain that I am missing some privileges.
Below is the job:
BEGIN
dbms_scheduler.create_job(
job_name => 'mytestjob',
job_type => 'executable',
job_action => '/u01/myexpdp.sh',
enabled => TRUE,
[code]....
View 8 Replies
View Related
Jun 14, 2011
I want to create a block of code that would search in all tables in a schema for a column_name where its data_length is like 4000 let's say. This data_length is actually dedicated for a comment column. If found, all not null column with like 4000 data_length will be changed by string "Comment has been removed". I have the following script below but it seemed lacking.
begin
for rec in (select table_name, column_name from user_tab_columns where column_name like ?data_length? = 4000 order by 1,2) loop
begin
execute immediate 'update '||rec.table_name||' set '||rec.column_name||' = ''Comment has been removed'' where '||rec.column_name||' is not null';
commit;
[code]........
View 6 Replies
View Related
Nov 2, 2011
how to debug PL/SQL code.
I mean if
procedure1 --calls---> procedure2
procedure2 --calls---> procedure3
procedure3 --calls---> procedure4
If procedure1 is my main procedure how do we know in procedure there is an unhandled exception or bug.
View 2 Replies
View Related
May 9, 2011
how to unwrap a PL/SQL Code???
View 2 Replies
View Related
May 28, 2008
I need to retrieve the records where the involvement is either a person or an organization. Using the code below i receive an error stating that the outer join operator is not allowed in the operand OR:
(( INVOL1.PERSON_IDENTIFIER(+)=ALL_PERSONS.IDENTIFIER )
OR ( INVOL1.OUNIT_IDENTIFIER_INV=INVOL1_ORG.IDENTIFIER(+) ))
If I change it to an and query it will only retrieve the records where there is a person and an organisation as the involvement but I need this option as well as one or the other.
View 7 Replies
View Related
Oct 15, 2009
I would like to backup all source code (packages, procedures, functions, etc) every day automatically. Is there a built-in feature of Oracle to do this, I've been going through the Toad IDE and its getting to be too time consuming.
I assume I could use the export command, but not entirely sure what to specify.
I would like to backup a few tables along all code and set something in place (trigger maybe?) to send me an email when a modification is made to the production code environment.
View 2 Replies
View Related
Jan 29, 2008
I am fighting with some code to work in IE7. It is currently working in Firefox.
A little bit more on the context of the situation is that I am entering the code as a personalization on an Oracle Self Service Page. I am entering in as a raw text personalization.
[Code]
<html>
<head>
<style>
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
[code].....
View 3 Replies
View Related
Jan 5, 2010
how to catch a null value with C# code?
My Asp.Net/C# application is connected to an Oracle database where it retrieves database values and also values calculated/returned from Oracle functions. My problem is that sometimes an Oracle function I calling returns a null value because of not correct input parameters which will cause Oracle function to (I think) return an null value. My problem and question is how to catch/obtain if he Oracle function returns a null value? Oracle function should return a decimal value if correct input parameters. Below is my row of code that crashes when Oracle function returns a null value in case of incorrect input parameters.
decGrossFreightRevenue = (decimal)(OracleNumber)cmdCalculateRevenueCall.ExecuteOracleScalar();
how to change my code to catch a null value and avoid a crash. I have tried several checks (if statements) without success.
View 2 Replies
View Related
Aug 4, 2011
I have the following data (columns IDx, STARTx and DURATION) and want to create the column RESULT. Example:
create table zTEST
( IDx number,
STARTx number,
DURATION number,
RESULT number );
insert into zTEST (IDx, STARTx, DURATION, RESULT) values ( 1 , null , null , null );
[code]...
The logic behind the table is like this: when there is a Start-ID and a Duration, the field Result shall show the Start-ID for the next records (Duration period). Even if there is a new Start-ID in row 9, it is ignored since threre is already a current signal from row 6 which is still running.
What is the sql code for the RESULT-column?
View 3 Replies
View Related
Jun 27, 2012
i have a table name item.
itemid itemdate Amt
200 17/06/2012 2000
201 18/06/2012 3000
202 19/06/2012 1000
203 20/06/2012 6000
204 21/06/2012 9000
205 22/06/2012 1000
205 24/06/2012 2000
203 26/06/2012 1000
this is the table i have in which repeated itemids for different dates,for example itemid 205 and 203 comes 2 times because that item was consumed again and again in a different date. like this the table data has more than a 20 thousand records;
In which i need to select the last updated dates itemid from this table, because same item id could be consumed 'n' number of times so i need to select it as per the last date or latest dates itemid from this table for each and every item, so how can i select it?
View 6 Replies
View Related
Feb 5, 2013
I have a problem in running a sql query.I have a dataset with the following details. Product name,product status,approval date in table product_details. I have a code as follows
select Product_name,
Product_status,
approval_date,
case
when product_status ='Cancelled' or product_status ='Stopped' then approval_date='N/A'
when product_status='Active' then NVL2(approval_date,cast(appoval_date as nvarchar2(30)),'Null')
when product_status='Completed' then NVL2(approval_date,cast(appoval_date as nvarchar2(30)),'Null1')
when product_status='Planned' then NVL2(approval_date,cast(appoval_date as nvarchar2(30)),'Null2')
end as DER_approval_date
from product_details
but i have a error in running this code saying character mismatch.
View 6 Replies
View Related
Jun 27, 2011
I have data like this:
a1 a2 a3 a4
ABC ABC xx zz
ABC xx mm mm
fg ui ok pl
I want to give them unique codes like :
Code for column
a1 Code1
ABCC-1
ABCC-1
fg C-2
then column
a2 Code2
ABC C-1
xxC-3
uiC-4
then column
a3 Code3
xxC-3
mmC-5
okC-6
then column
a4 Code4
zzC-7
mmC-5
plC-8
I can add these `columns in the table Code1 , Code2 etc columns to update.
View 1 Replies
View Related
Nov 2, 2011
i want to generate bar code in forms 6i but i don't know the code.
View 3 Replies
View Related
Feb 6, 2012
with the code below i have created 2 varaibles v_start_date and v_finish_date, i have inputs for them, thats fine the problem is when the inputs are empty, i have put a ELSIF statement in the begin section of the code, now if the variables have input from the textbox's then it works fine but if they are empty, the programme reads into the if statement executes that bit of code but doesn't seem to open the cursor up and execute that bit of code.
DECLARE
v_start_date enrollments.enrollment_date%TYPE:= :START_DATE;
v_finish_date enrollments.enrollment_date%TYPE := :FINISH_DATE;
CURSOR no_grades_cur IS
SELECT class_id,stu_id, status
FROM enrollments
[code].....
View 13 Replies
View Related
Apr 1, 2010
View the attached form image.
There are two List boxes namely :list_all (All) and :list_sel(Selected). :list_all show some data. What I want is to insert / delete records from the list_all to list_sel or vice versa using the buttons ( e.g.For one record using > and for all >>). The next step is to call a report to show data from the :list_sel.
I have populated the list_all with using the following query.
"select distinct all_ded,to_char(all_ded_id) from salary_temp order by all_ded"
Forms:6i
Database: Oracle9i
View 1 Replies
View Related
Sep 9, 2012
Is it possible to run Oracle 10g Report from PL/SQL code?
View 1 Replies
View Related
Mar 18, 2009
How do I coding My Exit Button
This Is My Code
-------------------
Declare
obutton number;
begin
obutton := Show_alert('ALT_EXIT');
clear_block(no_validate);
If obutton = ALERT_BUTTON1 Then
-- commit;
exit_form(no_validate);
else
exit_form(no_validate);
end if;
end;
--------------------
But When I pressed Yes Or No the database is not update. Why ? I have save My data with save button already no problem but why i close this form The data is'nt save?
So i have to put "summit;" in it when ALT_EXIT pass another warning* appear how do i exit program without the second warning
*it say about"2 record i already updated" about this but i can't remember exactly.
View 1 Replies
View Related
Dec 8, 2012
I want to display all account Code but i required this account PFKHR01010101010001 to be fixed to have Credit_Amount.
My Structure is
Finance_TRansactions
------------------------------
D_No Char(12);
Account_Code Char(19);
D_Date Date;
DEbit_Amount Number;
Credit_Amount Number;
[code]...
ORA-01427: single-row subquery returns more than one row
View 5 Replies
View Related
Jan 27, 2012
how to call this c++ code by using forms 6i To open and configure the COM port:
HANDLE hCom;
COMMTIMEOUTS lpTo;
COMMCONFIG lpCC;
char str_com[10];
unsigned short no_com = 0;
sprintf( str_com, "\\.\COM%d�", no_com+1);
hCom = CreateFile(str_com,GENERIC_READ|GENERIC_WRITE,0,NULL,
[code]...
To close the port :
CloseHandle(hCom);
To monitor communications events :
SetCommMask(hCom, dwEvtMask );
dwEvtMask is logical or with :
EV_BREAK, EV_CTS, EV_DSR, EV_ERR, EV_RING, EV_RLSD , EV_RXCHAR, EV_RXFLAG, EV_TXEMPTY values
and used WaitCommEvent function
BOOL WaitCommEvent(
HANDLE hFile,
LPDWORD lpEvtMask,
LPOVERLAPPED lpOverlapped
);
View 1 Replies
View Related
Oct 10, 2012
I've written this code to present the problem:
declare
region_date varchar2(100);
region varchar2(100);
offset_result varchar2(100);
begin
region_date := '2013-04-07 01:59 Australia/Sydney';
region := 'Australia/Sydney';
select
to_char(
[code]....
What I want to do is to use the variable "region" for the timezone specification as well,And I seem to be unable to, and don't understand why.....
why when I get an "ORA-00907: missing right parenthesis" with this value,Whereas, it works when I put "AT TIME ZONE 'Australia/Sydney'" there?
View 3 Replies
View Related
Aug 29, 2013
Version- 10G I have a stored procedure which contain code like
if () then---update---else if() theninsert --update--------else if()-----------------------end if;end if;end if;
I have to use this code numbers of times in my procedure , is there any way I can give name this code & use it or call it where I need it in my SP.Don't want to make the above code a separate procedure.
View 4 Replies
View Related
Jul 17, 2013
I have a table extended_values_Test, with the following structure:
CREATE TABLE extended_values_Test
(
MATRL_NUM VARCHAR2(18 BYTE),
PRI_SHIP_LOC CHAR(4 BYTE) NOT NULL,
PLANT CHAR(4 BYTE) NOT NULL,
STD_COST NUMBER,
SNAPSHOT_DATE CHAR(8 BYTE)
)
Snapshot_date is last working date of that month, and is recorded only once in the table for a matrl_num & plant combination.
Inserting records in the table:
Refer to insert_extended_values.sql
Note: This is just a sample table , having records for only two matrl_num.
after inserting records , you can see the records are for two different matrl_num's. For each matrl_num , we can have multiple values of plant and for each plant we can have different value of std_Cost(eg:matrl_num='0023173556').
Moreover for each matrl_num , I have some records in each month , based on the number of plants(with std_cost). Std_cost for a plant is updated in the table whenever there is a change in it from the previous value.In case of no change in value of std_cost over previous month's value , we have 'Null' std_cost for that matrl_num, plant & month(next month).
I want to update these 'Null' values with latest(last month's 'not null' - std_cost) std_cost for that matrl_num and plant. Such change in std_cost can occur multiple times , so we need to update the 'Null' std_cost till the time we have encountered a change in std_cost and so on.
View 14 Replies
View Related
Jan 8, 2011
novice to SQL (Oracle 10g)
Am trying to write code for sollowing scenario:
Have 3 tables
table1 (campaignid,promoflag)
table2 (campaignid,projectid,campaigndesc)
table3 (projectid,promoflag,projectstart,projectend)
I am to update table 1 promoflag with value from promoflag in table3
Update table1
set promoflag = table3.promoflag
I would like to make sure only appropriate record is updated therefore want to use where clause condition but the primary key for table1 and table3 are different, the only link can be found on table2.
I want to use condition where table1.campaignid=table2.campaignid and table2.projectid=table1.projectid
Have used the following without success:
Scenario 1
Update table1
SET promoflag = table3.promoflag
FROM table1
inner join table2 on table1.campaignid = table2.camapaignid
inner join table3 on table2.projectid = table3.projectID;
Error at line 1 ORA-00933: SQL command not properly ended
Scenario 2 with real table/column names
Update UA_CAMPAIGNEXTATTR
SET CFPROMOTABLE = LMUK_PROJECT_AUDIENCE_GRID.GRID_AUD_CFPROMOTABLE
FROM UA_CAMPAIGNEXTATTR,UA_CAMPAIGN,LMUK_PROJECT_AUDIENCE_GRID
WHERE
UA_CAMPAIGNEXTATTR.CAMPAIGNID = UA_CAMPAIGN.CAMPAIGNID
AND UA_CAMPAIGN.PROJECTID = LMUK_PROJECT_AUDIENCE_GRID.GRID_AUDIENCE_ID;
Error at line 2
ORA-00933: SQL command not properly ended
It appears to get block with the 'FROM' statement (was underlined in red)
View 1 Replies
View Related
Dec 14, 2010
I Would like to delete a records based on the parent / child relationship. So I would need to delete a record from parent table , first delete inner most child record then other child then master. To write generic way of Oracle 10g PL/SQL code.
View 2 Replies
View Related