Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Friday, March 23, 2012

I can't import XML into SQL with Bulk Load

Hi,
I can′t import a XML file into SQL Server with a XDR mapping schema
specifying relationships.
The Error is:
"Schema: missing mapping foreign-ralation on BoletoConta
Code 80004005
Source: schema mapping "
What is wrong?
***********************************
This is a complete script.
CREATE TABLE Boleto (
IdBoleto int NOT NULL ,
Numero varchar (50) ,
TipoBoletoId varchar (50) ,
) ON PRIMARY
GO
CREATE TABLE dbo.BoletoConta (
ContaId int NULL ,
Referencia varchar (50) ,
Valor varchar (50) ,
)
GO
This is the mapping schema file (XDR).
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<ElementType name="Id" content="textonly" />
<ElementType name="Numero" content="textonly" />
<ElementType name="TipoBoletoId" content="textonly" />
<ElementType name="Root" sql:is-constant="1">
<element type="Boleto" />
</ElementType>
<ElementType name="Boleto" sql:relation="Boleto">
<element type="Id" sql:field="IdBoleto" />
<element type="Numero" />
<element type="TipoBoletoId" />
<element type="BoletoConta">
<sql:relationship key-relation="Boleto" key="IdBoleto"
foreing-relation="BoletoConta" foreing-key="IdBoleto" />
</element>
</ElementType>
<ElementType name="BoletoConta" sql:relation="BoletoConta">
<AttributeType name="ContaId" />
<AttributeType name="Referencia" />
<AttributeType name="Valor" />
<attribute type="ContaId" sql:field="ContaId" />
<attribute type="Referencia" sql:field="Referencia" />
<attribute type="Valor" sql:field="Valor" />
</ElementType>
</Schema>
This is a listing of the XML document specified.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Root>
<Boleto Id="369" Numero="0000000000369" TipoBoletoId="5" >
<BoletoConta ContaId="5" Referencia="01/07/1990" Valor="0.08" />
</Boleto>
<Boleto Id="89627" Numero="0000000089627" TipoBoletoId="5" >
<BoletoConta ContaId="14" Referencia="01/11/2001" Valor="40.55" />
<BoletoConta ContaId="15" Referencia="01/11/2001" Valor="203.10" />
<BoletoConta ContaId="41" Referencia="01/11/2001" Valor="4112.37" />
<BoletoConta ContaId="42" Referencia="01/11/2001" Valor="0.59" />
</Boleto>
<Boleto Id="89628" Numero="0000000089628" TipoBoletoId="5" >
<BoletoConta ContaId="14" Referencia="01/12/2001" Valor="219.56" />
<BoletoConta ContaId="15" Referencia="01/12/2001" Valor="202.80" />
<BoletoConta ContaId="41" Referencia="01/12/2001" Valor="3830.85" />
<BoletoConta ContaId="42" Referencia="01/12/2001" Valor="6.20" />
</Boleto>
</Root>
This is a script to import to SQL-SERVER 2000
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data
source=(local);database=mydb;uid=sa;pwd=
xxx"
objBL.ErrorLogFile = "c:\inetpub\wwwroot\xml\error.log"
objBL.Transaction=true
objBL.Execute "c:\mapa.xml", "c:\dados.xml"
Set objBL = Nothing
Eduardo MaggiI' sorry.
I have found the problem, the sintax "foreing" was wrong the correct is
"foreign".
Don't consider this message.
Eduardo Maggi
"EduardoMaggi" wrote:

> Hi,
> I can′t import a XML file into SQL Server with a XDR mapping schema
> specifying relationships.
> The Error is:
> "Schema: missing mapping foreign-ralation on BoletoConta
> Code 80004005
> Source: schema mapping "
> What is wrong?
> ***********************************
> This is a complete script.
> CREATE TABLE Boleto (
> IdBoleto int NOT NULL ,
> Numero varchar (50) ,
> TipoBoletoId varchar (50) ,
> ) ON PRIMARY
> GO
> CREATE TABLE dbo.BoletoConta (
> ContaId int NULL ,
> Referencia varchar (50) ,
> Valor varchar (50) ,
> )
> GO
> This is the mapping schema file (XDR).
> <?xml version="1.0" ?>
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
> xmlns:sql="urn:schemas-microsoft-com:xml-sql">
> <ElementType name="Id" content="textonly" />
> <ElementType name="Numero" content="textonly" />
> <ElementType name="TipoBoletoId" content="textonly" />
> <ElementType name="Root" sql:is-constant="1">
> <element type="Boleto" />
> </ElementType>
> <ElementType name="Boleto" sql:relation="Boleto">
> <element type="Id" sql:field="IdBoleto" />
> <element type="Numero" />
> <element type="TipoBoletoId" />
> <element type="BoletoConta">
> <sql:relationship key-relation="Boleto" key="IdBoleto"
> foreing-relation="BoletoConta" foreing-key="IdBoleto" />
> </element>
> </ElementType>
> <ElementType name="BoletoConta" sql:relation="BoletoConta">
> <AttributeType name="ContaId" />
> <AttributeType name="Referencia" />
> <AttributeType name="Valor" />
> <attribute type="ContaId" sql:field="ContaId" />
> <attribute type="Referencia" sql:field="Referencia" />
> <attribute type="Valor" sql:field="Valor" />
> </ElementType>
> </Schema>
>
> This is a listing of the XML document specified.
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <Root>
> <Boleto Id="369" Numero="0000000000369" TipoBoletoId="5" >
> <BoletoConta ContaId="5" Referencia="01/07/1990" Valor="0.08" />
> </Boleto>
> <Boleto Id="89627" Numero="0000000089627" TipoBoletoId="5" >
> <BoletoConta ContaId="14" Referencia="01/11/2001" Valor="40.55" />
> <BoletoConta ContaId="15" Referencia="01/11/2001" Valor="203.10" />
> <BoletoConta ContaId="41" Referencia="01/11/2001" Valor="4112.37" />
> <BoletoConta ContaId="42" Referencia="01/11/2001" Valor="0.59" />
> </Boleto>
> <Boleto Id="89628" Numero="0000000089628" TipoBoletoId="5" >
> <BoletoConta ContaId="14" Referencia="01/12/2001" Valor="219.56" />
> <BoletoConta ContaId="15" Referencia="01/12/2001" Valor="202.80" />
> <BoletoConta ContaId="41" Referencia="01/12/2001" Valor="3830.85" />
> <BoletoConta ContaId="42" Referencia="01/12/2001" Valor="6.20" />
> </Boleto>
> </Root>
> This is a script to import to SQL-SERVER 2000
> Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
> objBL.ConnectionString = "provider=SQLOLEDB.1;data
> source=(local);database=mydb;uid=sa;pwd=
xxx"
> objBL.ErrorLogFile = "c:\inetpub\wwwroot\xml\error.log"
> objBL.Transaction=true
> objBL.Execute "c:\mapa.xml", "c:\dados.xml"
> Set objBL = Nothing
>
>
>
> --
> Eduardo Maggi

I can't import XML into SQL with Bulk Load

Hi,
I can′t import a XML file into SQL Server with a XDR mapping schema
specifying relationships.
The Error is:
"Schema: missing mapping foreign-ralation on BoletoConta
Code 80004005
Source: schema mapping "
What is wrong?
***********************************
This is a complete script.
CREATE TABLE Boleto (
IdBoleto int NOT NULL ,
Numero varchar (50) ,
TipoBoletoId varchar (50) ,
) ON PRIMARY
GO
CREATE TABLE dbo.BoletoConta (
ContaId int NULL ,
Referencia varchar (50) ,
Valor varchar (50) ,
)
GO
This is the mapping schema file (XDR).
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<ElementType name="Id" content="textonly" />
<ElementType name="Numero" content="textonly" />
<ElementType name="TipoBoletoId" content="textonly" />
<ElementType name="Root" sql:is-constant="1">
<element type="Boleto" />
</ElementType>
<ElementType name="Boleto" sql:relation="Boleto">
<element type="Id" sql:field="IdBoleto" />
<element type="Numero" />
<element type="TipoBoletoId" />
<element type="BoletoConta">
<sql:relationship key-relation="Boleto" key="IdBoleto"
foreing-relation="BoletoConta" foreing-key="IdBoleto" />
</element>
</ElementType>
<ElementType name="BoletoConta" sql:relation="BoletoConta">
<AttributeType name="ContaId" />
<AttributeType name="Referencia" />
<AttributeType name="Valor" />
<attribute type="ContaId" sql:field="ContaId" />
<attribute type="Referencia" sql:field="Referencia" />
<attribute type="Valor" sql:field="Valor" />
</ElementType>
</Schema>
This is a listing of the XML document specified.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Root>
<Boleto Id="369" Numero="0000000000369" TipoBoletoId="5" >
<BoletoConta ContaId="5" Referencia="01/07/1990" Valor="0.08" />
</Boleto>
<Boleto Id="89627" Numero="0000000089627" TipoBoletoId="5" >
<BoletoConta ContaId="14" Referencia="01/11/2001" Valor="40.55" />
<BoletoConta ContaId="15" Referencia="01/11/2001" Valor="203.10" />
<BoletoConta ContaId="41" Referencia="01/11/2001" Valor="4112.37" />
<BoletoConta ContaId="42" Referencia="01/11/2001" Valor="0.59" />
</Boleto>
<Boleto Id="89628" Numero="0000000089628" TipoBoletoId="5" >
<BoletoConta ContaId="14" Referencia="01/12/2001" Valor="219.56" />
<BoletoConta ContaId="15" Referencia="01/12/2001" Valor="202.80" />
<BoletoConta ContaId="41" Referencia="01/12/2001" Valor="3830.85" />
<BoletoConta ContaId="42" Referencia="01/12/2001" Valor="6.20" />
</Boleto>
</Root>
This is a script to import to SQL-SERVER 2000
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data
source=(local);database=mydb;uid=sa;pwd=xxx"
objBL.ErrorLogFile = "c:\inetpub\wwwroot\xml\error.log"
objBL.Transaction=true
objBL.Execute "c:\mapa.xml", "c:\dados.xml"
Set objBL = Nothing
Eduardo Maggi
I' sorry.
I have found the problem, the sintax "foreing" was wrong the correct is
"foreign".
Don't consider this message.
Eduardo Maggi
"EduardoMaggi" wrote:

