We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4018
    • 1,131 Posts
    Hey everyone!

    Just started a new job and, after some evaluation, I believe MODX would be a good fit for these folks. However, they use Microsoft SQL for their server and make use of quite a few stored procedures. Question is: Does MODX support this? How hard would it be to create a custom data model in xPDO that supports stored procedures? They're likely to update the model quite a bit so...definitely needs to be easy to manage. Doable?

    Thx!

    Jeff Whitfield
      Jeff Whitfield

      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
      • 15083
      • 697 Posts
      Hi Jeff,

      I have a requirement to use stored routinues in mysql, and thus far have found no documentation on how to do it in xpdo.

      Not saying its not possible....obviously not very many people doing it smiley

      Cheers,

      J
        • 39404
        • 175 Posts
        stalemate resolution associate Reply #3, 11 years, 8 months ago
        Hi Bravado,

        I just came across this thread and thought I might be able to add something here for you. You don't have to use the full xpdo schemantic model, etc. to be able to use it.

        I myself have worked with different versions of SQL Server (2000, 2005, 2008 and a little bit of 2012 back when it was still Denali), and I have done development in MS SQL server with MODX.

        Here is a code snippet to show how you can use xpdo with SQL Server to run a stored procedure. I've managed to run similar code for my own development.

        $spName = "EXEC dbo.sp_some_sp $arg1, $arg2";
        $xpdo = new xPDO("$LOGIN",$USER, $PASSWORD);
        echo $o=($xpdo->connect()) ? 'Connected' : 'Not Connected. lol.';
        
        if (!$db->exec("$spName")) {
        	$Message = $db->errorCode();
        	$ErrorInfo = $db->errorInfo();
        	for ($x = 0; $x < count($ErrorInfo); $x++) {
        		$Message .= "<br/>" . $ErrorInfo[$x];
        	}
        	$success = $G_No;
        } else {
        	$success = $G_Yes;
        }
        


        Hope this helps!

        Stalemate Resolution Associate
          • 4018
          • 1,131 Posts
          Thx for sharing! Well, unfortunately the job I was at that required this was short lived. However, I'm sure some one else will find this to be quite useful. smiley

            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."