editable fields ( or pop-up) in temporary tabs

(7 posts) (2 voices)

Tags:

No tags yet.

  1. vboccalate, Member

    If you can simply answer to 2 folowing queries:

    1)

    I need to make editable one field in a tmp_tab .

    I 've followed indication but the question is: can I make one tmp_tab field editable?

    Effectively the fields is phisically not existing into the dbase so any update in a tmp_tab is not possible to me becuase it doe not go to chance any existing tab in te mysql.
    If you can confirm.
    --------------------------------------------------------------------

    2) I need to edit a field date showing a calendar . So in the below

    DROP PROCEDURE IF EXISTS sp_DBR_mobdemob_date_edit $$ CREATE PROCEDURE sp_DBR_mobdemob_date_edit(inco_id int,mob_demob date) BEGIN

    /*chance Date*/

    update u
    set demob_date = mob_demob
    where topic_id =inco_id;
    END
    $$

    I've indicated the "DATE FIELD" in order to get the calendar appearing. However I cannot get the claendar and the field editable .

    I might be wrong in the below command onto main report

    select 'dbr.editable', 5, 'sp_DBR_mobdemob_date_edit', 'inco_id=9', 'type=date';

    I'm not sure.

    Thanks

  2. myDBR Team, Key Master

    Hi,
    temporary tables are usually used to store intermediate results during reports run. They only exists during reports execution time.

    When you make fields editable in a report, you are enabling editing on the result of the report. The table and the column that you actually update is a normal table and column in the database. You cannot update a tempary table used in the original report since it does not exist anymore.

    Try to update the table and column where the data originally came from.

    --
    myDBR Team

  3. vboccalate, Member

    If i understand what you say you mean i can use temp table to show data and editable fields. But after tmp table column select i have to run an update to the mysql tabs which tmp table is built from.

    Unfortunately it would not be so easy not using tmp tables in this report using only real ones

    Is there a similar example onto the demo section?this would help me out a lot

    Thanks

  4. myDBR Team, Key Master

    If i understand what you say you mean i can use temp table to show data and editable fields. But after tmp table column select i have to run an update to the mysql tabs which tmp table is built from.

    Exactly.

    Unfortunately it would not be so easy not using tmp tables in this report using only real ones

    There is absolutely no reason why you could not use temporary tables in a report which allows data editing. The editing procedure is a separate procedure from the report itself.

    --
    myDBR Team

  5. vboccalate, Member

    thanks for answer,
    can you give me an example of what you mean with your second note.so an example of an update of a temp tabs which contains editable fields.

    I underst. editing is a separate procedure from the report but a report done with tmp tabs cannot be updated becuase we do not know where saving things.

    just a smal coding example of a simle tmp tabs which is updated and edited in some of her fields.

    thanks

  6. myDBR Team, Key Master

    Not quite sure what you are out after, but do hope this clears things out for you.

    Editable fields and temporary tables have nothing to do with eachother. Temporary tables are sometimes used in procedures to ease up procedure logic by storing intermediate results. They exist only for the time the procedure is run and are completely invisible outside the procedure. Editable fields in myDBR allow you to set field in repoet output to be editable. Once edited, myDBR calls the editing report in the background doing whatever you like to do, usually updating/inserting data with given ID's and values.

    Here is a very simple example of report procedure whose report output comes from temporary table. Report will produce a simple list of ID and Name. The second column (name) is set to be editable. When user edits the data and accepts the change, myDBR calls procedure sp_DBR_edit_proc and passes along the correct id and the edited value.

    create procedure sp_DBR_myreport()
    begin create temporary table my_tmp_table (
    id int,
    name varchar(30)
    ); insert into my_tmp_table
    select id, name
    from my_real_table; select 'dbr.editable', 2, 'sp_DBR_edit_proc', 'inID=1'; select id, name
    from my_tmp_table; end;

    The editing procedure updates the original table using the given id and value. The editing procedure has no knowledge that temporary were used in the original report, nor does it have to. It simply does the editing.

    create procedure sp_DBR_edit_proc (
    inID int,
    inName varchar(30)
    )
    begin update my_real_table
    set name = inName
    where id=inID; end;

    Please see the documentation about the editable fields at http://mydbr.com/doc/?start.editable.html.

    --
    myDBR Team

  7. vboccalate, Member

    thanks is now fully clear.

    I appreciate the support.


Reply

You must log in to post.