> Hi,
> I can′t import a XML file into SQL Server with a XDR mapping schema
> specifying relationships.
> The Error is:
> "Schema: missing mapping foreign-ralation on BoletoConta
> Code 80004005
> Source: schema mapping "
> What is wrong?
> ***********************************
> This is a complete script.
> CREATE TABLE Boleto (
> IdBoleto int NOT NULL ,
> Numero varchar (50) ,
> TipoBoletoId varchar (50) ,
> ) ON PRIMARY
> GO
> CREATE TABLE dbo.BoletoConta (
> ContaId int NULL ,
> Referencia varchar (50) ,
> Valor varchar (50) ,
> )
> GO
> This is the mapping schema file (XDR).
> <?xml version="1.0" ?>
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
> xmlns:sql="urn:schemas-microsoft-com:xml-sql">
> <ElementType name="Id" content="textonly" />
> <ElementType name="Numero" content="textonly" />
> <ElementType name="TipoBoletoId" content="textonly" />
> <ElementType name="Root" sql:is-constant="1">
> <element type="Boleto" />
> </ElementType>
> <ElementType name="Boleto" sql:relation="Boleto">
> <element type="Id" sql:field="IdBoleto" />
> <element type="Numero" />
> <element type="TipoBoletoId" />
> <element type="BoletoConta">
> <sql:relationship key-relation="Boleto" key="IdBoleto"
> foreing-relation="BoletoConta" foreing-key="IdBoleto" />
> </element>
> </ElementType>
> <ElementType name="BoletoConta" sql:relation="BoletoConta">
> <AttributeType name="ContaId" />
> <AttributeType name="Referencia" />
> <AttributeType name="Valor" />
> <attribute type="ContaId" sql:field="ContaId" />
> <attribute type="Referencia" sql:field="Referencia" />
> <attribute type="Valor" sql:field="Valor" />
> </ElementType>
> </Schema>
>
> This is a listing of the XML document specified.
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <Root>
> <Boleto Id="369" Numero="0000000000369" TipoBoletoId="5" >
> <BoletoConta ContaId="5" Referencia="01/07/1990" Valor="0.08" />
> </Boleto>
> <Boleto Id="89627" Numero="0000000089627" TipoBoletoId="5" >
> <BoletoConta ContaId="14" Referencia="01/11/2001" Valor="40.55" />
> <BoletoConta ContaId="15" Referencia="01/11/2001" Valor="203.10" />
> <BoletoConta ContaId="41" Referencia="01/11/2001" Valor="4112.37" />
> <BoletoConta ContaId="42" Referencia="01/11/2001" Valor="0.59" />
> </Boleto>
> <Boleto Id="89628" Numero="0000000089628" TipoBoletoId="5" >
> <BoletoConta ContaId="14" Referencia="01/12/2001" Valor="219.56" />
> <BoletoConta ContaId="15" Referencia="01/12/2001" Valor="202.80" />
> <BoletoConta ContaId="41" Referencia="01/12/2001" Valor="3830.85" />
> <BoletoConta ContaId="42" Referencia="01/12/2001" Valor="6.20" />
> </Boleto>
> </Root>
> This is a script to import to SQL-SERVER 2000
> Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
> objBL.ConnectionString = "provider=SQLOLEDB.1;data
> source=(local);database=mydb;uid=sa;pwd=xxx"
> objBL.ErrorLogFile = "c:\inetpub\wwwroot\xml\error.log"
> objBL.Transaction=true
> objBL.Execute "c:\mapa.xml", "c:\dados.xml"
> Set objBL = Nothing
>
>
>
> --
> Eduardo Maggi

Friday, March 9, 2012

I am not able to load two different images dynamically in an Image control

HI,

Base on pagenumber, i need to display a particular image in first page and another image in next page.

there are two images and has to be displayed alternatively in the pages.

but, it is displaying only one image everytime.

I am using Exteranl and URL based concept and using parameters to pass the values from the front end to the report

One more thing I did was, I place two image controls and passing the URL through two parameters having the URL as the value.

but still the both the image controls display only one image.

it should be possible to use expression to show image conditionally.

set image value property to expression, for example, for URL image:

=iif(<Some condition>,
"http://localhost/Reports/images/48folderopen.jpg",
"http://localhost/Reports/images/16prop.gif")

|||

Hi,

I am using an expression.

One more thing I am getting the path thru the Parameters.

I have two different Paths one for customer logo and another is company logo

and i have used the parameters in iif conditon.

example: iif((Globals!PageNumber) Mod 2 = 0,Parameters!RgLogoPath.Value,Parameters!CustLogoPath.Value)

one more thing i tried is

place two image controls in Page Header and in the Value i used expression and for both the images i gave Parameters!RgLogoPath.Value and Parameters!CustLogoPath.Value respectively. when i saw the preview , only one image was displayed in both image controls

|||Is this happening in page headers only? Does it work differently if put in the report body?

I am not able to load two different images dynamically in an Image control

HI,

Base on pagenumber, i need to display a particular image in first page and another image in next page.

there are two images and has to be displayed alternatively in the pages.

but, it is displaying only one image everytime.

I am using Exteranl and URL based concept and using parameters to pass the values from the front end to the report

One more thing I did was, I place two image controls and passing the URL through two parameters having the URL as the value.

but still the both the image controls display only one image.

it should be possible to use expression to show image conditionally.

set image value property to expression, for example, for URL image:

=iif(<Some condition>,
"http://localhost/Reports/images/48folderopen.jpg",
"http://localhost/Reports/images/16prop.gif")

|||

Hi,

I am using an expression.

One more thing I am getting the path thru the Parameters.

I have two different Paths one for customer logo and another is company logo

and i have used the parameters in iif conditon.

example: iif((Globals!PageNumber) Mod 2 = 0,Parameters!RgLogoPath.Value,Parameters!CustLogoPath.Value)

one more thing i tried is

place two image controls in Page Header and in the Value i used expression and for both the images i gave Parameters!RgLogoPath.Value and Parameters!CustLogoPath.Value respectively. when i saw the preview , only one image was displayed in both image controls

|||Is this happening in page headers only? Does it work differently if put in the report body?

I am not able to load two different images dynamically in an Image control

HI,

Base on pagenumber, i need to display a particular image in first page and another image in next page.

there are two images and has to be displayed alternatively in the pages.

but, it is displaying only one image everytime.

I am using Exteranl and URL based concept and using parameters to pass the values from the front end to the report

One more thing I did was, I place two image controls and passing the URL through two parameters having the URL as the value.

but still the both the image controls display only one image.

it should be possible to use expression to show image conditionally.

set image value property to expression, for example, for URL image:

=iif(<Some condition>,
"http://localhost/Reports/images/48folderopen.jpg",
"http://localhost/Reports/images/16prop.gif")

|||

Hi,

I am using an expression.

One more thing I am getting the path thru the Parameters.

I have two different Paths one for customer logo and another is company logo

and i have used the parameters in iif conditon.

example: iif((Globals!PageNumber) Mod 2 = 0,Parameters!RgLogoPath.Value,Parameters!CustLogoPath.Value)

one more thing i tried is

place two image controls in Page Header and in the Value i used expression and for both the images i gave Parameters!RgLogoPath.Value and Parameters!CustLogoPath.Value respectively. when i saw the preview , only one image was displayed in both image controls

|||Is this happening in page headers only? Does it work differently if put in the report body?