Forms :: How To Check Syntax Of Resulting Insert In Oracle 6i

May 23, 2013

I have a package,

PACKAGE PK_EXCEL_TO_DB IS
TYPE tKeyValue IS RECORD (
CROUTE VARCHAR2(255),
VROUTE VARCHAR2(1000),

[code]...

Package body is

PACKAGE BODY PK_EXCEL_TO_DB IS
PROCEDURE PR_DO_INSERT(i_lData IN tDataList) IS
vcInsert VARCHAR2(3500);
BEGIN

[code]...

what i want is: 'output vcInsert to a forms-item and check the syntax of the resulting insert'. How can I do this

View 7 Replies


ADVERTISEMENT

Forms :: Put One Check Box To Check All The Check Boxes?

Jul 30, 2011

I want to put one check box to check all the check boxes.how can i do this?

View 5 Replies View Related

PL/SQL :: Inner Join Resulting In Many To Many Duplicates

Oct 9, 2013

I ran an Inner Join but it returned many, many duplicates. One Answer from a different thread:Because you may be having improper Join condition what has a One to many or a Many to many relationship between the tables. We do not have the data, and hence cannot comment over it. What do I look for to identify an improper join?

View 2 Replies View Related

SQL & PL/SQL :: Query Resulting In Numeric Overflow

Aug 23, 2013

I am writing a query and the query is resulting in Numeric Overflow.

SELECT

(power((Trlg_5Yr_Anl_Ror_Pt/100+1),5)-1)*100 AS Trlg_5Yr_Cum_Ror_Pt

FROM Cdp
where ....
and .....

In this above query,the power function is throwing error. Since the value in the column "Trlg_5Yr_Anl_Ror_Pt" is very big,applying power function is throwing Numeric Error. What can I do to handle this?

IN TABLE Cdp,column "Trlg_5Yr_Anl_Ror_Pt" is defined as NUMBER. Will Changin it to FLOAT resolve the issue.

View 19 Replies View Related

How To Check And Insert New Data Using Stock Procedure

Feb 11, 2007

i've a problem in using store procedure. My code is to get postcode id when i pass a postcode. First it will check the postcode that i pass if already exist it will get postcode id but if not it will insert new postcode and get a new postcode id created then pass into ASP system. When i try run this stock procedure i got error as below :-

SQL> exec INSERT_PCODE_GMDS
BEGIN INSERT_PCODE_GMDS; END;

*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INSERT_PCODE_GMDS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

(
Postcode1 IN varchar2,
citiID IN Number,
county_ID IN number,
city_name IN varchar2,
sub_cityID IN number,
pcode OUT number
)
[code].......

in ASP to pass and get back the values i used code as below. but i think the problems occurs in my stock procedure

set cmd=Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = OBJdbConnection
cmd.CommandText="INSERT_PCODE_GMDS"
cmd.CommandType= 4
cmd.Parameters.append cmd.CreateParameter("@poskod",adVarChar,adParamInput,5,poskod)
[code].......

View 1 Replies View Related

Server Utilities :: Check The INSERT Statements?

Nov 1, 2011

I have an export dumpfile and when I am importing it in the new database I want to see all the SQL statements including "CREATE", "ALTER", and "INSERT". I am able to see CREATE and ALTER by using the option SHOW=Y in my import statement (IMP) but not able to see the INSERT commands.

Is there any way I can see INSERT statements as well.

View 2 Replies View Related

PL/SQL :: How To Check Record Exists Prior To Insert Statement

Aug 12, 2012

Using a cursor and loop method records are inserted into the header and line tables. How do I code the IF statement prior to the INSert statement such that Insert if record does not exist else Update the record. If the record for insert fails in the line, the same record should be deleted from the header table as well and transaction should rollback. The Ora version used is 11.2.0.2.

CURSOR C1 IS
        SELECT H.*
        FROM   rex_head_extract h
        WHERE  TRUNC(h.create_date) BETWEEN v_begin_date AND v_end_date;  
FOR I IN C1 (v_begin_date, v_end_date)
 
[Code]....

--- Need to perform a check if record exists here prior to insert     
             INSERT INTO tran_head
                 (TRAN_SEQ_NBR,        ORG_NUMBER,
                  STORE_NUMBER,        TRAN_DATE,

[Code]....

View 9 Replies View Related

SQL & PL/SQL :: Creating Trigger - Check If Data Being Inserted Already In Table And If Not Insert It

Aug 24, 2011

I know this is an old thread and I just started working with triggers. I want to check if the data being inserted is already in the table and if not insert it:

create or replace trigger t_triggername
before insert on tbl_tablename
for each row
begin
if(:new.user_id <> :old.user_id) then
insert into tbl_tablename(user_id, location)
values (:new.user_id, :new.location);
end if;
end;

what if I wanted to keep the user but only update location if the user is already in the table. I've tried doing it this way:

create or replace trigger t_triggername
before insert on tbl_tablename
for each row
begin
if(:new.user_id <> :old.user_id) then
insert into tbl_tablename(user_id, location)

[code]...

View 4 Replies View Related

SQL & PL/SQL :: Syntax For Oracle Statements

Apr 26, 2011

The link from where I can get syntax of all the commands available in oracle?

View 6 Replies View Related

Update With Join Syntax In Oracle

Apr 13, 2011

This is my working query in ms access...

UPDATE Caxnode AS A INNER JOIN Caxnode AS B ON A.node_alias = B.node_alias SET A.partition_Type = 'LDOM', A.node_mode = 'LOGICAL', A.host_id = b.host_id, A.num_of_proc = b.num_of_proc WHERE (((A.node_mode)='virtual' Or (A.node_mode)='regular') AND ((B.partition_Type)='LDOM'));

This doesn't work in oracle, I googled and read that update doesnt work with inner join in oracle..translate this query to work on oracle?

View 4 Replies View Related

SQL & PL/SQL :: Syntax For Optional ALL Parameter In Oracle SQL

Apr 17, 2012

I am trying to pass an Optional 'ALL' Parameter to Oracle in the SQL statement below...

USER.STATUS can be either 0 or 1 in the Source-Data (Inactive or Active). However, the :P_STATUS Parameter can be either 0, 1 or 2 (ALL).

I tried an IF/THEN/ELSE statement in the SQL below - but it doesn't work as is.

Gives and "ORA-00920: invalid relational operator" error...
-------------------
SELECT
i.LAST_NAME SURNAME,
i.FIRST_NAME GIVEN_NAME,
DECODE(u.STATUS, 1, 'Active', 0, 'Inactive') STATUS,
u.STATUS STATUS_CODE
[code].......

View 1 Replies View Related

Forms :: Map Excel Columns On Oracle Forms And Insert It Into Database

Apr 12, 2013

I have task. I am using oracle forms 6i. I want to import excel data to oracle forms(its common task using ole2 package). But this time I want to map the columns i.e my database table having 5 columns. and the excel file is having 2 or 3 columns then i suppose to map those columns and accordingly insert it to my table.

So far i have import column heading of excel to oracle forms, then i've provide list item for mapping each column. so that user can map excel column to database columns. Now I am confuse how to write the code so that selected columns should get inserted into database.

-more details

I have table with columns id, name, location, address, plan. in those columns i need to insert records form excel. user having a excel with 3 columns col1, col2, col3. on the form i've fetch column headers of excel and in front of that i've provide database column list , so user can match excel column with database column. e.g.

COL1 --> list value of database column
COL2 -->list value of database column
COL3 -->list value of database column

Once user map those column i want to insert those values into my database table (table with columns id, name, location, address, plan). and i am confuse about this code.

View 1 Replies View Related

Create Schema That Needs To Be Converted Using Non-oracle Syntax

Jan 27, 2011

I am new to oracle and sql in general, I received an oracle create schema that needs to be converted using non-oracle syntax. I have never seen this syntax before.

What does the following syntax mean?
CODE,line_status(1:20) char(2) null

CODE,file_line(1:6) char(40) null

View 4 Replies View Related

Translating Query From SQL Server To Oracle Syntax

Sep 10, 2009

Translate following SQL query from SQL Server syntax to Oracle syntax.

SELECT ID,
[LMT(MTR)] = MAX(case when TYPE = 'LMT' then VALUE end),
[AAD(KGM)] = MAX(case when TYPE = 'AAD' then VALUE end),
[VOL(MTQ)] = MAX(case when TYPE = 'VOL' then VALUE end)
FROM yourtable
GROUP BY ID

View 2 Replies View Related

Forms :: Insert Record Into Lov Through Oracle Custom Forms?

Oct 8, 2013

I have a LOV in a custom oracle forms.this lov is linked to a record group.

Presently the column on which lov is created does not contain any value.

I want to insert value into the lov through the forms.

I am not able to insert data into it through forms

View 12 Replies View Related

Oracle Forms 10g Insert Pie Chart In Excel Sheet?

Mar 9, 2012

I have been requested to create an excel sheet report in my Forms application (10.1.2.0.2) with data grouped in a pie chart, something like the attached pic (if you cant open go to this link: [URL]

I'm able to create the excel sheet by using OLE2 tool, but I dont know how to insert my pie chart from code.

Attached File(s)

piechart.jpg ( 251.88K )
Number of downloads: 1

View 1 Replies View Related

Forms :: FRM-40508 / ORACLE Error / Unable To INSERT Record

Jan 14, 2013

I have an interface composed of five elements:

1.display_item (primary key)
2-list_item (foreign key) / / dynamic list :this is the cause of the error
3-lis_item (foreign key) / / dynamic list
4-text_item
5-button (insert commit)

when I click the button, an error is displayed:

FRM-40508: ORACLE error: unable to INSERT record.in detail: ora-02291 integrity constraint Violated - parent key not found

Note:

-the elements of two lists already exist in the parent table!!

-I use a block based.

-button

commit_form();

View 17 Replies View Related

Forms :: Write Trigger To Insert System Clock Time In Oracle?

Jan 4, 2013

how can i write a trigger to insert the system clock time in the oracle form?

View 15 Replies View Related

Server Utilities :: Insert Data Without Writing Insert Statement In Oracle?

May 15, 2010

how to insert data in oracle table without writing insert statement in oracle 9i or above. i am not going to write insert all, merge, sqlloder and import data.

View 2 Replies View Related

Forms :: When Insert Detail The Data Insert Twice Time

Feb 27, 2012

when i tried to insert the details from oracle froms..the data inserts twice to the DB..

my table structure:

create table app_sri
(a_id integer primary key,
p_first_name varchar2(30),
p_last_name varchar2(20),
p_age number(3)
);

here a_id can be genarated through simple sequence(pid_seq)...
trigger on app_sri
create or replace trigger pid_trg

[Code]....

form insertion code..

Begin
insert into app_sri(null,'robo','Big',100);
commit
End;

the data inserted...but twice

what is the reason behind the double insertion?

View 8 Replies View Related

Forms :: How To Check Record Status

Sep 7, 2011

I am manually committing the form by writing commit statement in key - commit trigger for some reason.

Everything is working fine. I want to display a message if some necessary fields are not filled properly, like if a user filled half table and mistakenly he press the commit button. Here I want to show him a message that you can't saved the data because the table is not completely filled.

View 17 Replies View Related

Forms :: Date Overlapping Check In 10g

Mar 30, 2013

I have two field date from and date to... i want to enter an employee in date range that range should not be enter again.

View 8 Replies View Related

Forms :: Unable To Put A Check For A Form?

Jul 5, 2010

I have a leave form where I need to put a check which prevents the user from entering 'sick leave' if the employee hasn't completed 3 months in the company.This is the code I've written:

SELECT ABS(MONTHS_BETWEEN(t.start_date,sysdate)) INTO l_date
FROM hrp_per_all_people_f t
WHERE t.company_id = :parameter.p_company_id
AND t.employee_number = :parameter.p_employee_number

[code]...

The absence_type_id = 21 is for 'sick leave'. I can't figure out why this is not working. When I do enter 'sick leave' for a new employee I do not get any checks and neither am I able to save the changes.

View 6 Replies View Related

Forms :: Want To Check For Checkbox Status With One More Corresponding Value

Aug 3, 2011

I was working with forms and found a problem related to accessing of status of checkbox. In a block with multi record to be checked, if we want to check all the checkbox status which is already clicked, Then what should i do.

Now i am using the function Checkbox_check as:

if Checkbox_Checked('FVA.STATUS')

But the problem with this function, it is giving status of last clicked checkbox only.

View 17 Replies View Related

Forms :: Query Update Check

Nov 19, 2010

We have a form which contain the multiple record.

I require to disable the record during the query, if the certain flag (Y) is activiate. And their as allow to display the next record without the flag (N) is editable.

how to done it.

View 1 Replies View Related

Forms :: Duplicate Check On Data Block

Jan 19, 2010

I wonder if there is some tiny technique to trace a duplicity on a block label without committing the records ( Maybe on Validate or new record instance)

I have one procedure to check duplicate but what I remember that there is something very smart provided from oracle to do that.

View 7 Replies View Related

Forms :: How To Check Particular Item Updated In A Block

Mar 1, 2010

I have a form in which i had 6 items in a block,like sno,task,responsible,totaldays,date,status .Except 'totaldays' item all items will be updated when i press button called 'Update'.am doing this in on - update by using if(:system.block_status='changed').

Now i want only if a specific item 'totaldays' is changed , the on-update should happen.

i have 6 items in a block
sno
task
responsible,
totaldays
date,
status

only if i change totaldays item the on - update should happen

how to do this?

View 3 Replies View Related

Forms :: Passing Check Box Values To WHERE Clause?

Oct 26, 2013

I have created a Data block - 'CONTACTS' (Database data block) and has database item - 'Code', 'Descr'

The number of records displayed is set to 5.

Value When checked - 'Y'
Value When Unchecked - 'N'
Check box mapping of other values - 'unchecked'

The requirement is when i check one or multiple checkboxes, i should pass the 'Code' item values to the WHERE clause.

Right now whenver i am trying to do so, only the current record value is copied to the WHERE clause.

I have tried using basic loop as well as while loop but things havmt worked. Below is a basic code which will work for one record, request to guide me with muliple checkbox ticked.

IF :contacts.cb = 'Y' THEN

IF p_where is null then

p_where := :contacts.code;
else
p_where := p_where ||','||:contacts.code;
end if;
end if;
p_where:= 'where code in ('||p_where||')';

View 6 Replies View Related

Forms :: Trigger To Check Field Value After Query?

Mar 8, 2010

What is the trigger which should be used to check certain field value after posting the query.

Example:

I have executed the query and the records are fetched. There is one field I want to check if it is null then it should be enabled, else, keep it disabled.

View 2 Replies View Related

Forms :: How To Check Table Handlers Correctly

Apr 11, 2013

I have a block based on a view. The view is a join on 2 tables, the first table always brings back 4 records for each parameter passed to it in the where clause. The second table is outer joined to the first table and may contain no matched records or some matched records. In some cases there will be a 1:1 match to the first table.

The problem is how to create the table handler procedure correctly. I need to update 2 tables in the table handler procedure.

The block is only enabled for update (to preserve the 4 rows), however some values on the block correspond to values from the second table. When you update a row in the block, how do you know if you are actually inserting a row into the second table or updating an already existing record on the 2nd table.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved