Results 1 to 5 of 5

Thread: [Answers] Table

Threaded View

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Table

    Q:
    how to copy table
    A:
    The WHILE clause causes the scope to be REST. COPY TO with no additional clauses will copy all the records. A FOR clause is also supported - this has a scope of ALL.
    I'm assuming you just want to copy the structure and that you have the database and the original table repuk open. From the Console Lianja/VFP tab:
    Code:
    copy to repeu while .f.
    If you switch back to the Data Workspace, you should click Refresh from the Additional Commands under Tables|Table Names to refresh the list.



    Logical fields will be displayed as checkboxes automatically in edit mode. There is also the CheckListView gadget (demonstrated in the example_checklistview App) where you can have multiple checkboxes or a set of radio buttons depending on the 'Allow multiple selections' attribute.
    Fields with the 'Choices' attribute set will be displayed as comboboxes allowing the defined choices to be selected.



    Q:
    I try to append the records of one cursor to another
    A:
    Code:
    open database southwind
    use shippers
    select 0
    select * from shippers into cursor cursor2
    insert into shippers select * from cursor2 // or from &(alias(2))


    Q:
    xxtable use again in 0 alias newAlias
    the clause "again" does not work
    A:
    It depends if table already in use has the records you want, rather than just being a subset of the data. If it does, just select the workarea (this is demonstrated in lianjademo quickreport.rsp and in Library report.rsp). If not, use a virtual table.
    ... Alternatively, you've just run the report more than once without closing the table in between runs, so it does the equivalent of:

    Code:
    use roster in 0 current
    use roster in 0 current
    If the table wasn't already USED() and you don't need it afterwards, just issue a USE to close it.



    Q:
    Code:
    select id, id,name from filterTable where id =        0 OR name Like("sfoggia*")
    do not work.. the Like is case sensitive..
    A:
    Code:
    select ... where id = 0 OR lower(trim(name)) Like("sfoggia")


    Q:
    Can the console handle an sql query with multiple inner joins?
    A:
    It should be fine - just remember it needs to be a single line as you can't use the ; continuation in the Console.

    Code:
    open database southwind
    SELECT customers.customerid, customers.companyname, orders.customerid,  orders.orderid, order_details.orderid, order_details.productid FROM customers INNER JOIN orders ON customers.customerid = orders.customerid, orders INNER JOIN order_details ON orders.orderid = order_details.orderid


    Q:
    Is it possible to move one table and it's records from one database to another?
    A:
    With the target database open, from the Console, you could do this:

    Code:
    select * from sourceDatabase!sourceTable into table targetTable
    Then just delete/drop the original sourceTable when you are ready.



    list of tables in a database" then atables() can be used to get the tables in a database or SELECT * FROM systables



    When using parent / child related sections when you add new records to the child Lianja automatically inserts the parent key value into the child key.
    in order to be able to do this the parent key can be a composite key i.e. an expression, but the child key has to be a single column which can contain the evaluated parent key expression.
    So you need to create a foreign key column in the child table for that purpose.



    Q:
    How would I structure a page to show a list of searchable criteria that could be entered BEFORE the data is retreived?
    A:
    You need to build a custom query form as a custom canvas then have some buttons that do the retrieval and then change the datasource on a grid (assuming you want to populate a grid).



    The onbeforeupdare delegate is called just prior to the record being saved when you click on the save icon or click on another row.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-26 at 03:33.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us