Updating Table with DropDownList Selection (ASP)
I'm converting one of my Access forms into ASP and I'm having trouble mimicking Access's combobox features in ASP.
In my original form, I have a combobox bound to a lookup table that writes the selection into a master table field.
The combobox works like this in Access:
Row Source: SELECT sourceCodes.name FROM sourceCodes;
Control source: source (a field in my master table)
In Dreamweaver, I was able to populate a DropDownList with the same query as a Dataset ('sourceDropDown'):
<asp:DropDownList ID="DropDownList1" DataSource="<%# sourceDropDown.DefaultView %>" DataTextField="name" DataValueField="code" runat="server"></asp:DropDownList>
But I'm at a lack of how to write this data when a selection is made. The ASP page I'm making is set up to be an update form by default. How do I tie a combobox change into the update action or do I do something like an AfterUpdate for the DropDownList to write the selection back to the table immediately?
Goes without saying that I'm new to ASP. Any help or even pointers in the right direction would be really appreciated!
Thanks in advance!
[Subject line edited by moderator to indicate server technology used]
Thanks for your reply!
The problem I'm still seeing is that my DropDrown code doesn't seem to have anything in it to direct the selected DropDown item to a table's field. It does have a DataSource, which gives the DropDown its items, but I need to tell it where to put data when a selection is made, like "Control Source" in Access.
' This populates the DropDownList from a lookup table, but doesn't have any info on where to store selected data.
<asp:DropDownList ID="DropDownList1" DataSource="<%# sourceDropDown.DefaultView %>" DataTextField="name" DataValueField="name" runat="server"></asp:DropDownList>
' I'm using this code so the DropDown reads the actual field I'm trying to update ('source' from my dataset inventoryQry). This is part of the functionality that I want, but I also need to update the field if a selection is made from the DropDown
<% DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(inventoryQry.FieldValue("sour ce", Nothing) )) %>
I'll keep digging around. If you have any other pointers, thank you in advance!
Similar Messages
-
Update table with data from dialog
Hello,
I need the problem.
I'm not update table with inputtext field where data change from dialog.
This metod is update table.
public void returnHandlerGoods(ReturnEvent returnEvent) {
// Add event code here...
ArrayList<PricatGoods> data = (ArrayList<PricatGoods>) returnEvent.getReturnValue();
BindingContainer bc = getBindings();
DCIteratorBinding dcIterBinding;
// сохранить изменения detail
dcIterBinding = (DCIteratorBinding) bindings.get("findVMIOrderDetailsIter");
RowSetIterator s = dcIterBinding.getRowSetIterator();
System.out.println("Получено товаров " + data.size());
for (int i =0; i < data.size(); i++){
Row detailRow = (RowImpl)s.createRow();
detailRow.setNewRowState(Row.STATUS_INITIALIZED);
s.insertRow(detailRow);
s.setCurrentRow(detailRow);
// detailRow.setAttribute("lineNum",createLineNum(i));
detailRow.setAttribute("gtin",((PricatGoods)data.get(i)).getGtin());
detailRow.setAttribute("goodId",((PricatGoods)data.get(i)).getGoodId());
detailRow.setAttribute("goodName",((PricatGoods)data.get(i)).getGoodName());
detailRow.setAttribute("sellerarticle",((PricatGoods)data.get(i)).getGoodCode());
detailRow.setAttribute("buyerarticle",((PricatGoods)data.get(i)).getBuyerArticle());
detailRow.setAttribute("unit",((PricatGoods)data.get(i)).getUnit());
detailRow.setAttribute("totalQuantity",0);
detailRow.setAttribute("acceptedQuantity",0);
detailRow.setAttribute("taxRate",((PricatGoods)data.get(i)).getVatPercent());
detailRow.setAttribute("price",((PricatGoods)data.get(i)).getCost());
detailRow.setAttribute("priceWithoutTax",((PricatGoods)data.get(i)).getCostWithoutVat());
detailRow.setAttribute("sumWithoutTax",0.0);
detailRow.setAttribute("totalSum",0.0);
detailRow.setAttribute("currency",((PricatGoods)data.get(i)).getCurrency());
System.out.println("Добавление товара \" "+((PricatGoods)data.get(i)).getGoodName()+ "\" с goodCode " +((PricatGoods)data.get(i)).getGoodCode());
s.closeRowSetIterator();
AdfFacesContext.getCurrentInstance().addPartialTarget(table2);
Fields are update good where inputText.readOnly = true.
Fields are not update good where inputText.readOnly = false. Old data duplicate in new row.
I have found some posts, but in them is not told accurately as I can solve the given problem.
How to update a adf table??
Re: ADF Dialog FrameWork-Table Update Problem
Whether it is possible to solve the given problem?
Thx,
DemaIf I use outputText that all job's a good. But I don't change these fields. I should have field with change for users.
Code jspx page for table ===>
<af:table value="#{bindings.findVMIOrderDetails1.collectionModel}"
var="row"
rows="#{bindings.findVMIOrderDetails1.rangeSize}"
first="#{bindings.findVMIOrderDetails1.rangeStart}"
emptyText="#{bindings.findVMIOrderDetails1.viewable ? 'Товаров пока нет.' : 'Access Denied.'}"
selectionState="#{bindings.findVMIOrderDetails1.collectionModel.selectedRow}"
selectionListener="#{bindings.findVMIOrderDetails1.collectionModel.makeCurrent}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.table2}"
id="table2" styleClass="baseTable">
<af:column sortProperty="lineNum" sortable="false"
headerText="№"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column19}"
id="column19">
<af:inputText value="#{row.lineNum}" simple="false"
required="true"
columns="4"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText4}"
id="inputText4" readOnly="false"
requiredMessageDetail='Поле "№" обязательно для заполнения'/>
</af:column>
<af:column sortProperty="gtin" sortable="false"
headerText="GTIN"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column20}"
id="column20">
<af:inputText value="#{row.gtin}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.gtin.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.gtin.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText26}"
id="inputText26" readOnly="true"/>
</af:column>
<af:column sortProperty="sellerarticle" sortable="false"
headerText="Код товара у поставщика"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column21}"
id="column21">
<af:inputText value="#{row.sellerarticle}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.sellerarticle.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.sellerarticle.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText27}"
id="inputText27" readOnly="true"/>
</af:column>
<af:column sortProperty="buyerarticle" sortable="false"
headerText="Код товара у покупателя"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column22}"
id="column22">
<af:inputText value="#{row.buyerarticle}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.buyerarticle.mandatory}"
columns="10"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText28}"
id="inputText28" readOnly="true"
disabled="false"/>
</af:column>
<af:column sortProperty="goodName" sortable="false"
headerText="Наименование"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column23}"
id="column23">
<af:inputText value="#{row.goodName}" simple="true"
required="true"
columns="11"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText29}"
id="inputText29"
requiredMessageDetail="Поле обязательно для заполнения"
readOnly="true"/>
</af:column>
<af:column sortProperty="itemDesc" sortable="false"
headerText="Описание"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column24}"
id="column24" rendered="false">
<af:inputText value="#{row.itemDesc}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.itemDesc.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.itemDesc.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText30}"
id="inputText30"/>
</af:column>
<af:column sortProperty="unit" sortable="false"
headerText="Ед. изм."
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column25}"
id="column25">
<af:inputText value="#{row.unit}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.unit.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.unit.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText31}"
id="inputText31" readOnly="true"/>
</af:column>
<af:column sortProperty="currency" sortable="false"
headerText="Валюта"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column26}"
id="column26" rendered="false">
<af:inputText value="#{row.currency}" simple="true"
required="#{bindings.findVMIOrderDetails1.attrDefs.currency.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.currency.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText32}"
id="inputText32"/>
</af:column>
<af:column sortProperty="totalQuantity" sortable="false"
headerText="Общее кол-во"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column27}"
id="column27">
<af:inputText value="#{row.totalQuantity}"
required="#{bindings.findVMIOrderDetails1.attrDefs.totalQuantity.mandatory}"
columns="#{bindings.findVMIOrderDetails1.attrHints.totalQuantity.displayWidth}"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText36}"
id="inputText36" readOnly="true">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.totalQuantity}"/>
</af:inputText>
</af:column>
<af:column sortProperty="acceptedQuantity" sortable="false"
headerText="Кол-во поставки"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column28}"
id="column28">
<af:inputText value="#{row.acceptedQuantity}"
required="true"
columns="7"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText37}"
id="inputText37"
requiredMessageDetail='Поле "Подтвержденное количество "обязательно для заполнения'
validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.validatorQuantity}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.acceptedQuantity}"/>
</af:inputText>
</af:column>
<af:column sortProperty="taxRate" sortable="false"
headerText="НДС, %"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column29}"
id="column29">
<af:inputText value="#{row.taxRate}"
required="true"
columns="4"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText38}"
id="inputText38"
requiredMessageDetail='Поле "НДС" обязательно для заполнения'
validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorNDS}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.taxRate}"/>
</af:inputText>
</af:column>
<af:column sortable="false" headerText="Цена"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column34}"
id="column34">
<af:column sortProperty="priceWithoutTax" sortable="false"
headerText="Без НДС"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column31}"
id="column31">
<af:inputText value="#{row.priceWithoutTax}"
required="true"
columns="6"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText40}"
id="inputText40"
requiredMessageDetail='Поле "Цена без НДС" обязательно для заполнения'
validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorPriceWithoutTax}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.priceWithoutTax}"/>
</af:inputText>
</af:column>
<af:column sortProperty="price" sortable="false"
headerText="С НДС"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column30}"
id="column30">
<af:inputText value="#{row.price}"
required="true"
columns="6"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText39}"
id="inputText39"
requiredMessageDetail='Поле "Цена с НДС" обязательно для заполнения'
validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorPrice}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.price}"/>
</af:inputText>
</af:column>
</af:column>
<af:column sortable="false" headerText="Сумма"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column35}"
id="column35">
<af:column sortProperty="sumWithoutTax" sortable="false"
headerText="Без НДС"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column32}"
id="column32">
<af:inputText value="#{row.sumWithoutTax}"
required="true" columns="6"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText41}"
id="inputText41"
requiredMessageDetail='Поле "Сумма без НДС" обязательно для заполнения'
autoSubmit="true"
valueChangeListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.changeSum}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.sumWithoutTax}"/>
</af:inputText>
</af:column>
<af:column sortProperty="totalSum" sortable="false"
headerText="С НДС"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column33}"
id="column33">
<af:inputText value="#{row.totalSum}" required="true"
columns="6"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText42}"
id="inputText42"
requiredMessageDetail='Поле "Сумма с НДС" обязательно для заполнения'
autoSubmit="true"
valueChangeListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.changeSum}"
validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorTotalSum}"
readOnly="false">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.findVMIOrderDetails1.formats.totalSum}"/>
</af:inputText>
</af:column>
</af:column>
<f:facet name="selection">
<af:tableSelectOne text="Select and"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.tableSelectOne2}"
id="tableSelectOne2">
<af:commandLink text="Удалить"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink5}"
id="commandLink5"
action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.deleteRow}"
styleClass="tableControlButton"
immediate="false"/>
</af:tableSelectOne>
</f:facet>
<f:facet name="actions">
<h:panelGroup binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.panelGroup2}"
id="panelGroup2">
<af:commandLink text="Добавить"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink6}"
id="commandLink6"
styleClass="tableControlButton"
immediate="false"
action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.addRows}"
useWindow="true" windowHeight="500"
windowWidth="600"
returnListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.returnHandlerGoods}"
rendered="#{bindings.JdDoctype02rspType.inputValue == 9&&bindings.JdDoctype02orderrspId.inputValue==null}"/>
<af:commandLink text="Пересчитать" id="commandLink31"
styleClass="tableControlButton"
binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink31}"
action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.calc}"
useWindow="true" immediate="false">
<af:setActionListener from="#{row.rowKeyStr}"
to="#{processScope.mainRowKeyStr}"/>
</af:commandLink>
</h:panelGroup>
</f:facet>
</af:table> -
How to create a table with multiple select on???
Hi all,
I am new to webdynpro and my requirement is to create a table with multiple selection on.I have to add abt 10 rows in the table but only 5 rows should be visible and moreover a verticalscroll should be available to view other rows.Can anybody explain me in detail how to do that.Please reply as if you are explaining to a newcomer.Reply ASAP as i have to do it today.
ThanxsHi,
1. Create a value node in your context name Table and set its cardinality to 0:n
2. Create 2 value attributes within the Table node name value1 and value2
3. Goto Outline view> Right click on TransparentUIContainer>Apply Template> Select Table>mark the node Table and it's attributes.
you have created a table and binded its value to context
Table UI properties
4.Set Selection Mode to Multi
5.Set Visible Row Count to 5
6.ScrollableColCount to 5
In your implemetaion, you can add values to table as follow:
IPrivate<viewname>.ITableElement ele = wdContext.nodeTable().createTableElement();
ele.setValue1(<value>);
ele.setValue2(<value>);
wdContext.nodeTable().addElement(ele);
The above code will allow you to add elements to your table node.
Regards,
Murtuza -
Update table with select from another table
Hallo,
I'd like to update table b with codes from a mapping table a.
a has:
town_id, town_code, town_name
b has town_code, town_id, town_population, town_zip_code,...
Table a has all the details - town_id, town_code and town_name and acts as the mapping between town_id and town_code
In table b, town_code is null. I want to update the column b.town_code with town_code from table a where a.town_id = b.town_id.
How will the update query look like?
I tried
UPDATE B SET town_code = (SELECT A.town_code FROM A,B WHERE A.town_id=B.town_id)
and I get the error 'single-row subquery returns more than one row'
Will appreciate your assistanceThis is what I did.
First, I created and populated the TOWN_INFO table:
CREATE TABLE "TOWN_INFO"
( "TOWN_ID" NUMBER,
"TOWN_CODE" NUMBER,
"E_MAIL" CHAR(15 BYTE)
Table Created.
insert all
into TOWN_INFO (TOWN_ID, E_MAIL) values (3024,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3040,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3052,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3065,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3066,'[email protected]')
select * from dual
5 rows created.
The following creates and populates the mapping table:
CREATE TABLE "TOWN_MAPP"
( "TOWN_CODE" NUMBER,
"TOWN_ID" VARCHAR2(255 BYTE),
"TOWN_NAME" CHAR(6 BYTE)
insert all
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3024,'1001','TOWN_1')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3040,'1003','TOWN_3')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3052,'1002','TOWN_2')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3065,'1004','TOWN_4')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3066,'1006','TOWN_6')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3088,'1007','TOWN_7')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3020,'1009','TOWN_9')
select * from dual
7 rows created.
And now the update query:
UPDATE TOWN_INFO
SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
WHERE B.TOWN_ID=B.TOWN_ID)
SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
ERROR at line 2:
ORA-01427: single-row subquery returns more than one row
Thanx in advance
Edited by: user9954260 on Apr 13, 2010 7:40 AM
Edited by: user9954260 on Apr 13, 2010 7:44 AM -
ADF Table with CheckBox - Select/deselect issue
I have seen couple of threads and blogs for ADF table with check box . but none of them exactly matching with my requirement . My Database table does not have any field for check box .
Here is my DB Table
tableA_
A_Id
A_Name
tableB*
B_Id
Requirements :*
1. Display the above tables data with Checkbox . ( if A_Id = B_Id then the checkbox will be checked , else unchecked ) .
2. Select / deselect the check box and save the data . Saving the data , will update only tableB . i,e when a new check box is selected then A_Id value will be inserted to tableB . Similarly , deselecting a checked in data will remove the entry from tableB.
Development :
1. Created a VO where tableB has marked as updateable .
2. Created a transient Boolean variable for checkBox . and modified the getter method of checkbox for returning true/false based on the below condition in the ViewRowImpl Class .
if ( A_Id = B_Id )
return true;
else false ;
3. I have not modified the setter method .
Using the above concept i can view the data with selected checkbox . but the problem is to save the data . because , when I select a checkbox the above coding in the getter method will return false .
Therefore , though i am selecting the checkbox but value of the checkbox has been set as false .
While saving the Data , I am iterating through the VOIterator and observed that a newly selected checkbox value is false . and realized its because of the getter method condition .
Can you please suggest how can I overcome this issue or shall I need to take any other approach ?
Jdev version 11.1.1.5
Regards,
Amitava
Edited by: Amitava on Mar 17, 2012 3:48 PMYou need to go through the ADF page life cycle concepts. In simple words the boolean value in the model is not set while in valueChangeListener. Try adding valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance()); on top in your listener method and see the effect.
Reference:
http://docs.oracle.com/cd/E15051_01/web.1111/b31974/adf_lifecycle.htm -
I have a problem when update tables with a database link (APEX)
Hi, I search answers for my problem and I not found a solution. My problem start when I open page with database link statement in APEX. I drop tables and execute this for update the tables in APEX.
EXECUTE IMMEDIATE 'CREATE TABLE XXXXXXX
AS
SELECT A1,A2,A3
FROM AAA@BBB';
I use Mozilla Firefox and isn't always updated the tables because it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
In the explorer always show a window only the text "IBMPC/WIN_NT-8.1.0"...
What is the solution for my problem? I need update this tables.
Thanks. John.It's easy. It doesn't work a database link, on apex, with a pl/sql code or store procedure.
I saw that many people had the same problem but I don't see a solution.
As I put up, I want to remove my tables on APEX and copy the table of my Oracle database with the update dates.
The posts are from the same problem as my English is very bad, it got to help explain the problem.
I have a page with a pl/sql code. This code in Oracle is correctly.
For example, with this code I update the table PRUEBAS with the data of TABLEX.
BEGIN
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
EXCEPTION WHEN OTHERS THEN NULL;
END;
EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
AS
SELECT AAA,
BBB,
CCC
FROM TABLEX';
END;
But, in this code, I have the problem.
BEGIN
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
EXCEPTION WHEN OTHERS THEN NULL;
END;
EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
AS
SELECT AAA,
BBB,
CCC
FROM TABLEX@DB_LINK';
END;
I sometimes get an error. Sometimes it works fine, but half of the tries Apex returns "IBMPC/WIN_NT-8.1.0" in the browser and I am not using an IBM PC or Win NT...
And i read that In the alert_xe.log file there are a error of core dump... ... :S or that the application return corrupt headers.... Is a problem of versions?
I used a synonym and I have the same problem.
Even if I run the code on SQL COMMANDS (SQL WORKSHOP) it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
The problem is in Mozilla Firefox and in IE.
I have the OracleXE 10g (Application Express 3.0.1.00.08).
And the question is.. ... ... ... ... What is the solution? :)
Thanks.
John. -
Help me to update table with condition's
this table is an alert table which will update when the sql server down , not pinging and drive space low.
Every 15 mins the monitoring system run. if the any issue came then it will update the information in this table. if the issue not solved by 15 mins the table will update again with the same details..
I would like update tickeraised = Y only on first time and if i got same issue less then 30 min the it should not change to Y.. based on server name , type and message.
min >10 and <20 min if any value is there then the table should not update with same value. can any one help me with tsql query...In future please post DDL and DML. For now I have created a scenario which will help you understand solution to your own requirement.
CREATE TABLE Tickets_Log(
Ticked_ID SMALLINT IDENTITY(1,1) PRIMARY KEY,
Ticket_Type VARCHAR(20) NOT NULL,
Log_Date DATETIME2 NOT NULL DEFAULT DATEADD(MINUTE,-15,GETDATE()),
Machine_Name VARCHAR(50) NOT NULL,
Message VARCHAR(100) NOT NULL,
Ticket_Status CHAR(2) NOT NULL DEFAULT 'N',
Update_Status SMALLINT DEFAULT 0)
INSERT Tickets_Log(Ticket_Type,Machine_Name,Message)
SELECT 'Pinging','HOD-400-651','Server Not Pinging' UNION
SELECT 'Low Drive Space','HOD-400-652','Drive Space Low' UNION
SELECT 'Connection','HOD-400-653','Unable to Connect to Server'
UPDATE TL
SET Log_Date=NewTickets.Log_Date,
Update_Status=1
FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
WHERE TL.Ticket_Type IS NOT NULL AND TL.Machine_Name IS NOT NULL AND DATEDIFF(MINUTE,TL.Log_Date,NewTickets.Log_Date)>=15 AND Update_Status=0
INSERT Tickets_Log(Ticket_Type,Machine_Name,Message,Log_Date)
SELECT NewTickets.*
FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
WHERE TL.Ticket_Type IS NULL AND TL.Machine_Name IS NULL
Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
The climb is all there is. -
Updating table with query of 2 other tables?
Greetings
I apologize in advance if this seems too easy to do- but I am missing something.
I have 8000 records in an Access DB (I know- it's going into SQL soon) in which all the departmental office IDs need to be updated.
The column in the main table is named "q_office_ID".
The user table includes user_ID & office_ID.
The office table also includes office_ID.
This UPDATE sets all the values to the number 10?:
<cfquery name="update" datasource="#Request.BaseDSN#">
SELECT queue_ID, q_user_ID, user_ID, office_ID
FROM main_helpdesk, lookup_user
WHERE q_user_ID = user_ID
</cfquery>
<cfloop query="update"><cfquery name="updatedata" datasource="#Request.BaseDSN#">
UPDATE main_helpdesk
SET q_office_ID = #office_ID#
</cfquery></cfloop>
I know there is something obviously wrong with the update- any help would be greatly appreciated.
Thank YouActually, it was:
<cfquery name="update" datasource="#Request.BaseDSN#">
SELECT queue_ID, q_user_ID, user_ID, office_ID
FROM main_helpdesk, lookup_user
</cfquery>
<cfloop query="update">
<cfquery name="updatedata" datasource="#Request.BaseDSN#">
UPDATE main_helpdesk
SET q_office_ID = #office_ID#
WHERE q_user_ID = #user_ID#
</cfquery></cfloop>
My mistake. -
Updating table with invalid identifiers
Hi!
I use a third-party plug in and that comparisons of chemical structures. I would like to update one table with values from another when the plug-in matches two rows. However, I am getting an invalid identifier problem.
Two tables:
PLATES: has VARCHAR2 columns of PLATE_SMILES, IN_DB
INVEST: has VARCHAR2 columns of SMILES
The operator is a binary one: jc_compare(PLATE_SMILES, SMILES)=1 (or 0 if they don't match)
I want my query to say: "If comparison of PLATE_SMILES, SMILES = 1, set IN_DB=1 for that row" - effectively asking if PLATE_SMILES exists in the INVEST table.
I've tried a number of renditions, all giving invalid identifiers. Here's an example:
update (select plate.PLATE_SMILES, plate.IN_DB, invest.SMILES
from PLATES plate
INVEST invest
WHERE jc_compare(PLATE_SMILES, SMILES)=1)
set plate.IN_DB = 1;
ORA-00904: "PLATE"."IN_DB": invalid identifier
I'm hoping this should be an easy fix, and any help is greatly appreciated!Hi,
You have
UPDATE (SELECT plate.plate_smiles,
plate.in_db,
invest.smiles
FROM plates plate, invest invest
WHERE jc_compare ( plate_smiles, smiles) = 1)
SET plate.in_db = 1; -- Error herePLATE is not known outside the inline view. Just remove it.
Regards
Peter -
Hi,
I have to update Table by reading Xml data.
I have written a procedure which is given below.
PROCEDURE Sp_Set_File_Permission
p_i_v_xml_data IN VARCHAR2,
Cur_Out_Col_Nm OUT Typ_Icon_Out
IS
XmlDataset XMLTYPE;
BEGIN
/* This is my xml
<xmldata>
<newdataset>
<fileid>99</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>*/
xmldataset := Xmltype.Createxml(p_i_v_Xml_Data);
--error occured on this line while executing procedure
FOR i IN (SELECT
Dt.Extract('//newdataset/fileid/text()').Getstringval() AS Fileid,
Dt.Extract('//newdataset/add/text()').Getstringval() AS Add,
Dt.Extract('//newdataset/edit/text()').Getstringval() AS Edit,
Dt.Extract('//newdataset/del/text()').Getstringval() AS d,
Dt.Extract('//newdataset/ex/text()').Getstringval() AS e,
Dt.Extract('//newdataset/im/text()').Getstringval() AS I
FROM TABLE(Xmlsequence( xmldataset.Extract('//xmldata/newdataset'))) Dt)
LOOP
UPDATE t_object_master
SET add_view=i.Add
,edit_view=i.Edit,
delete_view=i.D,
export_view=i.E,
import_view=i.I
WHERE objct_id=i.Fileid;
COMMIT;
END LOOP;
END Sp_Set_File_Permission;
When I am trying to exceute this procedure with the above mentioned xml ,getting error ORA-00923 ,FROM keyword not found where expected.
Please help me out in this.
Thanks,Something like this (no commit inside loop, no row per row)
create table t_object_master as
with myxml as (
select xmltype(
'<xmldata>
<newdataset>
<fileid>99</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>') doc from dual
select
fileid
,add_view
from
myxml
,xmltable('//newdataset'
passing myxml.doc
columns
Fileid number path 'fileid'
,add_view varchar2(5) path 'add'
table created
select
from t_object_master
FILEID
ADD_VIEW
99
TRUE
100
FALSE
update t_object_master t
set add_view = (
with myxml as (
select xmltype(
'<xmldata>
<newdataset>
<fileid>99</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>') doc from dual
, myextract as (
select
fileid
,add_view
from
myxml
,xmltable('//newdataset'
passing myxml.doc
columns
Fileid number path 'fileid'
,add_view varchar2(5) path 'add'
select
add_view
from myextract
where
fileid = t.fileid
select *
from t_object_master
FILEID
ADD_VIEW
99
FALSE
100
TRUE -
How to reduce time when updating table with join of anther table
Hi all,
I am update table Policy1 using another table from other scheme
Policy1 is in schema "TEST".
TRN_POLICY_RISK_GIS is in Schema "TEST2".
Now i am executing my query which is taking lot of time to update and make cpu utilization upto 45%.
update policy1 set total_si = (select total_is from (select pol_sys_id,
avg(nvl(pol_cvr_si,0)) total_si from TEST2.TRN_POLICY_COVER_GIS tpcg
group by pol_sys_id ) b where p.pol_sys_id = b.pol_sys_id)
Help to optimize to given query.update policy1 A
set total_si =
(select avg(nvl(pol_cvr_si,0))
from TEST2.TRN_POLICY_COVER_GIS B
where B.pol_sys_id = A.pol_sys_id
;hopefully there is an index on TEST2.TRN_POLICY_COVER_GIS (POL_SYS_ID) -
29875; error updating table with geometry but without index
hi,
I've a table with next description
AGGREGATEDUNIT_ID NOT NULL NUMBER(38)
DATASET_ID NUMBER(38)
GEOMETRY MDSYS.SDO_GEOMETRY
REDEFINEDMETADATA SYS.XMLTYPE
I dont need a spatial index in column GEOMETRY, but when I try an update operation:
INSERT INTO AGGREGATEDUNIT (AGGREGATEDUNIT_ID, DATASET_ID) VALUES (389, 893)
I get next error:
INSERT INTO AGGREGATEDUNIT
ERROR en lmnea 1:
ORA-29875: fallo al ejecutar la rutina ODCIINDEXINSERT
ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
ORA-06512: en "MDSYS.SDO_INDEX_METHOD_9I", lmnea 183
ORA-06512: en lmnea 1
anybody knows?
thanxHi,
Whether you need the index or not, someone has created a spatial index on the table.
You can drop the index, or you can add the metadata for the table into user_sdo_geom_metadata (it was there at the time the index was created).
Hope this helps,
Dan -
Error Updating Table with "Get Active UnitOfWork" Checked
Hi everyone.
I call invoke the a DB Adapter twice to update table in one BPEL, and so I have checked "Get Active UnitOfWork" so that each update can be persisted. I am seeing inconsistent results. What could be causing this?Hi, Have you checked the .jca source to make sure this value is indeed checked? Sometimes even when you check this option in the wizard it doesn't reflect in the source when you also perform a select operation: http://docs.oracle.com/cd/E12839_01/relnotes.1111/e10133/adapter.htm. Also are you using the xADataSource driver in the data source and the xADataSourceName ConnectionFactory property?
21.1.5.1 The Value Of the Active Unit Of Work Property Is Not Saved for Outbound SELECT Operation
While configuring an outbound Oracle Database Adapter to perform a SELECT operation, if you select Get Active Unit of Work in the Adapter Configuration Wizard - Advanced Option page, then the value of the GetActiveUnitofWork property is not saved in the .jca file.
The workaround for this issue is to manually add this property in the .jca file of the Oracle Database Adapter, as shown in the following example:
<property name="GetActiveUnitOfWork" value="true"/> -
Updating table with column NUMBER(6,2) causing concurrency exception in .NE
For info,
I try to update a table with a column defined as a NUMBER(6,2). I receive a concurrency exception.
If I resize this column as a NUMBER(8,2), every thing works well.
ByeI get the same problem. Changing from anything less than number(8,2) changes the vb datatype from single to double.
Apparently ODP.NET cannot handle the single datatype.
/Bj� -
How to show two seperate pivot tables with one select column
Hi All
My client wishes to have two pivot tables, one showing positive results and the other showing negative results.
For Example:
DIMENSION
BUSINESS A 1000
BUSINESS B 500
BUSINESS C 100
DIMENSION
BUSINESS A -1000
BUSINESS B -500
BUSINESS C -100
Is it possible to then select the different DIMENSION with one select column for both?
ThanksNot sure I got it right try this
for Number column pull twice and set col*-1
use 2 pivot table for each number type
cool as ~ http://cool-bi.com
Maybe you are looking for
-
Adobe Acrobat Professional 7.1.0, Chinese Fonts & OCR
You can see the version of Adobe Acrobat I am using. When I scan a document with Chinese fonts they appear just fine on screen. That means I've got "pictures" of the characters. However, I want to use my OCR function so that I actually have the in
-
Hard drive to airport extreme for time machine and iPhoto library
Can I buy an external hard drive and connect to my airport extreme to be used to host my iPhoto library. Meaning that no mater what Mac I upload an image to iPhoto in, it is referencing the same library on an external drive.
-
My Experience With "Your Purchase Could Not Be Completed"
About two months ago, the Apple store hit me with the, "Your Purchase Could Not Be Completed" message when I tried to rent a movie. I tried the obvious remediation steps, like switching the credit card, changing the device, and even trying a differen
-
Need some help with my spry accordian
i have now created a front page for my wesite http://www.mandyevansartist.com this is my code for the page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://w
-
Drag n Drop into a flash document
Hi, How can I get my flash movie to handle the drop event when dropping objects from outside the flash window. Thanks for your help..