User Guide > Scripting > Using DJImport/DJExport Object Connection Wizard > Creating New DJImport or DJExport Object
Was this helpful?
Creating New DJImport or DJExport Object
To create a new DJImport or DJExport object:
1. In the EZScript Editor, from the EZScript menu, select DJImport/DJExport Object Connection Wizard.
The wizard opens and displays the DJImport/DJExport Object Declaration page. The Create a New DJImport or DJExport Object option is preselected for you.
2. Select one of the following option:
DJImport - To create a new DJImport object.
DJExport - To create a new DJExport object.
3. In Enter name of new DJImport/DJExport object, type a new name for the object that you are going to import or export.
If you open this wizard from a map or a process file, then the Make this DJImport/DJExport variable global option is displayed. This option is preselected for you.
4. Select Include ConnectString declaration in the final expression to include the variable declaration in the final expression. An example is displayed in the text box.
If you have selected Make this DJImport/DJExport variable global, then Include ConnectString declaration in final expression is disabled.
5. Click Next.
The DJImport/DJExport Object Connection window is displayed.
6. Select one of the following options to specify how you want to connect to the object:
Build a connect string - Construct a new connect string. Click Build. The Source Connection window is displayed. Specify the information that is required to setup the source connection and click OK.
Use an existing connect string - With this option, you can browse to select a source connection (.src.dataset) or target connection (.trg.dataset) file to use. You can select a source/target connection file that you previously created OR you can select from a list of connection files in the Connections directory. If you originally chose the default directories for the product installation, the connections are in the Connections directory.
Use the connect string from the map source - In this option, the default is to include object declaration in the final expression (source side). Clear the option if you do not want to include the object declaration.
Use the connect string from the map target - In this option, the default is to include object declaration in the final expression (target side). Clear the option if you do not want to include the object declaration.
The third and fourth options are not displayed when you open this wizard from the EZscript file.
7. Click Next.
The SQL Statement window is displayed.
8. Select one of the following to specify whether you want to use SQL statement to connect to the DJImport/DJExport object:
Do not include a SQL statement - This is the only selection if your connection is not a SQL connector type.
Use SQL statement from the built connect string - Builds a SQL statement from the connect string already built or selected.
Note:  When ODBC3.5 connection is set using query statement, then this option is enabled.
Build a SQL statement using the query builder - Click Build to open the SQL Query Builder Wizard.
Use the SQL statement from the map source connection - Builds a SQL statement using the current source connect string.
Note:  If you select any connect string other than containing SQL statement, then option 1 must be selected by default and other options are disabled. If you select connect string with a SQL statement, then all the options are enabled. If you select Build SQL statement using query builder, type-in a new SQL statement.
9. Click Next.
The DJImport/DJExport Expression Summary window is displayed.
10. Review the expression and click Finish.
11. Click OK.
The new DJImport/DJExport query statement is displayed in the EZscript Editor.
The following is a DJExport statement example, with the djexample object. In step 8, the connect string was specified to be used from the source file in the transformation. The default source properties for ASCII (Delimited) are included in the statement:
Set djexample = New DJExport "ASCII (Delimited)"
djexample.ConnectString = "CodePage=ANSI;RecordSeparator=CR-LF;FieldSeparator=,;FieldStartDelimiter=";FieldEndDelimiter=";Header=False;FieldDelimitStyle=all;StripLeadingBlanks=True;StripTrailingBlanks=True;TransliterationIn=;TransliterationOut=;MaxDataLen=0"
Note:  For more information about ASCII (Delimited) connector see ASCII (Delimited).
In the following example the djexample object uses an existing Actian Warehouse connection string:
Set djexample = New DJExport "Actian Warehouse"
djexample.ConnectString = "Database=dceng;UserId=user01;Password=""\xxxx22222AAAAkk"";Table=user01.sample_table;dsntype='User & System';drivercompletion=complete;modifydopts=True;driveropts='DSN=dceng;SERVER=@av-2kmhz3si14f0.avd.actiandatacloud.com,tcp_ip,27832;DATABASE=db;SERVERTYPE=INGRES;DATEALIAS=ansidate';txnisolation=serializable;encoding=OEM;wherestmt=;systables=False;views=True;synonyms=False;cursortype='forward only';identifierquotes=Default;maxdatalen=2147483647;StripBlanks=False"
Tip...  Ensure that your Actian Warehouse is running when you try to connect with it or else you will get a connection error. You can choose to ignore the connection error and finish building the connection string. When the connection is used later it will work. For more information about Actian Warehouse connector, see Actian Warehouse.
Last modified date: 12/03/2024