Pyinstaller with scipy.signal ImportError: DLL load failed - dll

Using PyInstaller 3.3, Python 3.4 I have compiled a program that needs to use the scipy.signal.periodogram() function, and it's causing the .exe to crash the instant it starts up. I've been searching all over stack overflow and other sites for a way to try to include the right DLLs, but to no avail. Please help me figure out if I need to include some specific DLLs in my .spec file or include some other hidden-imports!
Here is my PyInstaller command:
pyinstaller --noupx --hidden-import=tkinter --hidden-import=scipy --hidden-import=matplotlib constantG_constantHz.py
and here is the corresponding error from the command prompt after starting my exe:
Traceback (most recent call last):
File "constantG_constantHz.py", line 16, in <module>
File "C:\Users\esandberg\AppData\Local\Continuum\anaconda3\envs\py34\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\signal\__init__.py", line 304, in <module>
File "C:\Users\esandberg\AppData\Local\Continuum\anaconda3\envs\py34\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\signal\bsplines.py", line 12, in <module>
File "C:\Users\esandberg\AppData\Local\Continuum\anaconda3\envs\py34\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\special\__init__.py", line 640, in <module>
File "C:\Users\esandberg\AppData\Local\Continuum\anaconda3\envs\py34\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
ImportError: DLL load failed: The specified module could not be found.
[1272] Failed to execute script constantG_constantHz
And here is my .spec file:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['constantG_constantHz.py'],
pathex=['C:\\Users\\esandberg\\Desktop'],
binaries=[],
datas=[],
hiddenimports=['tkinter', 'scipy', 'matplotlib'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='constantG_constantHz',
debug=False,
strip=False,
upx=False,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='constantG_constantHz')

I have tried the methods before and it did not solve my problem. Finally, I solved it by this way.
When compiling the executables (exe) files in the command (cmd) window, my command is written as follows:
pyinstaller -F --paths C:\Users\Desktop\Code\2018.04.23\venv\Lib\site-packages\scipy\extra-dll pdf_num_detect.py
Hope this small tricks can help you all.

