简体   繁体   English

Informatica:将图像数据类型下载到磁盘

[英]Informatica: downloading image data type to disk

I have a table in sql server that contain two columns 我在sql server中有一个包含两列的表

Filename char datatype
File image datatype

Requirement is to download all the data to the disk , is it possible using informatica and if yes how? 要求将所有数据下载到磁盘上,是否可以使用informatica?

For example, if there are two rows in the table: 例如,如果表中有两行:

sal_1.pdf, <<image data>>
sal_2.pdf, <<image data>>

and it needs to be pushed to disk D:/file_dump directory then D:/file_dump should have two files with the names sal_1.pdf and sal2.pdf . 并且需要将其推入磁盘D:/file_dump目录,然后D:/file_dump应该有两个文件,名称分别为sal_1.pdfsal2.pdf

You could use T-SQL and bcp ( link 1 , link 2 ) like this: 您可以像这样使用T-SQLbcp链接1链接2 ):

1) Write a T-SQL script (using SQL Server Management Studio) to generate all shell/bcp commands 1)编写一个T-SQL脚本(使用SQL Server Management Studio)以生成所有shell / bcp命令

SET NOCOUNT ON;
SELECT  'bcp "SELECT y.File FROM Schema.Table y WHERE y.IDColumn=' 
    + CONVERT(VARCHAR(11),x.IDColumn) 
    + ' queryout "D:\file_dump\' 
    + x.FileName 
    + '" -N -S SqlServerInstance -T -d "DatabaseName"'
FROM Table x

Press Ctrl+T (Text results) Ctrl+T (文本结果)

Press F5 (Execute) F5 (执行)

Press F6 (It activates the Results (text) panel F6 (它将激活“ Results (text)面板

Press Ctrl+A (Select All) Ctrl+A (全选)

Press Ctrl+C (Copy) Ctrl+C (复制)

2) Create a new text file ( Win Key + Notepad + Enter ), Ctrl+V (Paste), Save As ... -> dump_pdf.bat 2)创建一个新的文本文件( Win Key + Notepad + Enter ), Ctrl+V (粘贴), Save As ... > dump_pdf.bat

3) Execute dump_pdf.bat file 3)执行dump_pdf.bat文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM