TPT script : syntax error at "VARCHAR";

Tools
Enthusiast

TPT script : syntax error at "VARCHAR";

Hi all, I'm very new to TPT and when I'm trying to build a sample script to create a table Source_Emp_Table and then loads the rows inside the table i got the following error while executing the script at the command prompt tbuild -f Emp_TPT.txt. Appreciate your help.

line 8: syntax error at "VARCHAR"; "VARCHAR" not in { LPAREN_ EQUALS_ ARRAY_ VAR

CHAR_ VARYING_ REGULAR_IDENTIFIER_ EXTENDED_IDENTIFIER_ EXTENDED_IDENTIFIER_NO_N

_ } in Rule: Attribute Definition

Here is my script:

DEFINE JOB CREATE_SOURCE_EMP_TABLE

(

  DEFINE OPERATOR DDL_OPERATOR

  DESCRIPTION 'TPT DDL_OPERATOR'

  TYPE DDL

  ATTRIBUTES

   (

     VARCHAR TdpId = 'LocalTd'

     VARCHAR UserName = 'tduser',

     VARCHAR PassWord = 'tduser'

   ); 

 APPLY

   ('CREATE TABLE tduser.Source_Emp_Table

 (Emp_id integer,

 Emp_name char(10));'),

   ('INSERT INTO tduser.Source_Emp_Table

 (1,'joe');'),

   ('INSERT INTO tduser.Source_Emp_Table

 (2,'George');'),

   ('INSERT INTO tduser.Source_Emp_Table

 (3,'Jade');')

  TO OPERATOR (DDL_OPERATOR());

);

Thanks

6 REPLIES
Junior Supporter

Re: TPT script : syntax error at "VARCHAR";

Attribute definition must end with a comma ','

VARCHAR TdpId = 'LocalTd',

HTH

Cheers.

Carlos.

Enthusiast

Re: TPT script : syntax error at "VARCHAR";

I have corrected it but still same error.

Thanks

Junior Contributor

Re: TPT script : syntax error at "VARCHAR";

Should be a different error :-)

You need to escape the single quotes names within your INSERTs, too, e.g.

  ('INSERT INTO tduser.Source_Emp_Table
(1,''joe'');'),
Enthusiast

Re: TPT script : syntax error at "VARCHAR";

I did the corrections but still the same error.

Thanks

Junior Contributor

Re: TPT script : syntax error at "VARCHAR";

It's UserPassword instead of Password.

Enthusiast

Re: TPT script : syntax error at "VARCHAR";

It is working. 

Thank you so much.