
Quote from joferar333 on August 28, 2022, 12:05 am@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
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
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...
@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
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
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...
Quote from Gaev on August 28, 2022, 4:13 am@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
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

Quote from joferar333 on August 28, 2022, 7:59 amThanks @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...
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...
Quote from rasl on August 28, 2022, 4:48 pmAutoincrementals 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.legajosalu2
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
Quote from Gaev on August 28, 2022, 8:18 pm@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 viewUpload ...
- 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.
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 ...