The issue was lots of missing dlls. PyInstaller has issues finding most of Scipy's dlls, so I had to specify a heck of a lot of them. I'll post my .spec file below in case anyone else wants to see / copy which dlls I had to bring in. Some things might not have been necessary, but it works so I'm not going to mess with it. Make sure that you are pointing to the correct directory for your system though - it won't be the same as mine, so don't just copy/paste :)
# -*- mode: python -*-
block_cipher = None
mkl_dlls = [('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_avx.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_avx2.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_avx512.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_core.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_def.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_intel_thread.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_mc.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_mc3.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_rt.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_sequential.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_tbb_thread.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_avx.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_avx2.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_avx512.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_cmpt.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_def.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_mc.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_mc2.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\mkl_vml_mc3.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\numpy\\core\\libiomp5md.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libansari.R6EA3HQP5KZ6TAXU4Y4ZVTRPT7UVA53Z.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libbanded5x.WZIUXDGQF4EXGFMCS2HGNLMUYHBRQUUF.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libbispeu.5N2XSD7URZS4WTOSLTOG4DDMA4HGB46U.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libblkdta00.LJOUU3SAGG47ULUG76DDJIAQ3SJZPC3K.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libchkder.6HLXPVTQJEGRZGLI5DFRMNW3SS76BHP6.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libcobyla2.JEGTSUUFJ7DFXWZN5PAYZTTLBDATC4WD.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdcosqb.K4J3XBR4PEETMRHZICUWW4LXG5UONZ34.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdcosqb.QRGA36MB6CFHWLQN6ETWARR4M4E6P3C2.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdcsrch.I2AOPDCXAPDRFNPWY55H5UE7XZSU5CVN.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdet.6GZFPKJ7BNDGVB7LFKBA6Z6U3VHYDRNY.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdfft_sub.U4F67CR5EXPQGGTDKQXO4Q644NUQ3EQ6.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdfitpack.2Y4SCYSHMU4DXJIF3BLBGBCDGFPGNXB5.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdgamln.VNYWJHKRIIPRROV3CUDLW473BST7CGWP.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdop853.6TJTQZW3I3Q3QIDQHEOBEZKJ3NYRXI4B.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libdqag.62LLADARAQRQLGIRWJXRQ7DKBCHYVFM7.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libd_odr.QDWMEQYLAGCKZEYTV3WWPRP5CLZ3G4WQ.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\liblbfgsb.T5BNFBSTQTIIF6ISVJFBJAWBU7OKBGPL.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libmvndst.LY22DRRGFBEFI34ZKZWNM3LQKXRWY2M2.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libnnls.5LTQOLAJY5PFO6MOEXWNMRWVFRWHYHKT.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libopenblas.BNVRK7633HSX7YVO2TADGR4A5KEKXJAW.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libslsqp_op.NNY57ZXZ43A4RH3YWFA7BKHP5PC2K3I5.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libspecfun.PT6DS3HUOGYNSXUO4OUKK6ATA7B5KP2K.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libSTOPTEST.ULMD4CATLBJOTE3KABHKOG56HAQIX5F6.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libvode.XW5WVKKTDJOOC5XUHCVKZ4AYR2TXGRF4.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libwrap_dum.G2F2CGV7KURTEF5GFBNVGKVM6FV5JBCV.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\libwrap_dum.XGSO5H22J6VUAWYNCLIXCV2EJ754HJMI.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\lib_arpack-.BSIUF6E2Z6VKRD6SNEY37WASTOLCKTAP.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\lib_blas_su.C3OGRVVRISPWLMOVEY4KXYSPKJEZ7QG6.gfortran-win_amd64.dll', '.'),
('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\envs\\py34\\Lib\\site-packages\\scipy\\extra-dll\\lib_test_fo.JF5HTWMUPBXWGAYEBVEJU3OZAHTSVKCT.gfortran-win_amd64.dll', '.')]
a = Analysis(['constantG_constantHz.py'],
pathex=['C:\\Users\\esandberg\\Desktop'],
binaries=mkl_dlls,
datas=[('C:\\Users\\erik\\AppData\\Local\\Continuum\\anaconda3\\Lib\\site-packages\\scipy\\special\\_ufuncs_cxx.cp36-win_amd64.pyd','.'),],
hiddenimports=['scipy._lib.messagestream', 'numpy', 'tkinter', 'scipy', 'matplotlib', 'fixtk', 'scipy.signal', 'scipy.signal.bsplines', 'scipy.special', 'scipy.special._ufuncs_cxx',
'scipy.linalg.cython_blas',
'scipy.linalg.cython_lapack',
'scipy.integrate',
'scipy.integrate.quadrature',
'scipy.integrate.odepack',
'scipy.integrate._odepack',
'scipy.integrate.quadpack',
'scipy.integrate._quadpack',
'scipy.integrate._ode',
'scipy.integrate.vode',
'scipy.integrate._dop', 'scipy._lib', 'scipy._build_utils','scipy.__config__',
'scipy.integrate.lsoda', 'scipy.cluster', 'scipy.constants','scipy.fftpack','scipy.interpolate','scipy.io','scipy.linalg','scipy.misc','scipy.ndimage','scipy.odr','scipy.optimize','scipy.setup','scipy.sparse','scipy.spatial','scipy.special','scipy.stats','scipy.version'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='constantG_constantHz',
debug=False,
strip=False,
upx=False,
runtime_tmpdir=None,
console=True )

Related

SQL Server 2017: IID_IColumnsInfo Bulk Insert Error

I've used the following script in the past without issue, so I'm not sure why it's causing me issues now.
Msg 7301, Level 16, State 2, Line 8
Cannot obtain the required interface ("IID_IColumnsInfo") from OLE DB provider "BULK" for linked server "(null)".
My code:
(
FORMAT = 'CSV',
FIELDQUOTE = '"',
FIRSTROW = 2,
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = '\n', --Use to shift the control to next row
TABLOCK
)
screenshot of setup and error
File Size: 112 MB
Rows: 322,190
Microsoft Server Management Studio v17.4
Can you try
ROWTERMINATOR = '\r\n'
or
ROWTERMINATOR = '0x0a'
Since you're using a CSV file the row terminator may be a line feed (LF), which 0x0a in the hexadecimal notation for. The example below accounts accounts for this type of row terminator.
BULK INSERT dbo.YourTable
FROM 'C:\FilePath\DataFile.csv'
WITH (
FORMAT = 'CSV',
FIRSTROW = 2,
FIELDQUOTE = '"',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '0x0a',
TABLOCK
);
try removing the FORMAT= 'CSV' line
your file may not be RFC 4180 compliant.
this has worked for me and this error
Make sure there is not a byte-order mark (BOM) at the beginning of the file, which will cause this to fail with this error.

Correct use of case (error with then)

Can anyone understand why I am getting this error for the below line of code? Please let me know!
Msg 156, Level 15, State 1, Line 52
Incorrect syntax near the keyword 'then'.
Slight modification of this post: How do I add hyphens to this line of code? For instance the format I am getting is PTEE032981. How do I get PT-EE-032981?
Please let me know if this can be answered in this post.
case when (MU.Number like '%co-load%' then SUBSTRING(UPPER(REPLACE(Mu.Number,'-','')) ,
PATINDEX('%[nw]t[A-Z][A-Z][0-9][0-9][0-9][0-9][0-9]%',UPPER(REPLACE(Mu.Number,'-',''))),10))
else ME.MovementReference end as [MovementReference],
No need for a starting parenthesis:
case
when MU.Number like '%co-load%'
then SUBSTRING(UPPER(REPLACE(Mu.Number, '-', '')), PATINDEX('%[nw]t[A-Z][A-Z][0-9][0-9][0-9][0-9][0-9]%', UPPER(REPLACE(Mu.Number, '-', ''))), 10)
else ME.MovementReference
end as [MovementReference],

Jade: Ignore spaces in mixin arguments to align code?

I'd like to align elements of my code for easier reading, but ignore the extra spaces on compile. For example, I'd like to convert:
+navOption('biography', 'Biography and Timeline')
+navOption('books-articles', 'Books and Articles about Paul Rand')
+navOption('events-exhibits', 'Events and Exhibits')
+navOption('videos-interviews', 'Videos and Interview')
+navOption('portraits', 'Portraits')
+navOption('rand-house', 'The Rand House')
+navOption('his-inspirations', 'Inspirations')
+navOption('personal-items', 'Personal Items')
+navOption('death', 'Death')
to:
+navOption('biography ', 'Biography and Timeline ')
+navOption('books-articles ', 'Books and Articles about Paul Rand')
+navOption('events-exhibits ', 'Events and Exhibits ')
+navOption('videos-interviews', 'Videos and Interview ')
+navOption('portraits ', 'Portraits ')
+navOption('rand-house ', 'The Rand House ')
+navOption('his-inspirations ', 'Inspirations ')
+navOption('personal-items ', 'Personal Items ')
+navOption('death ', 'Death ')
Is there a way to ignore the extra spaces created between the last letter/number/symbol of the argument and the closing apostrophe?

CSV file splitting my row data into separate rows

I have a a query that creates a CSV file and then emails it out to a user but the CSV file is not in the correct format. For some reason when the CSV file is opened it is separating some of my rows into 2 separate rows for some unknown reason! The spliting of the rows seems to be getting done at random because some rows are split while other rows remain intact. This is a difficult scenario to explain so below shows the query I have wrote for creating the CSV file and emailing it out to the user and then the results of the CSV file!
EXEC msdb.dbo.sp_send_dbmail
#profile_name='TestProfile',
#recipients='Test#gmail.com',
#subject='Test message',
#body='This is a test.',
#query = 'Select *
FROM (
SELECT
replace(LEFT(convert(NVARCHAR, getdate(), 106),6) + ''-'' + RIGHT(year(convert(NVARCHAR, getdate(), 106)),2), '' '', ''-'') as [Date],
FirstName, Surname,TestTime as TestTime , Percentage as Percentage, Score as Score
FROM TestDatabase.dbo.TestingTable
) as s
PIVOT
(
SUM(Score)
FOR [TestTime] IN ([00:00],[00:30],[01:00],[01:30],[02:00],[02:30],[03:00],[03:30],[04:00],[04:30],[05:00],[05:30],[06:00],[06:30],[07:00],[07:30],[08:00],[08:30],[09:00],[09:30],[10:00],[10:30],[11:00],[11:30],[12:00],[12:30],[13:00],[13:30],[14:00],[14:30],[15:00],[15:30],[16:00],[16:30],[17:00],[17:30],[18:00],[18:30],[19:00],[19:30],[20:00],[20:30],[21:00],[21:30],[22:00],[22:30],[23:00],[23:30])
) Results
',
#query_result_separator = ' ',
#query_result_header = 1,
#exclude_query_output = 1,
#append_query_error = 1,
#attach_query_result_as_file = 1,
#query_attachment_filename = 'test.csv',
#query_result_no_padding = 1
Output
When in fact it should look like this:
Bottom image is the correct format and the top row goes from 00.00 to 23.30 as intended!
By default, sp_send_dbmail inserts a line break after 256 characters on any given line. You can modify this by specifying the #query_result_width parameter when calling the stored procedure. Maximum value is 32767.
Aside: If this is supposed to be a CSV file, why is #query_result_separator = ' ' and not #query_result_separator = ','?

Cast Iron 6.1: Put File only outputs one line from an SQL query that has multiple results

My orchestration is triggered by a HTTP message and then the following SQL query is executed (field and table names have been changed for security reasons):
SELECT Distinct '900' AS 'Type',
(DeTeamPATH.PKEY) AS 'Personal_ID',
ISNULL(CONVERT(nVarChar(30), DeTeam.TENTLOGON, 121), ' ')
AS 'TLG',
ISNULL(CONVERT(nVarChar(30), DeTeam.CIV_NAMES01, 121), ' ')
AS 'First name',
ISNULL(CONVERT(nVarChar(30), DeTeam.CIV_NAMES02, 121), ' ')
AS 'Middle name',
ISNULL(CONVERT(nVarChar(30), DeTeam.SURNAME, 121), ' ')
AS 'Surname',
ISNULL(CONVERT(nVarChar(30), UsTeam.STREET01, 121), ' ')
AS 'Corporation',
ISNULL(CONVERT(nVarChar(30), DeTeam.GENDER, 121), ' ')
AS 'Gender',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_ADDRESS01 + ', '
+ DeTeam.LOCAL_ADDRESS03, 121), ' ')
AS 'Street Address',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_ADDRESS04, 121), ' ')
AS 'Suburb',
ISNULL(CONVERT(nVarChar(30), DeTeam.COUNTRY, 121), ' ')
AS 'Country',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_POST, 121), ' ')
AS 'Postcode',
ISNULL(CONVERT(nVarChar(30), DeTeam.BIRTHDATE, 121), ' ')
AS 'Date of Birth',
ISNULL(CONVERT(nVarChar(30), DeTeam.EMAIL, 121), ' ')
AS 'Email address',
ISNULL(CONVERT(nVarChar(30), DeTeam.DOME_PHONE, 121), ' ')
AS 'Primary phone',
DeTeam.ICEPHONE AS 'Phone_2',
ISNULL(CONVERT(nVarChar(30), DeTeamPATH.Person_START, 121), ' ')
AS 'Session_start',
ISNULL(CONVERT(nVarChar(30), DeTeamPATH.Person_FINISH, 121), ' ')
AS 'Session_expiry'
FROM DeTeam
INNER JOIN DeTeamPATH
ON DeTeamPATH.PKEY = DeTeam.DeTeamKEY
INNER JOIN Fort
ON DeTeamPATH.ROUTEID = Fort.ROUTEID OR DeTeamPATH.STREAM=Fort.ROUTEID
INNER JOIN US_DE_SEM
ON US_DE_SEM.US_DE_SEMER = DeTeamPATH.SEM_START
OR US_DE_SEM.US_DE_SEMER = DeTeamPATH.SEM_FINISH
INNER JOIN UsTeam
ON UsTeam.TeamUS = DeTeamPATH.TeamUS
where DeTeam.TENTLOGON != ' ' and DeTeamPATH.PKEY != ' ' and
DeTeam.CIV_NAMES01 != ' ' and DeTeam.CIV_NAMES02 != ' ' and
DeTeam.SURNAME != ' ' and UsTeam.STREET01 != ' ' and
DeTeam.GENDER != ' ' and DeTeam.COUNTRY != ' ' and
DeTeam.TENTLOGON != ' ' and DeTeam.LOCAL_POST != ' ' and
DeTeam.BIRTHDATE != ' ' and DeTeam.EMAIL != ' ' and
DeTeam.DOME_PHONE != ' ' and DeTeamPATH.Person_START != ' ';
It then writes the data to a flat file (a text file) and puts it in a directory on my FTP server. However, the text file only has one line - that being one result from the SQL SELECT query. And when I run the query directly on the server, I get about six results. I want the file to contain all six results but I expect more results to come through that SELECT statement in the near future so I don't want to set a limit on how many results the query will retrieve as I want it to get all results.
Can someone please help me or tell me what I'm doing wrong? Let me know if you need any further details and I'll edit this question to include them.
I have the answer to my own question!
In the Write Flat File activity, the rows in the From Orchestration section of the Map Inputs tab were recurring whereas the ones in the To Activity section where not. So, to fix this, I had to edit my Flat File Schema, and change the properties for data so that the occurrence was marked as Unbounded. (It had a Range of 1 previously so only 1 row would ever get put in the text file.) I also had to remove all previous input mappings in my Write Flat File activity and map the row in From Orchestration To the data in To Activity.
If I may say so, I have put this answer up here in case anyone in future has the same issue. I've found that finding people on the Internet with experience in the use of WebSphere Cast Iron is difficult... so I'll be happy if this helps anyone!
#DaleM Thank you for your comments and for trying to help!