I am getting the data from database
$sqlQuery="select receivedJob_id as ID,received_date as DATED,job_title as JOB,location as LOCATION,firstName as FIRSTNAME,lastName as LASTNAME,college as COLLEGE,
qualification as QUALIFICATION,cpi as CPI,exp_salary as EXP_SALARY,ctc as CTC,notice_period as NOTICE_PERIOD,current_emp as CURRENT_COMPANY from receivedJobs";
$data=Yii::app()->db->createCommand($sqlQuery)->queryAll();
and showing to view in table using array data provider and cgird view,Now I am adding one extra field in table in in controller I have defined the active drop down list like this
$actionList=array("shortlist","download Resume","Not interested");
$dropdown = CHtml::activeDropDownList($model,'taken_action',$actionList,array('empty'=>'Select'));
$totalrow = count($filteredData);
for($index=0;$index<$totalrow;$index++){
$filteredData[$index]['DD'] = $dropdown;
}
and showing the table in view using cgrid view without any issue,Now on screen if I choose an option from drop down list ,I want to get that selected value to manipulate it,For that I used CCheckBox class like this in view
array (
'id' => 'selectedId',
'class' => 'CCheckBoxColumn'
),
when i select one row from screen table I can get the id of that row,but how Can I get the drop down selected value for that row?
Any help would be great.
Related
I am trying to return the values stored in 'Table 1' from HDIV, but Table 1 is hidden. The web query can see it under Web View, but won't pull it in. When I select and load Table 1, Table 2 is actually loaded. Is there a way to load the hidden table?
Probably a simple answer, but assume I have a table with 3 columns:
ab, cd, ef
I create a new view
SELECT *
FROM tbl
It works. I save the view, SSMS automatically changes the saved version of the view to say:
SELECT dbo.tbl.ab, dbo.tbl.cd, dbo.tbl.ef
How do I keep the saved version of the view to include all columns in tbl rather than explicitly identifying each column?
You can create the view like this:
CREATE VIEW vwTbl
AS
SELECT *
FROM tbl
Then you can query the view to retrieve all columns like:
SELECT * FROM vwTbl
I have a drop down box on a page in my oracle apex application, I'd like to use the drop down box which displays a company's data(company name) within the company table (which I have achieved); which the user can use to identify specifically what company they'd like to delete. I'd then like to use a button to delete the selected company, and that's what I cannot figure out.
So far I have got as far as using dynamic actions to delete every entry in the table.
Pseudo code for what I am trying to achieve:
SELECT COMPANY_ID FROM COMPANYLIST,
DELETE SELECTED;
Company list being the drop-down box name.
It sounds like you are just struggling with the delete statement?
It should be something like this.
DELETE FROM company
WHERE company_id = (SELECT company_id
FROM companylist
WHERE upper(company_name) = upper(:P1_COMPANY_NAME) );
Replacing company with whatever your company table is called, and :P1_COMPANY_NAME with whatever your select list item is.
I currently have a select list with the values: 1, 2, 3, 4 & 5. These correspond to a column in table "DVD" called "DVDID", and these are the only values in this column in the table.
In the table "DVDCOPY" records exist containing the all DVDIDs (1,2,3,4,5) with a different DVDCOPYID.
E.g. a record from the DVDCOPY table is:
DVDCOPYID DVDID DISCCONDID
1 1 1
My question is, how can I make it so that once a DVDID is selected from the select list, the DVDCOPYID changes dynamically based on this selection? E.g. once 1 is selected in the DVDID select list, the value for DVDCOPYID also changes to 1 automatically.
My form currently looks like this, if this helps:
APEX Form
You have to use dynamic actions and PL/SQL. Create a hidden form element which allows for element changes (no session protection enabled). Create a new dynamic action in your form guiding to the select list and using the onchange event. Your dynamic action contains two steps: first set the hidden form element to the value of your select list. Second: execute a PL/SQL statement (UPDATE DVDCOPYID SET ... = :NEW_HIDDEN_ELEMENT WHERE ID = ...).
I have a table 'Goods' with different information about goods (name, price, etc). I need to create a view at the same scheme as table 'Goods' has. But the view must be empty. And when user adds new good to the view it is saved in table 'Goods', but the view remains empty when user opens it next time. So main idea is not to show existing data to the user which has access to the view.
Assuming your on a database system that supports a concept like SQL Server's CHECK OPTION, and you're allowed to create a view that doesn't have that option set, you should be fine:
create table T (ID int not null)
go
create view V
as
select * from T where 1=0
go
select * from V
go
insert into V(ID) values (10)
go
select * from V
go
select * from T
The two selects from V return 0 rows. The select from T returns one row:
ID
----
10
CHECK OPTION:
Forces all data modification statements executed against the view to follow the criteria set within select_statement. When a row is modified through a view, the WITH CHECK OPTION makes sure the data remains visible through the view after the modification is committed.
And you want the opposite - you want to allow data modifications performed through the view to create rows which are invisible through the view.
Create table Goods1 with "insert trigger" on it which make insert into Goods and delete from Goods1
As far as I know this isn't possible. The whole point of a view is that it is a view to a table or grouping of tables, ie. it must show the data that matches the view.
http://www.w3schools.com/sql/sql_view.asp
What you could do is create another table called GoodsView and add a trigger to it to INSERT into Goods table and DELETE from GoodsView afterwards.
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fsqlp%2Frbafysqltrig.htm