delete selected cell from data base SQL

조회 수: 2 (최근 30일)
Cristian Martin
Cristian Martin 2022년 6월 11일
댓글: Cristian Martin 2022년 6월 11일
Hi, I have a uitable GUI loaded from an SQL DB and I want to select a row from table and delete also from SQL DB, could you give me a direction ?
D=get(handles.uitable4,'Data');
Index=get(handles.uitable4,'UserData');
D(Index.Indices(:,1), :) = [];
set(handles.uitable4,'Data',D);% here a delete the row only from uitable
conn = database('data_base', '', '');
curs = exec(conn, 'SELECT * FROM prices.prices order by Crt desc');
curs = fetch(curs);
close(curs);
I use R2015a.
Thanks
  댓글 수: 1
Cristian Martin
Cristian Martin 2022년 6월 11일
function uitable1_CellSelectionCallback(hObject, eventdata, handles)
% hObject handle to uitable1 (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
% Indices: row and column indices of the cell(s) currently selecteds
% handles structure with handles and user data (see GUIDATA)
handles = guidata(uitable1);
data = get(uitable1, 'Data');
index = Event.Indices;
set(handles.text15, sprintf('%g', data(index(1), index(2))));
I'm trying to get value from cell selected but somewere i'm wrong, where?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by