Estoy intentando desarrollar un modulo en PHP que se conecta con con aplicativo en xHarbour usando ACE32.DLL pero tengo varias dudas.

  • Como saber mediante consuta sql en php el recno() ?

Gracias,

José David Angulo

asked 14 Jan '13, 08:32

Jos%C3%A9%20David's gravatar image

José David
41225
accept rate: 0%


RowId, es un campo que tienen todos los records de una tabla. Dentro del RowId, tienes el # de record, pero hay que extraerlo. Seguramente te sea mejor si creas una función dentro del Diccionario de Datos que luego puedas reusar cada vez que quieras de manera mas sencilla. Algo así:

      oAdsQuery:cSql := "CREATE FUNCTION recno(" +;
      "s_rowid CHAR ( 18 ) ) " + CRLF + ;
      "RETURNS INTEGER " + CRLF + ;
      "DESCRIPTION 'Convert string row_id to isam recno() integer value' " + CRLF + ;
      "BEGIN " + CRLF + ;
      CRLF + ;
      " return ( position( substring( s_rowid, 13, 1 ) in " +CRLF+;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1)*1073741824 + "+;
      "(position(substring(s_rowid, 14, 1) in " + ;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1)*16777216 + "+;
      "(position(substring(s_rowid, 15, 1) in " + ;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1)*262144 + "+;
      "(position(substring(s_rowid, 16, 1) in "+ ;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1)*4096 + "+;
      "(position(substring(s_rowid, 17, 1) in "+;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1)*64 + "+;
      "(position(substring(s_rowid, 18, 1) in "+;
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')-1); " + CRLF + ;
      "END; "

Una vez creada la función dentro del DD, entonces la puedes reusar cada vez. Algo así:

SELECT RecNo( rowId ) FROM customers WHERE Customer_id = '10000' ;

Espero te sirva.

link

answered 14 Jan '13, 08:48

Reinaldo's gravatar image

Reinaldo
816202346
accept rate: 6%

Your answer to the original question.
If responding to a request for additional information, please edit the question or use the comment functionality.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20

Asked: 14 Jan '13, 08:32

Seen: 2,132 times

Last updated: 14 Jan '13, 08:48

Advantage Developer Zone Contact Us Privacy Policy Copyright Info


Powered by Advantage Database Server and OSQA
Disclaimer: Opinions expressed here are those of the poster and do not necessarily reflect the views of the company.