![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
Problemilla con consulta con ORAStoredProc
Buenas a tod@s, tengo un pequeño problema y espero que me puedan ayudar.
Estoy haciendo una consulta a un campo utilizando un ORAStoredProc. La idea es crear un RadioButton por cada registro que encuentre en el campo buscado. Hago algo de este estilo: Código Delphi [-] OraStoredProc1.Close; OraStoredProc1.SQL.Add('SELECT DEFINICION FROM CUOTAS'); OraStoredProc1.Execute; OraDataSource1.DataSet := OraStoredProc1; DBGrid1.Datasource := OraDataSource1; numkc := OraStoredProc1.RowsProcessed; SetLength(KC,numkc); i:=0; //VALORES DEL LEFT Y DEL TOP x:=115; y:=59; while not StoredProc1.eof do begin //CONF DEL RADIO BUTTON KC[i] := TRadioButton.Create(Self); KC[i].Parent := Form1.GroupBox2; KC[i].Height := 17; KC[i].Width := 177; KC[i].Left := x; KC[i].Top := y+20; KC[i].Caption := OraStoredProc1.FieldValues['DEFINICION']; KC[i].Visible := true; OraStoredProc1.Next; Inc(i); end; El problema que tengo es que solo me muestra 1 RadioButton con el último registro que lee... ¿Sabeis que puede pasar? He probado a ejecutar el StoredProc1 dentro del bucle pero se queda la aplicación colgada... Muchas gracias de antemano. Un saludo!! |
#2
|
|||
|
|||
![]() ueps! parece que no me cogió bien el código...
Código Delphi [-] OraStoredProc1.Close; OraStoredProc1.SQL.Add('SELECT DEFINICION FROM CUOTAS'); OraStoredProc1.Execute; OraDataSource1.DataSet := OraStoredProc1; DBGrid1.Datasource := OraDataSource1; numkc := OraStoredProc1.RowsProcessed; SetLength(KC,numkc); i:=0; //VALORES DEL LEFT Y DEL TOP x:=115; y:=59; while not i<>numkc do begin //CONF DEL RADIO BUTTON KC[i] := TRadioButton.Create(Self); KC[i].Parent := Form1.GroupBox2; KC[i].Height := 17; KC[i].Width := 177; KC[i].Left := x; KC[i].Top := y+20; KC[i].Caption := OraStoredProc1.FieldValues['DEFINICION']; KC[i].Visible := true; OraStoredProc1.Next; Inc(i); end; [/delphi] Espero que este ahora mas claro ![]() ![]() |
#3
|
|||
|
|||
vaya... no se que estoy haciendo mal...
![]() ![]() OraStoredProc1.Close; OraStoredProc1.SQL.Add('SELECT DEFINICION FROM CUOTAS'); OraStoredProc1.Execute; OraDataSource1.DataSet := OraStoredProc1; DBGrid1.Datasource := OraDataSource1; numkc := OraStoredProc1.RowsProcessed; SetLength(KC,numkc); i:=0; //VALORES DEL LEFT Y DEL TOP x:=115; y:=59; while not i<>numkc do begin //CONF DEL RADIOBUTTON KC[i] := TRadioButton.Create(Self); KC[i].Parent := Form1.GroupBox2; KC[i].Height := 17; KC[i].Width := 177; KC[i].Left := x; KC[i].Top := y+20; KC[i].Caption := OraStoredProc1.FieldValues['DEFINICION']; KC[i].Visible := true; OraStoredProc1.Next; Inc(i); end; |
#4
|
|||
|
|||
Bueno, no acabé de acertar con el código... en la condición del bucle no pongo while not i<>numkc sino while not StoredProc1.Eof.
Utilizo Delphi 7 y Oracle. Gracias y perdon por el lio y el toston ![]() PD: si alguien sabe que hago mal al utilizar las etiquetas [ delphi ] le agradeceria también que me lo dijera |
![]() |
|
|
![]() |
||||
Tema | Autor | Foro | Respuestas | Último mensaje |
AddStandardAlias - problemilla | antoniom | Conexión con bases de datos | 5 | 08-02-2008 11:04:45 |
Problemilla con una consulta SQL | indy_o82 | Firebird e Interbase | 3 | 27-06-2006 09:20:10 |
Problemilla con SQL Explorer | Valeric | Varios | 0 | 10-11-2005 17:26:13 |
Problemilla con el FilenameEdit de las Rx | Sr.Scorpion | Varios | 1 | 29-03-2005 17:38:39 |
problemilla con calendar | weke | Varios | 3 | 06-07-2004 16:23:40 |
![]() |
|