Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Tablas planas (https://www.clubdelphi.com/foros/forumdisplay.php?f=20)
-   -   Api Bde (https://www.clubdelphi.com/foros/showthread.php?t=53354)

MariaOlive 19-02-2008 11:07:56

Api Bde
 
Hola.

Necesito modificar la posicion de los campos de una tabla.

Estos campos estan situados al final de la tabla y necesito situarlos en mitad de la tabla.

Los campos ya existen en la tabla.

Estoy usando la funcion DbiDoRestructure del API del BDE.

Saludos. Maria.

jachguate 19-02-2008 13:32:26

:confused: :confused:

¿Y la pregunta es?

:confused: :confused:

juanelo 19-02-2008 16:20:05

Cita:

Empezado por jachguate (Mensaje 266893)
:confused: :confused:

¿Y la pregunta es?

:confused: :confused:

[BROMA]
¿De que color era el caballo blanco de Napoleón?
[/BROMA]

:D:D:D

marcoszorrilla 19-02-2008 18:54:44

Cita:

C syntax

DBIResult DBIFN DbiDoRestructure (hDb, iTblDescCount, pTblDesc, pszSaveAs, [pszKeyviolName], [pszProblemsName], bAnalyzeOnly);

Delphi syntax

function DbiDoRestructure (hDb: hDBIDb; iTblDescCount: Word; pTblDesc: pCRTblDesc; pszSaveAs: PChar; pszKeyviolName: PChar; pszProblemsName: PChar; bAnalyzeOnly: Bool): DBIResult stdcall;

Description

DbiDoRestructure changes the properties of a table such as the following: modifying field types or field sizes, adding a field, deleting a field, rearranging fields; or changing indexes, security passwords, or referential integrity.

Parameters

hDb Type: hDBIDb (Input)
Specifies the database handle.
iTblDescCount Type: UINT16 (Input)
Specifies the number of table descriptors. Currently, only one table descriptor can be processed per call, so iTblDescCount must be set to 1.
pTblDesc Type: pCRTblDesc (Input)
Pointer to the client-allocated CRTblDesc structure, which identifies the source table, describes the new record structure (if modified), and lists all other changes to the table

pszSaveAs Type: pCHAR (Input)
Optional. If not NULL, creates a restructured table with this name and leaves the original unchanged.
pszKeyviolName Type: pCHAR (Input)
Optional. Pointer to the Key Violation table name. All records that cause an integrity violation are placed here. If NULL, no Key Violation table is created. If the user supplies a table name, that name is used. If a pointer to an empty string is specified, the table name created is returned in the user's area (must be at least DBIMAXPATHLEN+1 bytes).

pszProblemsName Type: pCHAR (Input)
Optional. Pointer to the Problems table name. If NULL, no Problems table is created. If the user supplies a table name, that name is used. If the user has overridden the default behavior with a callback, records are placed in a Problems table if they cannot be placed into the destination table without trimming data. If a pointer to an empty string is specified, the table name created is returned in the user's area (must be at least DBIMAXPATHLEN+1 bytes).

bAnalyzeOnly Type: BOOL (Input)
Not currently used.
Vista la ayuda sobre la Función yo no me arriesgaría a hacer eso con una tabla con datos.

Yo lo que haría sería, crear una tabla igual pero variando los campos de lugar utilizando SQL y luego le pasaría los datos a la nueva tabla, todo ello haciendo antes una copia de seguridad de la tabla original por si acaso.

Un Saludo.

jachguate 19-02-2008 22:56:21

Realmente no entiendo por que es tan importante cambiar el orden de los campos... finalmente, eso no tiene impacto en lo que podamos o no presentar en una aplicación.

¿Me equivoco?

Hasta luego.

;)

marcoszorrilla 20-02-2008 07:04:16

Estoy de acuerdo, salvo que queramos crear una llave sino existiera, entonces los campos que forman parte de la misma tienen que estar necesariamente los primeros, en cualquier otro caso para rejillas etc. sería suficiente con intercalarlos donde proceda en la propia rejilla..

Un Saludo.

jachguate 20-02-2008 08:12:34

No sabía de este comportamiento de la llave primaria... aún así, es una situación poco común tener que alterar la llave de una tabla. Para esos casos, lo ya dicho por vos... copias de seguridad y quizás un volcado de la tabla a una nueva estructura resulte lo mejor...

Un saludo.

;)


La franja horaria es GMT +2. Ahora son las 13:43:50.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi