FirebirdSQL / firebird-documentation

Firebird documentation
https://www.firebirdsql.org/en/firebird-rdbms/
34 stars 14 forks source link

RECREATE TABLE is acceptable in embedded mode #171

Closed hamacker closed 2 years ago

hamacker commented 2 years ago

The link https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref40/firebird-40-language-reference.html#fblangref40-ddl-tbl-recreate says that RECREATE TABLE is not acceptable for Embedded SQL (ESQL), but it is! I try and it's OK.

mrotteveel commented 2 years ago

Could you provide an example of it in ESQL?

hamacker commented 2 years ago

Of curse! In Lazarus using zeos, I already have one: https://github.com/gladiston/lazdemos_gsl.git in lazdemos_gsl/lazdemo_transacoes Is a sample project that create a database and connect using both methods, if you can connect using embeded method or client/servir, 'recreate table' will be used to create TEST_TIL and add registries. If you just see a code, line #465 in view.principal.pas file.

Em ter., 1 de mar. de 2022 às 05:07, Mark Rotteveel < @.***> escreveu:

Could you provide an example of it in ESQL?

— Reply to this email directly, view it on GitHub https://github.com/FirebirdSQL/firebird-documentation/issues/171#issuecomment-1055135549, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJBLEHXJ5ZITIXHKENNWFLU5XF3DANCNFSM5PSLYCXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

mrotteveel commented 2 years ago

That example doesn't use ESQL (Embedded SQL), it uses DSQL (Dynamic SQL). ESQL is a special dialect of Firebird SQL that is embedded in code, and transformed by a preprocessor (gpre) before compilation.

I guess you're using the Firebird Embedded database engine. Though both use the term embedded they are not related.

hamacker commented 2 years ago

Yes, I am using Firebird Embedded database engine. I think that using this method, all queries will be the same ESQL, is not?

Message ID: <FirebirdSQL/firebird-documentation/issues/171/1059708547@ github.com>

mrotteveel commented 2 years ago

No, it is not. You're using DSQL (Dynamic SQL), the "normal" SQL dialect of Firebird. As I said, ESQL is a special embedded language that is transformed using a preprocessor. It is hardly ever used these days.