|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question regarding TSql vs SQL used in Fb
to be honest... i never had need to use any db rather than sql server.
i had developed a little apoplication with three sql statements too simple to be mentioned but an idea from a friend caused me to try firebird. in fact... i'm stuck! i've tried many docs, most require one take a long time reading through technical documents but for me this is not suitable. so i put my code here and waiting for a kind expert to translate it for me. i appreciate your kind reply. i realised that select in code sql is different from select in a stored proce. i could not managed this through stored proc and i need it. application works but in a basic manner: i broke these statement in parts and execute them through one by one steps. if((SELECT Count(*) FROM [TABLENAME] WHERE [Field1]=N'aaa' AND [Field2]=N'bbb') = 0) begin INSERT INTO [TABLENAME]([Field1], [Field2]) VALUES(N'aaa', N'bbb') select @@IDENTITY as Result end else select -1 as Result thanks in advance. |
|
#2
|
||||
|
||||
|
Your code seems very MsSQL specific, you would find the same difficulties with every other database, I'd suggest you start reading.
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#3
|
||||
|
||||
|
Let me add that Firebird comes with a sample database (employee.fdb) which holds some stored procs also, those are good examples.
You are also using IDENTITY which is not supported in Firebird (and Postgresql and Oracle ....) where you'll find that the same is accomplished with a mix of generators and triggers, so the problem of retrieving the identity field value after an insert is completely different. Last edited by pabloj : September 13th, 2006 at 02:36 AM. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Question regarding TSql vs SQL used in Fb |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|