473,670 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

load data from XML to SQL using SP

5 New Member
Hi,

I had created the following SP , now in this sp i am unable to do this , pls help me to do this

Expand|Select|Wrap|Line Numbers
  1. create PROCEDURE searchuserdetail
  2.       @EndUser INT,
  3.       @AdminUser INT
  4. AS 
  5.       DECLARE @ErrorMessage AS VARCHAR(200)
  6.       BEGIN
  7.             BEGIN  
  8.                   SELECT    A.[userid]   ,
  9.                             A.[username] ,
  10.                             B.[userrole],
  11.    B.[BILLING_GRP_CD] AS BillingGroupCd
  12.                   FROM      [dbo].USERDETAIL AS A
  13.                             INNER JOIN A.USERROLE  AS B
  14.                                 ON [A].[USERID] = [b].[USERID]
  15.                   WHERE     [A].[ACTIVE] = 1
  16.  AND  [b].[ROLEID] IN ( @Enduser ,
  17.                                                 @Adminuser )
  18.  
  19.             END  


this sp gets the user information from the two tables userrole and userdetail .
Now in this SP temporary table is created and data from the XML is inserted into the table using SP_XML_PREPARED OCUMENT
Temporary table has three column that are fieldName ,fieldvalue and operator.Blank Data table is returned and that sql query is stored in variable in order to use this dynamically . No of record from the temptable is counted and stored in a variable . Using while loop combination of field, value and oprator is applied to the where condition in sql Query

Expand|Select|Wrap|Line Numbers
  1. Column name  
  2.  
  3.  
  4. userid            userid maps to the tablemasterid 
  5. username          username maps to the table tablemasterid table 
  6. Status            it is the status of the user that maps to from tablemasterid 



tablemasterid has following coloumn

Expand|Select|Wrap|Line Numbers
  1. userid      username  useraddress      Status 
  2.  
  3. 1           abcd      address1          1 
  4. 2           ghuj      address2          0
Oct 27 '12 #1
3 2760
Rabbit
12,516 Recognized Expert Moderator MVP
You explained what you're doing with your code but you haven't explained what your question is.
Oct 27 '12 #2
Kumarlalit
5 New Member
My question is load the data from xml using temp table into sql server table as pls see the question everthing is explained
Oct 28 '12 #3
Rabbit
12,516 Recognized Expert Moderator MVP
I've read your post. But you explain nothing about your question. You said you used SP_XML_PREPARED OCUMENT in your stored procedure but it's no where in your stored procedure.
Oct 29 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
9739
by: Bruce A. Julseth | last post by:
When I execute this SQL statement in my PHP code, I get an error "File '.\Address.txt' not found (Errcode: 2)" $File = addslashes(".\Address.txt"); $SQL = "Load Data InFile \"" . $File . "\" into table addresses"; $result = mysql_query($SQL) or die(mysql_error()); The file is located in the same directory as my .PHP file. How do I generate a relative address for this file so that it can be found?
0
6682
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to be able to place the PHP file on the server, and I guess you probably can't do that either. Talk about catch 22... The only other way I can think of is to install MySQL on a machine you control, then import the data there using the method I...
1
16065
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason is for the sake of security. What does that mean ?
6
3396
by: davvid | last post by:
hello, please I would like to know if it's possible to load data in hierarchical table structure with identity column used as pk (for all the tables) : I mean table root (Id_root(pk,identity column generated always), att_r1,...) table leaf (Id_leaf(pk,identity column generated always), id_root(fk ref root), att_l1 ...)
1
5886
by: Uthuras | last post by:
Greetings, Machine : Pentium IV Os Windows 2000 server Product : DB2 UDB Release : 7.2 We are fail to load the following data file format into db2 database table that has long varchar data type. The load command with 'delprioritychar' option does not seem to help much on the loading process.
3
6285
by: subaga | last post by:
Hi, I have to load data into a table with one of the columns defined as NOT NULL, but the file does not have data for it. i would like to load a constant value for this column and the constant value changes for each load. I was wondering how can i do this without processing the file to add the constant. i dont see any options in load command to specify defaults for columns. The only solution that i can think of is to load the file...
3
2746
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to phpinfo, the "mysql api client is ver. 4.0.25" - I have no idea how this relates, if at all, to the mysql engine's version. background:
0
321
by: drec | last post by:
I have a table in which its primary key is auto-incremented. Yet, when I try to load data using load data infile, this column will not auto-increment. I am leaving that column blank in my file to be uploaded, yet it fills this value in with a zero for all records. Should I be using a php script to load this file? Why isnt this updating correctly?
0
1946
by: abrahamvk | last post by:
Hi, How to load data into Japanese DB2 Database using DB2 Load Utility, where the table column names are in Japanese in windows environment. We could successfully load Japanese data into a table which has English column names only. The DB2 Load Utility could not understand a table that has column names in Japanese. We tried loading data after setting the following 1. Setting the DB2CodePage to 1208 2. Setting the environment...
0
2161
by: lanesbalik | last post by:
hi all, right now i'm trying to migrate from db2 running under linux to mysql v5.1. i manage to export out the db2 structure & data into a del (ascii) file. but when i try to load the data from the del file to mysql table, it generate an error. below is the load data infile syntax i use =
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.