INSERT INTO with Button
Hi everyone.
I'm working on my project for the faculty and I have one question.
I want to insert comment into the table for comments.
What should I do?
Should I create Item or Page button.
I now that i have to create a PL/SQL Page process.
The comment table has ID column.
How to make the process PL/SQL ( with INSERT INTO ) assign correct ID for the ID Column.
Thanks in advance.
Hi
Please can you change your username so that we know who we're talking to.
Also, can you pop an example on apex.oracle.com for me to have a look at.
Cheers
Ben
http://www.munkyben.wordpress.com
Don't forget to mark replies helpful or correct ;)
Similar Messages
-
Hi!
I've a procedure with a insert into phrase.
For example:
INSERT INTO type (NAME) values(A_CHA);
type is not a table name it is a variable and name is not a column name it is also a variable.
Can i make a insert into with variables?
How is the right syntax?
Thank's for help!
NicoleHi!
I've found a way to do this:
sql_statement:= 'INSERT INTO' || type_table || '('||NAME|| ',CABLE_NUM,FACILITY_NUM) values( '||A_CHA||','||CABLE_N||','||FAC_N||')';
EXECUTE IMMEDIATE sql_statement;
But when i execute my procedure i get the error:
Keyword INTO is missing!
Please help
Nicole -
Hy,
i have a little question. Try this:
create table strangetab (
id varchar2(20),
textfield varchar2(200)
CREATE OR REPLACE PROCEDURE writestrangetab
id VARCHAR2,
textfield varchar2 default null)
IS
pragma autonomous_transaction;
BEGIN
INSERT INTO strangetab
(id, textfield
) VALUES
(id, textfield
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(sqlerrm);
rollback;
END;
After table and procedure creation, try to run this script (simple insert into in autonompus_transaction):
set serveroutput on
declare
vstr varchar2(10000);
begin
for i in 1..2000
loop
vstr := vstr||'r';
end loop;
dbms_output.put_line('write a');
writestrangetab( 'idx' , 'a');
dbms_output.put_line('write big string');
writestrangetab( 'idx' , vstr);
dbms_output.put_line('write b');
writestrangetab('idx' , 'b');
end;
The script generate this output:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
write a
write big string
ORA-12899: value too large for column "STRANGETAB"."TEXTFIELD" (actual:
2000, maximum: 200)
write b
As i expect, the second write goes wrong but first and third no and it put string a and b into srangetable.
Now try to run this:
set serveroutput on
declare
vstr varchar2(10000);
begin
for i in 1..5000
loop
vstr := vstr||'r';
end loop;
dbms_output.put_line('write a');
writestrangetab( 'idx' , 'a');
dbms_output.put_line('write big string');
writestrangetab( 'idx' , vstr);
dbms_output.put_line('write b');
writestrangetab('idx' , 'b');
end;
The only difference from the previous is the vstr dimension: first 2000 now 5000.
In my db (10.2.0.4 on linux) the output of this, is:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
write a
write big string
ORA-01461: can bind a LONG value only for insert into a LONG column
write b
ORA-01001: invalid cursor
If i query the strangetable i am non able to find string b (Only string a was registered)!
As if that were not enough, If you try to insert others writestrangetab, anything after wath that produce the error will be stored!
It is normal?
By
StefanoTanks for your reply Jhon, but:
1) "The second run you are trying to pass 5000 characters to a varchar, which caused your error when trying to call your procedure"
Why you say "which caused". When i call a procedure can't pass more than 4000 Chars? I know that pl/sql varchar2 is up to 32000 Chars even in procedure calls!
2) "That is why your cursor because invalid"
Witch cursor? The strange thing is that there isn't any cursor in the autonomous procedure! The anly statement is an insert into!
The problem of the second miss in the second run is ok: that wont register the string. The main problem is the miss of the third in the seconf run.
Why it not register the third writestrangetab? In that case i pass only a 'b' char. Writestarngetab Is an autonomous transaction so i expect a miss if it fail, but the next, if ok, will be registerd. why not?
By
Stefano -
INSERT INTO with SELECT invalid column name error
I have a problem where I wish to update a table with only records that have changed or insert into a table with only new records. The Source table is queried using OPENQUERY as we have no staging db for this.
I have the following code (adapted from a working example):
INSERT INTO dbo.Contact
SELECT contactID, lastUpdatedDateTime
FROM
MERGE INTO dbo.Contact AS DT
USING (SELECT * FROM OPENQUERY(LINKED_SERVER,'SELECT contactID, lastUpdatedDateTime FROM Contact')) AS DS
ON (DT.ContactID = DS.ContactID)
WHEN NOT MATCHED THEN
INSERT VALUES (DS.contactID, DS.lastUpdatedDateTime)
WHEN MATCHED AND (DT.lastUpdatedDateTime <> DS.lastUpdatedDateTime) THEN
UPDATE SET DT.contactID = DS.contactID, DT.lastUpdatedDateTime = DS.lastUpdatedDateTime
OUTPUT $Action Action_Out
AS MERGE_OUT
WHERE MERGE_OUT.Action_Out = 'UPDATE';
GO
When I run this query I am getting the following errors referring to the columns in the SELECT:
Msg 207, Level 16, State 1, Line 2
Invalid column name 'contactID'.
Msg 207, Level 16, State 1, Line 2
Invalid column name 'lastUpdatedDateTime'.
Am I missing something obvious as I can't quite work out why? The Target and source definitely exist with the specified columns present in both...Hello,
The issue is because you are not outputting those values from the inner merge statement. All you are currently outputting is the action, so the error is correct as those columns do not exist.
Change your output portion to be:
OUTPUT inserted.contactID, inserted.lastUpdatedDateTime, $Action Action_Out
Then it should work.
Sean Gallardy | Blog | Microsoft Certified Master -
Hi all,
I've this problem: insert into Table_A some values from Table_B... with one derivated/calculated filed.
Example
INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
SELECT id_p, vendt, origin, proven, <calculate/derivated_field_desc>
FROM Table_BThe rules for calculate the field desc inserted on Table_A are 1. IF vendt='V' AND origin='N' AND proven!='04' THEN ---> desc='TRANSFER'
2. IF vendt='M' AND origin='N' AND proven!='04' THEN ---> desc='IMPORTED'
3. IF proven='04' THEN ---> desc='BAD'So what I use in <calculate/derivated_field_desc> on my INSERT INTO statement??
Can I use a SELECT CASE WHEN... or only DECODE is a right solution?
Edited by: trebbia on 15-nov-2010 12.51Ok,
I prefer use select case when... because trasform my rules in DECODE statement is more difficult
So I write: INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
SELECT id_p, vendt, origin, proven, SELECT CASE WHEN vendt='V' AND origin='N' AND proven!='04' THEN 'TRANSFER'
WHEN vendt='M' AND origin='N' AND proven!='04' THEN 'IMPORTED'
WHEN proven='04 THEN 'BAD'
END
FROM Table_BObtain this error:
40/56 PL/SQL: ORA-00936: missing expression
33/1 PL/SQL: SQL Statement ignored
PS: I use '<' '>' and not '!=' in my code... here not prompted correctly '<''>'
Edited by: trebbia on 15-nov-2010 13.04
Edited by: trebbia on 15-nov-2010 13.06 -
Merge update insert into with exception
I m opening a new thread for the same question i had posted earlier....
create Table test(
col1 varchar2(200),
col2 varchar2(200),
col3 varchar2(200),
id varchar2(200),
job_id varchar2(10)
create Table test1(
col1 varchar2(200),
col2 varchar2(200),
col3 varchar2(200),
id varchar2(200),
job_id varchar2(10)
create Table test2(
col1 varchar2(200),
col2 varchar2(200),
col3 varchar2(200),
id varchar2(200),
job_id varchar2(10)
create Table err_tbl(
col1 varchar2(200),
col2 varchar2(200),
col3 varchar2(200),
id varchar2(200),
job_id varchar2(10)
===============================================================
merge into test t
using (select distinct col1, col2, col3,id, job_id
from test1
where job_id = curr_job_id -- cur_job_id is variable which is declared in the procedure to sysdate
union
select distinct col1, col2, col3,id, job_id
from test2
where job_id = curr_job_id --cur_job_id is variable which is declared in the procedure to sysdate
) ss
on (t.id = ss.id
AND t.job_id = ss.job_id)
when matched then update
set t.col1 = ss.col1,
t.col2 = ss.col2,
t.col3 = ss.col3
when not matched then insert into
( t.col1,
t.col2,
t.col3,
t.id,
t.job_id
)Values
( ss.col1,
ss.col2,
ss.col3,
ss.id,
ss.jobid,
exception
when others then
insert into err_tbl (
col1,
col2,
col3,
id,
job_id )
values ( ss.col1,
ss.col2,
ss.col3,
ss.id,
ss.jobid,
Above, all i m trying to do is Updating or inserting into TEST table, and if there is any Duplicate records or any bad records then making use of exception i m INSERTING into ERR_TBL
i get error with the merge insert update code ....
The error i get is --- "ss.col1" column is not allowed here
Any idea guys ????
Hey one more quick question ....Can we use exception in merge insert update block ???user642297 wrote:
I m opening a new thread for the same question i had posted earlier....
Any idea guys ????
Hey one more quick question ....Can we use exception in merge insert update block ???Did you learn nothing nothing from [Your other thread|http://forums.oracle.com/forums/thread.jspa?messageID=3810396�]
(Maybe that's why you never bothered to close it)
It looks like you did learn something, since you ended up saying
Thanks alex...i think i got the answer.....so i cannot use exception handler in merge statement...
Thank you so much!!!What beats me is that yu post the exact same question again, when you already got the answer
?:|
Peter -
UPDATE/INSERT INTO with Connection with access DB
Hello,
I am trouble getting the update statement working when connecting to my database. The "Select" statement works fine but i am using:
result2= stmt2.executeUpdate("INSERT INTO Table1 VALUEs('1', '1')");
and i get the error incompatiable types...found int but expected java.sql.resultset
I am not sure what i am doing wrong. Can anyone help?since you're using Access, be sure to close both your Statement and the Connection you used after your INSERT/UPDATE. It's well known that changes won't show up in Access unless you do.
% -
Strange result from insert into...select query
Hello guys,
I need your preciuos help for a question maybe simple, but that I can't explain by myself!
I have a query of "insert into...select" that, as I have explained in the title, returns a strange result. In facts, If I execute ONLY the SELECT statement the query returns the expected result (so 2 rows); instead If I execute the entire statement, that is the "insert into...select", the query returns 0 rows inserted!!
Following an example of the query:
INSERT
INTO TITOLI_ORI
COD_TITOLO_RICCONS ,
D_ESTRAZIONE ,
COD_SOCIETA ,
COD_PIANO_CONTABILE ,
COD_CONTO_CONTABILE ,
COD_RUBRICATO_STATISTICO_1 ,
COD_NDG ,
NUM_ESEGUITO ,
CUR_IMPORTO_RICCONS ,
CUR_IMPORTO_BICO ,
FLG_MODIFICATO ,
CUR_NON_ASSEGNATO ,
FLG_QUOTATO ,
COD_CATEG ,
TIP_COPERTURA ,
TIPTAS_TITOLO
SELECT NEWID,
'28-feb-2111',
COD_SOCIETA,
COD_PIANO_CONTABILE,
COD_CONTO_CONTABILE,
COD_RUBRICATO_STATISTICO_1,
COD_NDG,
NUM_ESEGUITO,
CUR_VAL_IMPEGNI,
'ABC' as CUR_IMPORTO_BICO,
0 as FLG_MODIFICATO,
NULL as CUR_NON_ASSEGNATO,
FLG_QUOTATO,
COD_CATEG,
TIP_COPERTURA,
TIP_TASSO
FROM
(SELECT S.COD_SOC AS COD_SOCIETA,
S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
TRC.COD_NDG AS COD_NDG,
TRC.COD_ESEG AS NUM_ESEGUITO,
CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
TRC.TIP_QUOTAZ AS FLG_QUOTATO,
TRC.COD_CAT_TIT AS COD_CATEG,
TIP_COP AS TIP_COPERTURA,
T.TIP_TASSO AS TIP_TASSO
FROM S_SLD_CNTB S
INNER JOIN
(SELECT DISTINCT COD_SOC,
TIP_PIANO_CNTB,
COD_CONTO_CNTB,
COD_RUBR_STAT ,
COD_INTER_TIT AS COD_INTER
FROM S_COLLEG_CONTO_CNTB_TIT
WHERE COD_SOC = 'ME'
) CCC
ON S.COD_SOC = CCC.COD_SOC
AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
INNER JOIN S_TIT_RICCONS TRC
ON CCC.COD_INTER = TRC.COD_INTER_TIT
AND CCC.COD_SOC = TRC.COD_SOC
AND TRC.COD_RAGGR_IAS = RTRIM('VALUE1 ')
AND TRC.COD_RAGGR_IAS NOT IN ('VALUE2')
AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('VALUE3')
AND TRC.DES_MOV_TIT = RTRIM('VALUE4 ')
AND TRC.COD_CAT_TIT = RTRIM('VALUE4 ')
AND TRC.COD_INTER_TIT = RTRIM('VALUE5')
AND '28-feb-2011' = TRC.DAT_RIF
LEFT JOIN S_TIT T
ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
AND T.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = T.DAT_RIF
INNER JOIN S_ANAG_SOGG AG
ON TRC.COD_NDG = AG.COD_NDG
AND AG.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = AG.DAT_RIF
WHERE S.DAT_RIF = '28-feb-2011'
AND (S.FLG_ANULL_BICO = 0
OR S.FLG_ANULL_BICO IS NULL)
AND S.COD_SOC = 'V6'
AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
AND S.TIP_PIANO_CNTB = 'V7'
AND TRC.IMP_PLUS_MINUS_VAL < 0
AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('VALUE8 '))
Thanks a lotRight, I have executed this steps:
- I have changed the query with the select count(*)
- Changed the insert into with the select count(*)
- Executed the insert into
These are the result:
SQL> select count(*) from TITOLI_ORI2;
COUNT(*)
1
BUT:
SQL> select * from TITOLI_ORI2;
A
0
The insert into that I've modified is this:
INSERT INTO bsc.TITOLI_ORI2
select count(*)
FROM
(SELECT bsc.NEWID,
TO_DATE('28-feb-2111','DD-MON-YYYY') as data,
COD_SOCIETA,
COD_PIANO_CONTABILE,
COD_CONTO_CONTABILE,
COD_RUBRICATO_STATISTICO_1,
COD_NDG,
NUM_ESEGUITO,
CUR_VAL_IMPEGNI,
'ABC' AS CUR_IMPORTO_BICO,
0 AS FLG_MODIFICATO,
NULL CUR_NON_ASSEGNATO,
FLG_QUOTATO,
COD_CATEG,
TIP_COPERTURA,
TIP_TASSO
FROM
(SELECT S.COD_SOC AS COD_SOCIETA,
S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
TRC.COD_NDG AS COD_NDG,
TRC.COD_ESEG AS NUM_ESEGUITO,
CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
TRC.TIP_QUOTAZ AS FLG_QUOTATO,
TRC.COD_CAT_TIT AS COD_CATEG,
TIP_COP AS TIP_COPERTURA,
T.TIP_TASSO AS TIP_TASSO
FROM bsc.S_SLD_CNTB S
INNER JOIN
(SELECT DISTINCT COD_SOC,
TIP_PIANO_CNTB,
COD_CONTO_CNTB,
COD_RUBR_STAT ,
COD_INTER_TIT AS COD_INTER
FROM bsc.S_COLLEG_CONTO_CNTB_TIT
WHERE COD_SOC = 'ME'
) CCC
ON S.COD_SOC = CCC.COD_SOC
AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
INNER JOIN bsc.S_TIT_RICCONS TRC
ON CCC.COD_INTER = TRC.COD_INTER_TIT
AND CCC.COD_SOC = TRC.COD_SOC
AND TRC.COD_RAGGR_IAS = RTRIM('HFT ')
AND TRC.COD_RAGGR_IAS NOT IN ('GPO')
AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('DISPONIBILI')
AND TRC.DES_MOV_TIT = RTRIM('CONSEGNARE ')
AND TRC.COD_CAT_TIT = RTRIM('OBBLIGAZIONE ')
AND TRC.COD_INTER_TIT = RTRIM('334058')
AND '28-feb-2011' = TRC.DAT_RIF
LEFT JOIN bsc.S_TIT T
ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
AND T.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = T.DAT_RIF
INNER JOIN bsc.S_ANAG_SOGG AG
ON TRC.COD_NDG = AG.COD_NDG
AND AG.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = AG.DAT_RIF
WHERE S.DAT_RIF = '28-feb-2011'
AND (S.FLG_ANULL_BICO = 0
OR S.FLG_ANULL_BICO IS NULL)
AND S.COD_SOC = 'ME'
AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
AND S.TIP_PIANO_CNTB = 'IS'
AND TRC.IMP_PLUS_MINUS_VAL < 0
AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('P044C11 '))
Another time the strange result returns!!
And I've created the table TITOLI_ORI2 as create table TITOLI_ORI2 (a number); to contain the number result of the query. -
How to INSERT INTO a specific row?
I have a form with a calendar at the top, below it is a list of items each with a check box.
Here is a wonderful visual of it -
Calendar
Checkbox | Col | Col | Col
Checkbox | Col | Col | Col
Checkbox | Col | Col | Col
I want it so you select the date and it gets passed into the database in the same row as the one (definitely one, multiple is better) that has been checked by the user.
I was trying an INSERT INTO with a WHERE statement but apparently you can't do that. So if I can use a WHERE with INSERT INTO, how can I identify which row to insert the info?
Currently it is passing the dates but it creates a new row.
I didn't think posting the code is neccisary for this question but if anyone wants to see it let me know and I will post it.
THANKS!Ah, ok, I will try UPDATE.
Right now my form looks like this...
<cfform name="requestform" role="form"action="resources/requestform.cfm" method="post" width="375" height="350" >
<label for="startdate">Start Date:</label>
<label for="enddate">Finish Date:</label>
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
startRange="#Form.startdate#"
endRange="#Form.enddate#"
mask="mmm dd, yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
firstDayOfWeek="1"
monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
style="rollOverColor:##FF0000"
width="200" height="150">
<cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#Form.startdate#">
<cfinput type="dateField" name="enddate" label="End Date" width="100" value="#Form.enddate#">
</div>
<cfinclude
template = "resources/query.cfm">
<span class="label label-default">Equipment List</span>
<table class="table table-bordered table-striped">
<tr>
<td><b>Select</b></td>
<td><b>Name</b></td>
<td><b>Description</b></td>
<td><b>Status</b></td>
</tr>
<cfloop query = "equiplist">
<cfoutput>
<tr>
<td>
<cfinput name="status" type="checkbox" value="#serial#">Select:</cfinput>
<cfinput name="serial"type="text"style="display:none" value="#serial#">
</td>
<td>#name#</td>
<td>#descrip#</td>
<td>#status#</td>
</tr>
</cfoutput>
</cfloop>
</table>
<cfinput class="btn btn-default" type="Submit" value="Submit" name="addsubmit"></cfinput>
</cfform>
And the action page looks like this...
<cfquery
name = "requestform"
dataSource = "db_cie">
UPDATE equip
SET STATUS="Out",
WHERE serial='#status#'
</cfquery>
<cflocation
url = "../request.cfm">
But I am getting an error "invalid.user.table.column, table.column, or table specification. But the error message shows the SQL output and it looks correct...UPDATE equip SET STATUS="Out" WHERE serial="325255"... it IS getting the serial number variable passed from the form. ...No update though. Is my action form written wrong? -
How do I insert cells using INSERT INTO & SET? (Excel oledb)
Updating a cell works:
oledbConnect = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\__\\test.xls;Extended Properties='Excel 12.0 Xml;HDR=NO;'");
oledbConnect.Open();
oledbCmd.Connection = oledbConnect;
string stSheetName = "Sheet2";
string sql;
sql = "UPDATE [" + stSheetName + "$A1:B1] SET F1=1";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
Inserting a cell does not:
sql = "INSERT INTO [" + stSheetName + "$A2:B2] SET F1=2'";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
I understand that inserting will add a new row ... but this doesn't work either.
sql = "INSERT INTO [" + stSheetName + "$] SET F1=3";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
bhs67Hi hbs67,
No, we can't use Insert into with Set, it's the basic syntax in SQL statement. Give the worksheet a header row, then use Insert into or Update syntax with the field name.
Check more information in this kb article:
https://support.microsoft.com/en-us/kb/316934?wa=wsignin1.0
If you have Office application installed on your machine, you could also automate the Excel files with Excel PIA:
How to automate Microsoft Excel from Microsoft Visual C#.NET
It's easy to insert or update cell values with the cell address.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to insert into 2 tables from the same page (with one button link)
Hi,
I have the following 2 tables....
Employees
emp_id number not null
name varchar2(30) not null
email varchar2(50)
hire_date date
dept_id number
PK = emp_id
FK = dept_id
Notes
note_id number not null
added_on date not null
added_by varchar2(30) not null
note varchar2(4000)
emp_id number not null
PK = note_id
FK = emp_id
I want to do an insert into both tables via the application and also via the same page (with one button link). I have made a form to add an employee with an add button - adding an employee is no problem.
Now, on the same page, I have added a html text area in another region, where the user can write a note. But how do I get the note to insert into the Notes table when the user clicks the add button?
In other words, when the user clicks 'add', the employee information should be inserted into the Employees table and the note should be inserted into the Notes table.
How do I go about doing this?
Thanks.Hi,
These are my After Submit Processes...
After Submit
30 Process Row of NOTES Automatic Row Processing (DML) Unconditional
30 Process Row of EMPLOYEES Automatic Row Processing (DML) Unconditional
40 reset page Clear Cache for all Items on Pages (PageID,PageID,PageID) Unconditional
40 reset page Clear Cache for all Items on Pages (PageID,PageID,PageID) Unconditional
40 reset page Clear Cache for all Items on Pages (PageID,PageID,PageID) Unconditional
40 reset page Clear Cache for all Items on Pages (PageID,PageID,PageID) Unconditional
50 Insert into Tables PL/SQL anonymous block Conditional
My pl/sql code is the same as posted earlier.
Upon inserting data into the forms and clicking the add button, I get this error...
ORA-06550: line 1, column 102: PL/SQL: ORA-00904: "NOTES": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
Error Unable to process row of table EMPLOYEES.
Is there something wrong with the pl/sql code or is it something else? -
Help with a flash html inserting into DW
Hello,
I have created a enquiry section in flash for one of my html DW pages for my site. When I publish the flash doc ti creates a html page (Contact.html). When I open the flash html page in DW or upload it to my server, everything works fine. I recieve an email at my prefered destination etc etc. But as its only a section of my contact page of my website i need to insert it into my site page (get_in_touch.html) soon as i try and take all the stuff from contact.html and insert it into a div in my get_in_touch.html it doesn't respond when the submit button is pressed..... Can someone please help!!!!!
DanThanks for all your help. I've managed to sort out the problem, still not
sure what it was.... My sites live now.
Just one question for you if you dont mind.
The page which has the flash on it (yes this one again!) Well if someone
goes to the page with out having flash player installed on their machine,
i'm looking for some script to detect that there computer doesn't have
Flash and redirect them to another html page I've created.
Would really appreciated any advice you may have.
many thanks,
Dan
pziecina
<[email protected]>
To
09/09/2009 16:40 Daniel Herrington
<[email protected]
m>
Please respond to cc
clearspace-571537347-50
[email protected] Subject
ums.adobe.com Help with a
flash html inserting into DW
Hi
Somewhere above your tag, you will have a line similar to this - Also in your tag the swf file -
These are the files that I said may be wrong or missing.
However if you just edit the flash generated page and include the items you
require in this, and maintain the same file position, you should have no
problems,
PZ -
JBO 25030 while inserting into JTab with jNavigationBar
Hello,
in a master/detail swing panel the insert button of the navigation bar for the detail view throws "JBO-25030: Failed to find or invalidate owning entity."
- The views are connected through a view link
- The Detail View is a join through several entities. These are all marked as "updatable" for the table cells are combo boxes. However I only want to insert into the table that holds the foreign key to the master view.
Help is appreciated.
Thanks
JanHello Frank,
here the testcase
- MasterView is a join through several tables, f.ex.:
select (..)from country, town
- DetailView is also joins through several tables. At the lowest level there is a m:n relationship. Ex: A road parameter says which combination of road type and road use is available.
select (...)
from road ro, roadparameter rp, roaduse ru, roadtype rt
where ro.rp_id = rp.id
and RP.ru_id = ru.id
and RP.rt_id = rt.id
- DetailView was put in a JTable and added a JuNavigationBar. In DetailView the cell RT_ID was assigned to a combobox. Changing the road type changes the selection in the road use cell(also combo box).
private JComboBox roadTypeCellEditor= new JComboBox();
roadTypeCellEditor.setModel((ComboBoxModel)panelBinding.bindUIControl("rt_id",roadTypeCellEditor));
jTable2.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(roadTypeCellEditor));
-There is a View Link between MasterView.id(town) and DetailView.town_id(road)
- While inserting with the Navigation into the DetailView Table, JBO 25030 comes up.
JDev Version : 10.1.2.0.0
Thanks ,
Jan -
Insert an image button with a transparent background?
I would like to be able to use an image button with a
transparent background. I have converted my graphic files to .gifs
with transparent backgrounds. But when imported into Captivate,
they have a white background. If I insert as an image button and
check "transparent" it turns the entire image transparent. Is it
possible to have a transparent background when using the image
button functionality in Captivate? Thanks!I still cannot get this work. Does anyone have anymore help?
I have .gif files for the image button with a transparent
background. When I insert into Captivate as an image I can click
the option for a transparent background, and the image appears in
my Captivate project with a transparent background. Now, what I
really want to do is insert this into my project as a button. I
insert this into Captivate as an image button (there is no option
for a transparent background) and the image appears in my Captivate
project with a white background. Is it possible to have an image
button with a transparent background? Do I need to do a workaround
(something like, use my image along with a transparent button or
clickbox on top of the image?) Thanks for the help. -
Multi-row uipdate with an insert into another table [I think]
Folks,
I'm trying to get a multi row region with a checkbox against each row. When a user checks a box I want to insert a corresponding row into another table. So I've tried to simplify the questions and distill the problem down using the EMP table.
So, here goes:
I have table EMPS, which looks like this:
EMPNO Number
FIRSTNAME Varchar2(9)
LASTNAME Varchar2(10)
HIREDATE Date
I have table EMP_CANDIDATES, which looks like this:
EMPNO Number
SELECTION_DATE Date
NOTES Varchar2(53)
- I want to create a multi-row region based on EMPS, with a checkbox on each employee row.
- The user should be able to select any number of employees in the region and then press submit.
- on-submit there needs to be a process, which inserts a record into EMP_CANDIDATES for each checked employee.
I've tried pre-populating a collection with the EMPS records and using apex_item.checkbox to produce a checkbox, using this code:
=============
if apex_collection.collection_exists(p_collection_name=>'EMPS') then
apex_collection.delete_collection(p_collection_name=>'EMPS');
end if;
apex_collection.create_collection_from_query(
p_collection_name=>'EMPS',
p_query=>'select
p.empno,
p.hiredate,
p.firstname,
p.lastname,
null selection
from emps p');
=========
I can create a report region on this using tthe following SQL:
select c001 empno
, c002 hiredate
, c003 firstname
, c004 lastname
,apex_item.checkbox(1,c005) selection
from apex_collections
where collection_name ='EMPS'
======
So how do I now get a MRU that will insert a row into EMP_CANDIDATES for each checked row in my region? Or have I gone about this the wrong way?
TFH
DerekHi Derek,
Firstly, your checkbox should be on the c001 field as this is the one that contains your empno.
Then, you need a page process that can be triggered by a button. The process should be set to run "On submit (After computations and validations)" and the PL/SQL code would be something like:
DECLARE
v_empno NUMBER;
BEGIN
IF HTMLDB_APPLICATION.G_F01.COUNT = 0 THEN
raise_application_error(-20001, 'Please select at least one employee!');
END IF;
FOR i IN 1.. HTMLDB_APPLICATION.G_F01.COUNT LOOP
v_empno := TO_NUMBER(HTMLDB_APPLICATION.G_F01(i));
INSERT INTO EMP_CANDIDATES VALUES (v_empno, whateverdate, whatevernotes);
END LOOP;
END;
This will firstly count the items that have been ticked - if there aren't any, the user gets an error message. If there is at least one item ticked, the code will loop through these, get the empno relating to the ticked box and insert a record into the emp_candidates table. Please note that no account is taken here of any validation on this second table - if you need to ensure, for example, uniqueness of records in this table, you will have to update the above to perform this validation.
Regards
Andy
Maybe you are looking for
-
Error message as popup in webdynpro for Abap
Hi, Use method REPORT_ERROR_MESSAGE of interface IF_WD_MESSAGE_MANAGER to create an error message in the webdynpro application. This works fine, the message is shown in the message area. Now I want to have the error message in a popup. In the method
-
Is there a Better Way to do This? (C++, Qt)
Inside a Qt application I'm using ImageMagick to create an image (from variable text) on-the-fly and save it to the hard drive. Then right afterwards I'm telling Qt to load that image in an object (called currQorA). I know it would be more efficient
-
Write to Text File.vi Output file all but first line start with tab
The attached PNG shows the code used to build up concatenated strings into a string array for the first four lines, thence to a string Array, to Spreadsheet String.vi and, finally, the use of Write to Text File.vi The lower right corner shows the res
-
Access bean error, urgent.
I want to access a bean from my JSP. I am using Tomcat 4.1. I put my class file in /web-inf/classes. Please tell me what's wrong? This is the part in my jsp: <jsp:useBean id="myBean" scope="session" class="MyBean" />This is the error message The serv
-
Contact Creation Using Function module
Hello Expert, I want to create contact as a remote enabled function module for gateway services which function module I have to use for creation on contact?? Moderated: Please use the search before posting. Message was edited by: Andrei Vishnevsky