First time generate sequence : ORM fireDac apdater Oracle database, delphi XE7

Issue #83 closed
Former user created an issue

Hello, somme error in unit : Spring.Persistence.SQL.Generators.Oracle 1 - First time i see error sequence not found, command.SequenceExists return true : if i create manualy this sequence no message error but other error :

#!

TFDCustomCommand.InternalExecute - Exception [Class="EOCINativeException", Msg="[FireDAC][Phys][Ora] ORA-06550: Ligne 1, colonne 221 :
PLS-00103: Symbole "END" rencontré à la place d'un des symboles suivants :
   * & = - + ; < / > at in is mod remainder not rem return
   returning <exposant (**)> <> or != or ~= >= <= <> and or like
   like2 like4 likec b"]
function TOracleSQLGenerator.GenerateCreateSequence(
  const command: TCreateSequenceCommand): string;
var
  LSequence: SequenceAttribute;
begin
  LSequence := command.Sequence;
  Result := 'BEGIN ';
  if command.SequenceExists then
    Result := Result + 'EXECUTE IMMEDIATE ' + QuotedStr(Format('DROP SEQUENCE "%0:S" ', [LSequence.SequenceName])) + ';';

//  Result := Result + ' EXECUTE IMMEDIATE ' + QuotedStr(Format('CREATE SEQUENCE "%0:S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY %2:D START WITH %1:D CACHE 20 NOORDER NOCYCLE',
//    [LSequence.SequenceName, LSequence.InitialValue, LSequence.Increment]));
  Result := Result + ' EXECUTE IMMEDIATE ' + QuotedStr(Format('CREATE SEQUENCE "%0:S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY %2:D START WITH %1:D CACHE 20 NOORDER NOCYCLE',
    [LSequence.SequenceName, LSequence.InitialValue, LSequence.Increment])) + ';'; // <--if i add this, it work

  Result := Result + ' END;';
end;

correction: i add + ';' in the end of the second command and all work find. Is this is correct ? excuse my english.

Best Regards

Comments (6)

  1. Log in to comment