please any help welcome... show data and insert tipo autoincremental - Forum

Forum Navigation
You need to log in to create posts and topics.

please any help welcome... show data and insert tipo autoincremental

@ebear,PaulJonestindall,@gaev,@vadim,

ENGLISH

Is it possible to display in a grid show the data from a table and a column from another table?

example

Table 1

name Address

table 2

e-mail

the idea is to be able to bring the view into a query and display

name - address - email (email being a data from table 2)

last consult

I have been presented with a problem that I cannot solve, I have created a table called immo, it has only 3 fields file, autoincrement (primary key) folder (numeric) location (string) But when I want to insert it gives me a syntax error in the insert I know I'm making a mistake when entering the autoincremental value, I put it like this, what am I doing wrong?
dbpExecSQL "inmo" "INSERT INTO properties (file,folder,location) VALUES (null,[folder],'[address]');"

ESPAÑOL

Es posible poder mostrar en un grid show los datos de una tabla y una columna de otra tabla?

ejemplo

tabla 1

nombre - direccion

tabla 2

email

la idea es poder traer a la vista en una consulta y mostrar

nombre - direccion - email (siendo email un dato de la tabla 2)

Ultima consulta

se me presenta un problema al intentar insertar un valor autoincremental no se si lo estoy haciendo bien

dbpExecSQL "inmo" "INSERT INTO propietarios (legajo,carpeta,ubicacion) VALUES (null,[carpeta],'[ubicacion]');"

(legajo y carpeta son numericos y legajo es autoincremental...

@joferar333

You don't need to revert to dbpExecSQL for this ... take a look at the dbpDefineRelationship command here ...

https://neodbprohelp.visualneo.com/Tables.html#dbpDefineRelationship

... but if you insist on using dbpExecSQL, it says that the SQL Equivalent is JOIN or INNER JOIN.

But when I want to insert it gives me a syntax error

Again, you can do it without resorting to dbpExecSQL ...

1) use dbpAddRecord to add an empty record

2) then use SetVar and the 'special format VisualNEO for Windows variables' to update the 'fields in the current record' ... see https://neodbprohelp.visualneo.com/WorkingwithData.html for details about this special format

Thanks @gaev, what you tell me I have already seen, in fact I have created the relationship with the command of the plugins all barbaric but not once the tables are related when I ask for the view it only brings me the data of 1 table it does not add the data that are established related...
at least I can't do it, and the written help is limited to giving the example of how to relate but not how to show the table with the related data in a view...

Autoincrementals are not inserted, they are generated by themselves on each insert, the instruction is:

dbpExecSQL "inmo" "INSERT INTO propietarios (carpeta,ubicacion) VALUES ([carpeta],'[ubicacion]')"

When you want to bring data from more than one table, there must be a relationship between the tables, for example, both should have the legajo field, so the sql statement is: Select t1.nombre,t1.direccion,t2.email
from table1 t1
Join table2 t2 ON t1.legajo=t2.legajo

salu2

@joferar333

when I ask for the view it only brings me the data of 1 table it does not add the data that are established related...
at least I can't do it, and the written help is limited to giving the example of how to relate but not how to show the table with the related data in a view

Upload  ...

  • an .mdb file with the two Tables and just the fields in question ... load the tables with some data
  • a pub file with just a Rectangle to host the grid View and a Button with the dbpDefineRelationship command ... and I will play with it.